Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-23 Thread Nick Piggin
On Thu, Aug 23, 2007 at 11:26:48AM +0200, Peter Zijlstra wrote: > On Thu, 2007-08-23 at 05:38 +0200, Nick Piggin wrote: > > On Tue, Aug 21, 2007 at 04:07:15PM +0200, Peter Zijlstra wrote: > > > On Tue, 2007-08-21 at 02:39 +0200, Nick Piggin wrote: > > > > > > > > Although interestingly, we are

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-23 Thread Peter Zijlstra
On Thu, 2007-08-23 at 14:11 +0400, Nikita Danilov wrote: > Peter Zijlstra writes: > > [...] > > > My idea is to extend kswapd, run cpus_per_node instances of kswapd per > > node for each of GFP_KERNEL, GFP_NOFS, GFP_NOIO. (basically 3 kswapds > > per cpu) > > > > whenever we would hit

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-23 Thread Nikita Danilov
Peter Zijlstra writes: [...] > My idea is to extend kswapd, run cpus_per_node instances of kswapd per > node for each of GFP_KERNEL, GFP_NOFS, GFP_NOIO. (basically 3 kswapds > per cpu) > > whenever we would hit direct reclaim, add ourselves to a special > waitqueue corresponding to the

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-23 Thread Peter Zijlstra
On Thu, 2007-08-23 at 05:38 +0200, Nick Piggin wrote: > On Tue, Aug 21, 2007 at 04:07:15PM +0200, Peter Zijlstra wrote: > > On Tue, 2007-08-21 at 02:39 +0200, Nick Piggin wrote: > > > > > > Although interestingly, we are not guaranteed to have enough memory to > > > completely initialise writeout

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-23 Thread Peter Zijlstra
On Thu, 2007-08-23 at 05:38 +0200, Nick Piggin wrote: On Tue, Aug 21, 2007 at 04:07:15PM +0200, Peter Zijlstra wrote: On Tue, 2007-08-21 at 02:39 +0200, Nick Piggin wrote: Although interestingly, we are not guaranteed to have enough memory to completely initialise writeout of a single

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-23 Thread Nikita Danilov
Peter Zijlstra writes: [...] My idea is to extend kswapd, run cpus_per_node instances of kswapd per node for each of GFP_KERNEL, GFP_NOFS, GFP_NOIO. (basically 3 kswapds per cpu) whenever we would hit direct reclaim, add ourselves to a special waitqueue corresponding to the type of

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-23 Thread Peter Zijlstra
On Thu, 2007-08-23 at 14:11 +0400, Nikita Danilov wrote: Peter Zijlstra writes: [...] My idea is to extend kswapd, run cpus_per_node instances of kswapd per node for each of GFP_KERNEL, GFP_NOFS, GFP_NOIO. (basically 3 kswapds per cpu) whenever we would hit direct reclaim,

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-23 Thread Nick Piggin
On Thu, Aug 23, 2007 at 11:26:48AM +0200, Peter Zijlstra wrote: On Thu, 2007-08-23 at 05:38 +0200, Nick Piggin wrote: On Tue, Aug 21, 2007 at 04:07:15PM +0200, Peter Zijlstra wrote: On Tue, 2007-08-21 at 02:39 +0200, Nick Piggin wrote: Although interestingly, we are not guaranteed

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-22 Thread Nick Piggin
On Tue, Aug 21, 2007 at 04:07:15PM +0200, Peter Zijlstra wrote: > On Tue, 2007-08-21 at 02:39 +0200, Nick Piggin wrote: > > > > Although interestingly, we are not guaranteed to have enough memory to > > completely initialise writeout of a single page. > > Yes, that is due to the unbounded nature

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-22 Thread Nick Piggin
On Tue, Aug 21, 2007 at 04:07:15PM +0200, Peter Zijlstra wrote: On Tue, 2007-08-21 at 02:39 +0200, Nick Piggin wrote: Although interestingly, we are not guaranteed to have enough memory to completely initialise writeout of a single page. Yes, that is due to the unbounded nature of

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-21 Thread Peter Zijlstra
On Tue, 2007-08-21 at 02:39 +0200, Nick Piggin wrote: > On Mon, Aug 20, 2007 at 11:14:08PM +0200, Peter Zijlstra wrote: > > On Mon, 2007-08-20 at 13:27 -0700, Christoph Lameter wrote: > > > On Mon, 20 Aug 2007, Peter Zijlstra wrote: > > > > > > > > Plus the same issue can happen today. Writes are

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-21 Thread Peter Zijlstra
On Mon, 2007-08-20 at 14:17 -0700, Christoph Lameter wrote: > On Mon, 20 Aug 2007, Peter Zijlstra wrote: > > > > Its not that different. > > > > Yes it is, disk based completion does not require memory, network based > > completion requires unbounded memory. > > Disk based completion only

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-21 Thread Peter Zijlstra
On Tue, 2007-08-21 at 02:39 +0200, Nick Piggin wrote: On Mon, Aug 20, 2007 at 11:14:08PM +0200, Peter Zijlstra wrote: On Mon, 2007-08-20 at 13:27 -0700, Christoph Lameter wrote: On Mon, 20 Aug 2007, Peter Zijlstra wrote: Plus the same issue can happen today. Writes are usually not

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-21 Thread Peter Zijlstra
On Mon, 2007-08-20 at 14:17 -0700, Christoph Lameter wrote: On Mon, 20 Aug 2007, Peter Zijlstra wrote: Its not that different. Yes it is, disk based completion does not require memory, network based completion requires unbounded memory. Disk based completion only require no memory

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Nick Piggin
On Mon, Aug 20, 2007 at 11:14:08PM +0200, Peter Zijlstra wrote: > On Mon, 2007-08-20 at 13:27 -0700, Christoph Lameter wrote: > > On Mon, 20 Aug 2007, Peter Zijlstra wrote: > > > > > > Plus the same issue can happen today. Writes are usually not completed > > > > during reclaim. If the writes

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Christoph Lameter
On Mon, 20 Aug 2007, Peter Zijlstra wrote: > > Its not that different. > > Yes it is, disk based completion does not require memory, network based > completion requires unbounded memory. Disk based completion only require no memory if its not on a stack of other devices and if the interrupt

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Peter Zijlstra
On Mon, 2007-08-20 at 13:27 -0700, Christoph Lameter wrote: > On Mon, 20 Aug 2007, Peter Zijlstra wrote: > > > > Plus the same issue can happen today. Writes are usually not completed > > > during reclaim. If the writes are sufficiently deferred then you have the > > > same issue now. > > > >

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Christoph Lameter
On Mon, 20 Aug 2007, Peter Zijlstra wrote: > > Plus the same issue can happen today. Writes are usually not completed > > during reclaim. If the writes are sufficiently deferred then you have the > > same issue now. > > Once we have initiated (disk) writeout we do not need more memory to >

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Peter Zijlstra
On Mon, 2007-08-20 at 12:00 -0700, Christoph Lameter wrote: > On Sat, 18 Aug 2007, Pavel Machek wrote: > > > > The reclaim is of particular important to stacked filesystems that may > > > do a lot of allocations in the write path. Reclaim will be working > > > as long as there are clean file

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Christoph Lameter
On Sat, 18 Aug 2007, Pavel Machek wrote: > > The reclaim is of particular important to stacked filesystems that may > > do a lot of allocations in the write path. Reclaim will be working > > as long as there are clean file backed pages to reclaim. > > I don't get it. Lets say that we have

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Christoph Lameter
On Sat, 18 Aug 2007, Pavel Machek wrote: The reclaim is of particular important to stacked filesystems that may do a lot of allocations in the write path. Reclaim will be working as long as there are clean file backed pages to reclaim. I don't get it. Lets say that we have stacked

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Peter Zijlstra
On Mon, 2007-08-20 at 12:00 -0700, Christoph Lameter wrote: On Sat, 18 Aug 2007, Pavel Machek wrote: The reclaim is of particular important to stacked filesystems that may do a lot of allocations in the write path. Reclaim will be working as long as there are clean file backed pages to

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Christoph Lameter
On Mon, 20 Aug 2007, Peter Zijlstra wrote: Plus the same issue can happen today. Writes are usually not completed during reclaim. If the writes are sufficiently deferred then you have the same issue now. Once we have initiated (disk) writeout we do not need more memory to complete it,

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Peter Zijlstra
On Mon, 2007-08-20 at 13:27 -0700, Christoph Lameter wrote: On Mon, 20 Aug 2007, Peter Zijlstra wrote: Plus the same issue can happen today. Writes are usually not completed during reclaim. If the writes are sufficiently deferred then you have the same issue now. Once we have

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Christoph Lameter
On Mon, 20 Aug 2007, Peter Zijlstra wrote: Its not that different. Yes it is, disk based completion does not require memory, network based completion requires unbounded memory. Disk based completion only require no memory if its not on a stack of other devices and if the interrupt handles

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-20 Thread Nick Piggin
On Mon, Aug 20, 2007 at 11:14:08PM +0200, Peter Zijlstra wrote: On Mon, 2007-08-20 at 13:27 -0700, Christoph Lameter wrote: On Mon, 20 Aug 2007, Peter Zijlstra wrote: Plus the same issue can happen today. Writes are usually not completed during reclaim. If the writes are

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-18 Thread Pavel Machek
Hi! > If we exhaust the reserves in the page allocator when PF_MEMALLOC is set > then no longer give up but call into reclaim with PF_MEMALLOC set. > > This is in essence a recursive call back into page reclaim with another > page flag (__GFP_NOMEMALLOC) set. The recursion is bounded since

Re: [RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-18 Thread Pavel Machek
Hi! If we exhaust the reserves in the page allocator when PF_MEMALLOC is set then no longer give up but call into reclaim with PF_MEMALLOC set. This is in essence a recursive call back into page reclaim with another page flag (__GFP_NOMEMALLOC) set. The recursion is bounded since potential

[RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-14 Thread Christoph Lameter
If we exhaust the reserves in the page allocator when PF_MEMALLOC is set then no longer give up but call into reclaim with PF_MEMALLOC set. This is in essence a recursive call back into page reclaim with another page flag (__GFP_NOMEMALLOC) set. The recursion is bounded since potential

[RFC 2/9] Use NOMEMALLOC reclaim to allow reclaim if PF_MEMALLOC is set

2007-08-14 Thread Christoph Lameter
If we exhaust the reserves in the page allocator when PF_MEMALLOC is set then no longer give up but call into reclaim with PF_MEMALLOC set. This is in essence a recursive call back into page reclaim with another page flag (__GFP_NOMEMALLOC) set. The recursion is bounded since potential