public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	Suresh Siddha <suresh.b.siddha@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>, Andi Kleen <ak@suse.de>,
	Tony Luck <tony.luck@intel.com>,
	Asit Mallick <asit.k.mallick@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	benh@kernel.crashing.org
Subject: Re: What was the problem with quicklists and x86-64?
Date: Thu, 13 Dec 2007 14:27:16 -0800	[thread overview]
Message-ID: <20071213222716.GA20208@linux-os.sc.intel.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0712131131540.13396@schroedinger.engr.sgi.com>

On Thu, Dec 13, 2007 at 11:47:29AM -0800, Christoph Lameter wrote:
> On Wed, 12 Dec 2007, Jeremy Fitzhardinge wrote:
> 
> > I'm looking at unifying the various pgalloc+pgd_lists mechanisms between
> > 32-bit (PAE and non-PAE) and 64-bit, so I'm trying to understand why
> > these differences exist in the first place.
> > 
> > Change da8f153e51290e7438ba7da66234a864e5d3e1c1 reverted the use of
> > quicklists for allocating pagetables, because of concerns about ordering
> > with respect to tlb flushes.
> 
> These issues only exist with NUMA because of the freeing of off node pages 
> before the TLB flush was done. There was a discussion about this issue and 
> my fix of simply not freeing the offnode pages early was ignored. Instead 
> the x86_64 implementation (which has no problems that I know of) was 

NUMA  bug might not be the only problem. I think there are more issues
as Linus noticed.

<snip>
Oh, and I see what's wrong: you not only switched "free_page()" to 
"quicklist_free()", you *also* switched "tlb_remove_page()" to 
"quicklist_free()".
</snip>

The above comment is in reference to below portion of code:

-#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
+#define __pte_free_tlb(tlb,pte) quicklist_free_page(QUICK_PT, NULL,(pte))

tlb_remove_page() was marking tlb->need_flush. Which is later used
by tlb_flush_mmu(). With quicklist_free_page() we loose all that..

Now in a corner case scenario  with a big munmap() which calls unmap_region()
and if it so happens that the region getting unmapped just has page
tables setup but with all PTE's set to NULL, unmap_region() may
potentially free the page table pages
	[ tlb_finish_mmu() calls check_pgt_cache() which trims quicklist ]
with out flushing the TLB's.
	[ (tlb_finish_mmu() calls the tlb_flush_mmu() but it will not do
           much as need_flush is not set ]

Similarly Linus brought pre-emptions issues associated with quicklist usage..

thanks,
suresh

  parent reply	other threads:[~2007-12-13 22:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-12 19:14 What was the problem with quicklists and x86-64? Jeremy Fitzhardinge
2007-12-13 19:47 ` Christoph Lameter
2007-12-13 20:47   ` Benjamin Herrenschmidt
2007-12-13 20:53     ` Christoph Lameter
2007-12-13 21:03       ` Benjamin Herrenschmidt
2007-12-13 21:33         ` Christoph Lameter
2007-12-13 22:27           ` Benjamin Herrenschmidt
2007-12-13 22:36             ` Christoph Lameter
2007-12-13 23:10               ` Benjamin Herrenschmidt
2007-12-13 23:14                 ` Christoph Lameter
2007-12-13 23:19                   ` Benjamin Herrenschmidt
2007-12-13 22:27   ` Siddha, Suresh B [this message]
2007-12-13 22:52     ` Christoph Lameter
2007-12-13 20:54 ` Siddha, Suresh B

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=20071213222716.GA20208@linux-os.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=asit.k.mallick@intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=clameter@sgi.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tony.luck@intel.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