public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Paul Mackerras <paulus@samba.org>, Andrew Morton <akpm@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	linux-ia64@vger.kernel.org, Anton Blanchard <anton@samba.org>
Subject: Re: Page fault scalability patch V18: Drop first acquisition of ptl
Date: Thu, 03 Mar 2005 17:11:53 +1100	[thread overview]
Message-ID: <1109830313.5680.183.camel@gaston> (raw)
In-Reply-To: <Pine.LNX.4.58.0503022149210.4272@schroedinger.engr.sgi.com>

On Wed, 2005-03-02 at 21:51 -0800, Christoph Lameter wrote:
> On Wed, 2 Mar 2005, David S. Miller wrote:
> 
> > Actually, I guess I could do the pte_cmpxchg() stuff, but only if it's
> > used to "add" access.  If the TLB miss handler races, we just go into
> > the handle_mm_fault() path unnecessarily in order to synchronize.
> >
> > However, if this pte_cmpxchg() thing is used for removing access, then
> > sparc64 can't use it.  In such a case a race in the TLB handler would
> > result in using an invalid PTE.  I could "spin" on some lock bit, but
> > there is no way I'm adding instructions to the carefully constructed
> > TLB miss handler assembler on sparc64 just for that :-)
> 
> There is no need to provide pte_cmpxchg. If the arch does not support
> cmpxchg on ptes (CONFIG_ATOMIC_TABLE_OPS not defined)
> then it will fall back to using pte_get_and_clear while holding the
> page_table_lock to insure that the entry is not touched while performing
> the comparison.

Nah, this is wrong :)

We actually _want_ pte_cmpxchg on ppc64, because we can do the stuff,
but it requires some careful manipulation of some bits in the PTE that
are beyond linux common layer understanding :) Like the BUSY bit which
is a lock bit for arbitrating with the hash fault handler for example.

Also, if it's ever used to cmpxchg from anything but a !present PTE, it
will need additional massaging (like the COW case where we just
"replace" a PTE with set_pte). We also need to preserve some bits in
there that indicate if the PTE was in the hash table and where in the
hash so we can flush it afterward.

Ben.



  reply	other threads:[~2005-03-03  6:55 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-02  3:49 Page fault scalability patch V18: Overview Christoph Lameter
2005-03-02  3:50 ` Page fault scalability patch V18: atomic pte ops, pte_cmpxchg and pte_xchg Christoph Lameter
2005-03-02  3:51 ` Page fault scalability patch V18: abstract rss counter ops Christoph Lameter
2005-03-02  3:51 ` Page fault scalability patch V18: Drop first acquisition of ptl Christoph Lameter
2005-03-03  1:45   ` Andrew Morton
2005-03-03  2:13     ` Christoph Lameter
2005-03-03  2:55       ` Andrew Morton
2005-03-03  3:17         ` Christoph Lameter
2005-03-03  4:14           ` Andrew Morton
2005-03-03  4:27             ` Christoph Lameter
2005-03-03  4:56               ` Andrew Morton
2005-03-03  5:17                 ` Christoph Lameter
2005-03-03  5:37                   ` Andrew Morton
2005-03-03  5:48                     ` Christoph Lameter
2005-03-03  6:13                 ` Christoph Lameter
2005-03-03  6:20                   ` Andrew Morton
2005-03-03 16:54                     ` Christoph Lameter
2005-03-03 21:20                       ` Andrew Morton
2005-03-03 22:14                         ` Christoph Lameter
2005-03-04 16:44                         ` Christoph Lameter
2005-03-04 17:09                           ` Hugh Dickins
2005-03-04 18:29                             ` Christoph Lameter
2005-03-04 19:08                               ` Hugh Dickins
2005-03-31  6:55                             ` Avoid spurious page faults by avoiding pte_clear -> set pte Christoph Lameter
2005-03-04 16:46                         ` Page fault scalability patch V18: Drop first acquisition of ptl Christoph Lameter
2005-03-03  5:00             ` Paul Mackerras
2005-03-03  5:19               ` Christoph Lameter
2005-03-03  5:38               ` David S. Miller
2005-03-03  5:51                 ` Christoph Lameter
2005-03-03  6:11                   ` Benjamin Herrenschmidt [this message]
2005-03-03 16:52                     ` Christoph Lameter
2005-03-03  5:54                 ` Benjamin Herrenschmidt
2005-03-03 17:19                   ` Nick Piggin
2005-03-03  6:30                     ` Benjamin Herrenschmidt
2005-03-03  7:44                       ` Nick Piggin
2005-03-03 17:43                       ` David S. Miller
2005-03-03  5:24             ` Nick Piggin
2005-03-02  3:52 ` Page fault scalability patch V18: No page table lock in do_anonymous_page Christoph Lameter
2005-03-04  2:18 ` Page fault scalability patch V18: Overview Darren Williams
2005-03-04  2:47   ` Darren Williams
2005-03-04 16:15     ` Christoph Lameter
2005-03-06 21:49       ` Darren Williams
2005-03-06 23:59         ` Christoph Lameter
2005-03-07  3:32           ` Darren Williams
2005-03-08  4:03             ` Christoph Lameter

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=1109830313.5680.183.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=anton@samba.org \
    --cc=clameter@sgi.com \
    --cc=davem@davemloft.net \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox