public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrea Arcangeli <andrea@novell.com>
Cc: "Martin J. Bligh" <mbligh@aracnet.com>,
	Andrew Morton <akpm@osdl.org>, Andrew Morton <akpm@digeo.com>,
	linux-kernel@vger.kernel.org
Subject: Re: PG_zero
Date: Wed, 03 Nov 2004 12:23:12 +1100	[thread overview]
Message-ID: <41883300.8060707@yahoo.com.au> (raw)
In-Reply-To: <20041103010952.GA3571@dualathlon.random>

Andrea Arcangeli wrote:
> On Tue, Nov 02, 2004 at 02:41:15PM -0800, Martin J. Bligh wrote:
> 
>>eh? I don't see how that matters at all. After the DMA transfer, all the 
>>cache lines will have to be invalidated in every CPUs cache anyway, so
>>it's guaranteed to be stone-dead zero-degrees-kelvin cold. I don't see how
>>however hot it becomes afterwards is relevant? 
> 
> 
> if the cold page becomes hot, it means the hot pages in the hot
> quicklist will become colder. The cache size is limited, so if something
> becomes hot, something will become cold.
> 
> The only difference is that the hot pages will become cold during the
> dma if we return an hot page, or the hot pages will become cold while
> the cpu touches the data of the previously cold page, if we return a
> cold page. Or are you worried that the cache snooping is measurable?
> 
> I believe the hot-cold thing, is mostly important for the hot
> allocations not for the cold one. So that the hot allocations are served
> in a strict LIFO order, that truly matters but the cold allocations are
> a grey area.
> 
> What kind of slowdown can you measure if you drop __GFP_COLD enterely?
> 
> Don't get me wrong, __GFP_COLD makes perfect sense since it's so little
> cost to do it that it most certainly worth the branch in the
> allocator, but I don't think the hot pages worth a _reservation_ since
> they'll become cold anwyays after the I/O has completed, so then we
> could have returned an hot page in the first place without slowing down
> in the buddy to get it.
> 

I see what you mean. You could be correct that it would model cache
behaviour better to just have the last N freed "hot" pages in LIFO
order on the list, and allocate cold pages from the other end of it.

You still don't want cold freeing to pollute this list, *but* you do
want to still batch up cold freeing to amortise the buddy's lock
aquisition.

You could do that with just one list, if you gave cold pages a small
extra allowance to batch freeing if the list is full.

> 
>>If the DMA is to pages that are hot in the CPUs cache - it's WORSE ... we
>>have more work to do in terms of cacheline invalidates. Mmm ... in terms
>>of DMAs, we're talking about disk reads (ie a new page allocates) - we're
>>both on the same page there, right?
> 
> 
> the DMA snoops the cache for the cacheline invalidate but I didn't think
> it's measurable.
> 
> I would really like to see the performance difference of disabling the
> __GFP_COLD thing for the allocations and to force picking from the head
> of the list (and to always free the cold pages a the tail), I doubt you
> will measure anything.
> 

I think you want to still take them off the cold end. Taking a
really cache hot page and having it invalidated is worse than
having some cachelines out of your combined pool of hot pages
pushed out when you heat the cold page.


  parent reply	other threads:[~2004-11-03  1:23 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 ` PG_zero Nick Piggin
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                   ` Nick Piggin [this message]
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=41883300.8060707@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@digeo.com \
    --cc=akpm@osdl.org \
    --cc=andrea@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.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