From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrea Arcangeli <andrea@novell.com>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, Martin J Bligh <mjbligh@us.ibm.com>
Subject: Re: PG_zero
Date: Tue, 02 Nov 2004 04:26:02 +1100 [thread overview]
Message-ID: <418671AA.6020307@yahoo.com.au> (raw)
In-Reply-To: <20041030141059.GA16861@dualathlon.random>
Andrea Arcangeli wrote:
> This experiment is incremental with lowmem_reserve-3 (downloadble in the
> same place), and it's against 2.6.9, it rejects against kernel CVS but
> it should be easy to fixup.
>
> http://www.kernel.org/pub/linux/kernel/people/andrea/patches/v2.6/2.6.9/PG_zero-2
>
...
> Some fix included in the patch is to fallback in the quicklist for the
> whole classzone before eating from the buddy, otherwise 1G boxes are
> very penalized in terms of entering the buddy system too early, and not
> using the quicklists of the lower zones (2.4-aa wasn't penalized). Plus
> this adds a sysctl so the thing is tunable at runtime. And there was no
> need of using two quicklists for cold and hot pages, less resources are
> wasted by just using the lru ordering to diferentiate from hot/cold
> allocations and hot/cold freeing.
>
Not sure if this is wise. Reclaimed pages should definitely be cache
cold. Other freeing is assumed cache hot and LRU ordered on the hot
list which seems right... but I think you want the cold list for page
reclaim, don't you?
> The API with PG_zero is that if you set __GFP_ZERO in the gfp_mask, then
> you must check PG_zero. If PG_zero is set, then you don't need to clear
> the page. However you must clear PG_zero before freeing the page if its
> contents are not zero anymore by the time you free it, or future users
> of __GFP_ZERO will be screwed. So the pagetables for example never clear
> PG_zero for the whole duration of the page, infact they set PG_zero if
> they're forced to execute clear_page. shmem as well in a fail path if it
> fails getting an entry it will free the zero page again and it won't
> have to touch PG_zero since it didn't modify the page contents.
>
Could the API be made nicer by clearing the page for you if it didn't
find a PG_zero page?
>
> Obvious improvements would be to implement a long_write_zero(ptr)
> operation that doesn't pollute the cache. IIRC it exists on the alpha, I
> assume it exists on x86/x86-64 too. But that's incremental on top of
> this.
>
> It seems stable, I'm running it while writing this.
>
> I guess testing on a memory bound architecture would be more interesting
> (more cpus will make it more memory bound somewhat).
>
> Comments welcome.
>
I have the feeling that it might not be worthwhile doing zero on idle.
You've got chance of blowing the cache on zeroing pages that won't be
used for a while. If you do uncached writes then you've changed the
problem to memory bandwidth (I guess doesn't matter much on UP).
It seems like a good idea to do zero pages in the page allocator if
at all (rather than slab), but I guess you don't want to complicate
it unless it shows improvements in macro benchmarks.
Sorry my feedback isn't much, it is not based on previous experience.
next prev parent reply other threads:[~2004-11-01 18:31 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-30 14:10 PG_zero Andrea Arcangeli
2004-10-30 21:07 ` PG_zero Andrew Morton
2004-10-30 22:45 ` PG_zero Andrea Arcangeli
2004-10-31 15:35 ` PG_zero Martin J. Bligh
2004-11-01 21:57 ` PG_zero Andrea Arcangeli
2004-11-01 22:05 ` PG_zero Martin J. Bligh
2004-11-02 3:41 ` PG_zero William Lee Irwin III
2004-10-31 15:17 ` PG_zero Martin J. Bligh
2004-11-02 13:53 ` PG_zero Andy Whitcroft
2004-11-02 19:39 ` PG_zero Andrea Arcangeli
2004-11-01 17:26 ` Nick Piggin [this message]
2004-11-01 18:03 ` PG_zero Martin J. Bligh
2004-11-01 22:34 ` PG_zero Andrea Arcangeli
2004-11-01 23:47 ` PG_zero Martin J. Bligh
2004-11-02 1:47 ` PG_zero Nick Piggin
2004-11-02 2:21 ` PG_zero Andrea Arcangeli
2004-11-02 2:54 ` PG_zero Nick Piggin
2004-11-02 15:42 ` PG_zero Martin J. Bligh
2004-11-02 19:50 ` PG_zero Andrea Arcangeli
2004-11-02 22:41 ` PG_zero Martin J. Bligh
2004-11-03 1:26 ` PG_zero Andrea Arcangeli
2004-11-02 21:09 ` PG_zero Andrew Morton
2004-11-02 21:56 ` PG_zero Andrea Arcangeli
2004-11-02 22:41 ` PG_zero Martin J. Bligh
2004-11-03 1:09 ` PG_zero Andrea Arcangeli
2004-11-03 1:18 ` PG_zero Martin J. Bligh
2004-11-03 1:23 ` PG_zero Nick Piggin
2004-11-03 2:05 ` PG_zero Andrea Arcangeli
2004-11-03 11:53 ` PG_zero Andrea Arcangeli
2004-11-03 12:10 ` PG_zero Pavel Machek
2004-11-01 22:24 ` PG_zero Andrea Arcangeli
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=418671AA.6020307@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@osdl.org \
--cc=andrea@novell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjbligh@us.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox