public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickens <hugh@veritas.com>,
	David Rientjes <rientjes@google.com>,
	Zachary Amsden <zach@vmware.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Rusty Russell <rusty@rustcorp.com.au>, Andi Kleen <ak@suse.de>,
	Keir Fraser <keir@xensource.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: race with page_referenced_one->ptep_test_and_clear_young and pagetable setup/pulldown
Date: Thu, 04 Oct 2007 21:08:42 -0700	[thread overview]
Message-ID: <4705B8CA.5070608@goop.org> (raw)
In-Reply-To: <20071004194432.9b3353c2.akpm@linux-foundation.org>

Andrew Morton wrote:
> y'know, I think I think it's been several years since I saw a report of an
> honest to goodness, genuine SMP race in core kernel.  We used to be
> infested by them, but the term has fallen into disuse.  Interesting, but
> OT.
>   

I was a bit surprised to find myself typing it too.  I guess it could
also be a preempt race, which has been a bit more common.  Anyway, its a
deliberately unlocked access to the pagetable structure, so not terribly
surprising.

>> It seems to me that there are a few ways to fix this:
>>
>>    1. Use asm-generic/pgtable.h when CONFIG_PARAVIRT is enabled.  This
>>       will clearly work, but is pretty blunt.
>>    2. Make test_and_clear_pte_flags a new paravirt-op, which can be
>>       implemented in Xen as a hypercall, and as a raw test_and_clear_bit
>>       for everyone else.  The downside is adding yet another pv-op.
>>    3. Restructure the pagetable setup code so that the mm is not added
>>       to the prio tree until after arch_dup_mmap has been called (and
>>       the converse for exit_mmap).  This is arguably cleaner, but I
>>       haven't looked to see how much trouble this would be.
>>
>> Thoughts anyone?  Does making the pagetables visible "early" cause
>> problems for anyone else?
>>     
>
> I expect that 2) has the maximum niceness*suitable-for-2.6.23 product.
>   

OK, I'll whip a patch together.

> That's if you actually care much about kernel.org major releases - do many
> people run kernel.org kernels on Xen? 

Well, given that there hasn't been a Xen-capable kernel.org release yet,
no...  But we'll see what happens when .23 goes out the door.

>  If "not many" then we could perhaps
> do something more elaborate for 2.6.23.1.  But adding ever more pvops as
> core kernel evolves was always expected.
>   

I think keep it simple for now; anything significant can wait for the
brave new world of unified x86.

    J


  reply	other threads:[~2007-10-05  4:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-05  1:43 race with page_referenced_one->ptep_test_and_clear_young and pagetable setup/pulldown Jeremy Fitzhardinge
2007-10-05  1:52 ` Rik van Riel
2007-10-05  4:15   ` Jeremy Fitzhardinge
2007-10-05 13:17     ` Rik van Riel
2007-10-05  2:44 ` Andrew Morton
2007-10-05  4:08   ` Jeremy Fitzhardinge [this message]
2007-10-07  9:52   ` Nick Piggin
2007-10-05 11:36 ` Hugh Dickins
2007-10-05 18:58   ` Rik van Riel
2007-10-05 19:40     ` Jeremy Fitzhardinge
2007-10-05 19:56       ` Rik van Riel
2007-10-05 19:39   ` Jeremy Fitzhardinge
     [not found] <C32B9BEC.E711%keir@xensource.com>
2007-10-05  8:03 ` Andi Kleen
2007-10-05  9:05 ` Jeremy Fitzhardinge
2007-10-05  9:15   ` Keir Fraser
2007-10-05 15:33     ` Hugh Dickins
2007-10-05 15:46       ` Keir Fraser
2007-10-05 16:48         ` Jeremy Fitzhardinge
2007-10-05 20:35         ` Jeremy Fitzhardinge

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=4705B8CA.5070608@goop.org \
    --to=jeremy@goop.org \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=keir@xensource.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    --cc=rusty@rustcorp.com.au \
    --cc=torvalds@linux-foundation.org \
    --cc=zach@vmware.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