mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andi Kleen <ak@suse.de>, Christoph Lameter <clameter@sgi.com>,
	linux-kernel@vger.kernel.org
Subject: Re: slub-i386-support.patch
Date: Fri, 11 May 2007 00:14:14 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0705102349150.24200@blonde.wat.veritas.com> (raw)
In-Reply-To: <20070510203102.GO19966@holomorphy.com>

On Thu, 10 May 2007, William Lee Irwin III wrote:
> On Thu, May 10, 2007 at 09:03:39PM +0100, Hugh Dickins wrote:
> > Though when I look at the patchset (copied below), I do wonder why
> > it puts a quicklist_trim() into i386's cpu_idle() and flush_tlb_mm():
> > neither is where I'd expect us to be secretly freeing pages.  Ah,
> > several arches do it in cpu_idle(): how odd, oh well.
> 
> So now quicklist semantics vs. TLB flushing are the motive behind the
> odd flush_tlb_mm() affair. The real trick with it is that flushing
> must never occur until the TLB flush. Any change to the core quicklist
> code that retires pages back to the page allocator earlier (e.g. based
> on some limit) will break things badly.

I don't think that's right.  It's vital that TLB (of an active mm)
be flushed before freeing its page back to the quicklist, before it's
recycled to another mm (or elsewhere in this mm); but having done that,
it really doesn't matter much when quicklist_trim() (check_pgt_cache)
is called to free surplus pages from quicklist back to page_alloc.c.

tlb_finish_mmu() happens to be the traditional place it's done, and
that's where we expect it.  flush_tlb_mm() avoids flushing TLB unless
it's actually required for the mm in question: so wouldn't be a good
place to rely on flushing TLB for pages freed earlier from other mms
(but we'd already be in trouble to be leaving them that late).

I'm guessing (haven't rechecked source) that the cpu_idle() call comes
about because the top level pgd of a process gets freed very late in
its exit, and after a great flurry of processes have just exited,
perhaps there was nothing to free up the accumulation.  Though
it still strikes me as an odd place to do it.

Hugh

  parent reply	other threads:[~2007-05-10 23:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10 20:03 slub-i386-support.patch Hugh Dickins
2007-05-10 20:17 ` slub-i386-support.patch Andrew Morton
2007-05-10 20:31   ` slub-i386-support.patch Christoph Lameter
2007-05-10 20:50     ` slub-i386-support.patch David Miller
2007-05-10 20:31 ` slub-i386-support.patch William Lee Irwin III
2007-05-10 20:35   ` slub-i386-support.patch Christoph Lameter
2007-05-10 21:09     ` slub-i386-support.patch William Lee Irwin III
2007-05-10 21:28       ` slub-i386-support.patch Jeremy Fitzhardinge
2007-05-10 23:35         ` slub-i386-support.patch William Lee Irwin III
2007-05-10 21:22     ` slub-i386-support.patch Jeremy Fitzhardinge
2007-05-10 23:14   ` Hugh Dickins [this message]
2007-05-11  0:07     ` slub-i386-support.patch William Lee Irwin III
2007-05-11  1:08       ` slub-i386-support.patch William Lee Irwin III
2007-05-11  5:09         ` slub-i386-support.patch Christoph Lameter
2007-05-11  7:43           ` slub-i386-support.patch William Lee Irwin III
2007-05-11  1:42       ` slub-i386-support.patch William Lee Irwin III
2007-05-11  8:29     ` slub-i386-support.patch Andi Kleen
2007-05-11  7:42       ` slub-i386-support.patch Andrew Morton
2007-05-11  7:54         ` slub-i386-support.patch William Lee Irwin III
2007-05-11 16:15           ` slub-i386-support.patch Christoph Lameter
2007-05-11 20:47             ` slub-i386-support.patch William Lee Irwin III
2007-05-11  9:27         ` slub-i386-support.patch Hugh Dickins

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=Pine.LNX.4.64.0705102349150.24200@blonde.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=wli@holomorphy.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

all inboxes | Powered by JetHome®