All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] 1/4: rework alloc_pages
Date: Fri, 06 Aug 2004 16:05:26 +1000	[thread overview]
Message-ID: <41131FA6.4070402@yahoo.com.au> (raw)
In-Reply-To: <20040805223725.246b0950.akpm@osdl.org>

Andrew Morton wrote:
> Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> 
>>Andrew Morton wrote:
>>
>>>Nick Piggin <nickpiggin@yahoo.com.au> wrote:
>>>
>>>
>>>>Previously the ->protection[] logic was broken. It was difficult to follow
>>>>and basically didn't use the asynch reclaim watermarks properly.
>>>
>>>
>>>eh?
>>>
>>>Broken how?
>>>
>>
>>min = (1<<order) + z->protection[alloc_type];
>>
>>This value is used both as the condition for waking kswapd, and
>>whether or not to enter synch reclaim.
>>
>>What should happen is kswapd gets woken at pages_low, and synch
>>reclaim is started at pages_min.
> 
> 
> Are you aware of this:
> 
> void wakeup_kswapd(struct zone *zone)
> {
> 	if (zone->free_pages > zone->pages_low)
> 		return;
> 
> ?
> 

Err, yes?

> 
>>pages_low + protection and pages_min + protection, etc.
> 
> 
> Nick, sorry, but I shouldn't have to expend these many braincells
> decrypting your work.  Please: much better explanations, more testing
> results.  This stuff is fiddly, sensitive and has a habit of blowing up in
> our faces weeks later.  We need to be cautious.  The barriers are higher
> nowadays.
> 
> 

OK previously, in a nutshell:

	for_each_zone(z) {
		if (z->free_pages < z->protection)
			continue;
		else
			goto got_pg;
	}

	for_each_zone(z)
		wakeup_kswapd(z);

	for_each_zone(z) {
		if (z->free_pages < z->protection)
			continue;
		else
			goto got_pg;
	}

	try_to_free_pages();

	try again;

After my patch:
	for_each_zone(z) {
		if (z->free_pages < z->pages_low + z->protection)
			continue;
		else
			goto got_pg;
	}

	for_each_zone(z)
		wakeup_kswapd(z);

	for_each_zone(z) {
		if (z->free_pages < z->pages_min + z->protection)
			continue;
		else
			goto got_pg;
	}

	try_to_free_pages();

	try again;

Ie, we have the (pages_low - pages_min) buffer after waking kswapd
before entering synch reclaim. Previously there was no buffer. I thought
this was the point of background reclaim. I don't know if I can explain
it any better than that sorry.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2004-08-06  6:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-06  4:57 [PATCH] 1/4: rework alloc_pages Nick Piggin
2004-08-06  4:57 ` [PATCH] 2/4: highmem watermarks Nick Piggin
2004-08-06  5:03   ` [PATCH] 3/4: writeout watermarks Nick Piggin
2004-08-06  5:04     ` [PATCH] 4/4: incremental min aware kswapd Nick Piggin
2004-08-06  5:27     ` [PATCH] 3/4: writeout watermarks Andrew Morton
2004-08-06  5:34       ` Nick Piggin
2004-08-06  5:49         ` Andrew Morton
2004-08-06  6:13           ` Nick Piggin
2004-08-06  6:19             ` Andrew Morton
2004-08-06  6:36               ` Nick Piggin
2004-08-06  5:12 ` [PATCH] 1/4: rework alloc_pages Nick Piggin
2004-08-06  5:19 ` Andrew Morton
2004-08-06  5:29   ` Nick Piggin
2004-08-06  5:37     ` Andrew Morton
2004-08-06  6:05       ` Nick Piggin [this message]
2004-08-06  6:17         ` Andrew Morton
2004-08-06 12:01         ` Rik van Riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41131FA6.4070402@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.