All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>, Ben LaHaise <bcrl@kvack.org>,
	linux-mm@kvack.org,
	Architectures Group <linux-arch@vger.kernel.org>
Subject: Re: [PATCH] ppc64: Fix possible race with set_pte on a present PTE
Date: Tue, 25 May 2004 14:40:25 +1000	[thread overview]
Message-ID: <1085460025.15024.108.camel@gaston> (raw)
In-Reply-To: <20040525043729.GV29378@dualathlon.random>

On Tue, 2004-05-25 at 14:37, Andrea Arcangeli wrote:
> On Tue, May 25, 2004 at 02:17:41PM +1000, Benjamin Herrenschmidt wrote:
> > on a present PTE (thus letting set_pte be non-atomic) and we can safely
> > BUG_ON(pte_present(*ptep)) in it, right ?
> 
> set_pte is used even to mark the pte non present, so you can forget
> about using BUG_ON(pte_present(*ptep)) anywhere in set_pte regardless of
> how we fix this race (see mm/objrmap.c:unmap_pte_page()). If you want to
> trap for it you should add a set_pte_present and use it at least in
> objrmap.c during the paging.

Isn't this the work of pte_clear ? It's quite important to be very
careful about such PTE manipulations on ppc & ppc64 or we can wreck
everything by losting the hash state bits in there.

> unless you are generating page faults if the young bit is clear, this
> will only slowdown compared to my simpler approch.
> 
> However if some arch is using page faults to set the young bit in
> hardware (not in software), then slowing micro-down x86 and others might
> be an option to share all the common code, but we could easily avoid
> smp locking in x86 and alpha by threating the young-bit-page-fault archs
> differently too. 
> 
> Would be nice to hear from the ia64 folks what they're doing w.r.t. to
> the young bit, I think ia64 is the only one providing the young bit with
> an hardware page fault.
-- 
Benjamin Herrenschmidt <benh@kernel.crashing.org>

WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>, Ben LaHaise <bcrl@kvack.org>,
	linux-mm@kvack.org,
	Architectures Group <linux-arch@vger.kernel.org>
Subject: Re: [PATCH] ppc64: Fix possible race with set_pte on a present PTE
Date: Tue, 25 May 2004 14:40:25 +1000	[thread overview]
Message-ID: <1085460025.15024.108.camel@gaston> (raw)
In-Reply-To: <20040525043729.GV29378@dualathlon.random>

On Tue, 2004-05-25 at 14:37, Andrea Arcangeli wrote:
> On Tue, May 25, 2004 at 02:17:41PM +1000, Benjamin Herrenschmidt wrote:
> > on a present PTE (thus letting set_pte be non-atomic) and we can safely
> > BUG_ON(pte_present(*ptep)) in it, right ?
> 
> set_pte is used even to mark the pte non present, so you can forget
> about using BUG_ON(pte_present(*ptep)) anywhere in set_pte regardless of
> how we fix this race (see mm/objrmap.c:unmap_pte_page()). If you want to
> trap for it you should add a set_pte_present and use it at least in
> objrmap.c during the paging.

Isn't this the work of pte_clear ? It's quite important to be very
careful about such PTE manipulations on ppc & ppc64 or we can wreck
everything by losting the hash state bits in there.

> unless you are generating page faults if the young bit is clear, this
> will only slowdown compared to my simpler approch.
> 
> However if some arch is using page faults to set the young bit in
> hardware (not in software), then slowing micro-down x86 and others might
> be an option to share all the common code, but we could easily avoid
> smp locking in x86 and alpha by threating the young-bit-page-fault archs
> differently too. 
> 
> Would be nice to hear from the ia64 folks what they're doing w.r.t. to
> the young bit, I think ia64 is the only one providing the young bit with
> an hardware page fault.
-- 
Benjamin Herrenschmidt <benh@kernel.crashing.org>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2004-05-25  4:43 UTC|newest]

Thread overview: 153+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-24  3:29 [PATCH] ppc64: Fix possible race with set_pte on a present PTE Benjamin Herrenschmidt
2004-05-24  3:47 ` Linus Torvalds
2004-05-24  4:13   ` Benjamin Herrenschmidt
2004-05-24  4:36     ` Linus Torvalds
2004-05-24  4:44       ` Benjamin Herrenschmidt
2004-05-24  5:10         ` Linus Torvalds
2004-05-24  5:10           ` Linus Torvalds
2004-05-24  5:34           ` Benjamin Herrenschmidt
2004-05-24  5:34             ` Benjamin Herrenschmidt
2004-05-24  5:38             ` Benjamin Herrenschmidt
2004-05-24  5:38               ` Benjamin Herrenschmidt
2004-05-24  5:52               ` Benjamin Herrenschmidt
2004-05-24  5:52                 ` Benjamin Herrenschmidt
2004-05-24  7:39           ` Ingo Molnar
2004-05-24  7:39             ` Ingo Molnar
2004-05-24  5:39             ` Benjamin Herrenschmidt
2004-05-24  5:39               ` Benjamin Herrenschmidt
2004-05-25  3:43           ` Andrea Arcangeli
2004-05-25  3:43             ` Andrea Arcangeli
2004-05-25  4:00             ` Linus Torvalds
2004-05-25  4:00               ` Linus Torvalds
2004-05-25  4:17               ` Benjamin Herrenschmidt
2004-05-25  4:17                 ` Benjamin Herrenschmidt
2004-05-25  4:37                 ` Andrea Arcangeli
2004-05-25  4:37                   ` Andrea Arcangeli
2004-05-25  4:40                   ` Benjamin Herrenschmidt [this message]
2004-05-25  4:40                     ` Benjamin Herrenschmidt
2004-05-25  4:20               ` Andrea Arcangeli
2004-05-25  4:20                 ` Andrea Arcangeli
2004-05-25  4:39                 ` Linus Torvalds
2004-05-25  4:39                   ` Linus Torvalds
2004-05-25  4:44                   ` Linus Torvalds
2004-05-25  4:44                     ` Linus Torvalds
2004-05-25  4:59                     ` Andrea Arcangeli
2004-05-25  4:59                       ` Andrea Arcangeli
2004-05-25  5:09                       ` Andrea Arcangeli
2004-05-25  5:09                         ` Andrea Arcangeli
2004-05-25  4:50                   ` Andrea Arcangeli
2004-05-25  4:50                     ` Andrea Arcangeli
2004-05-25  4:59                     ` Linus Torvalds
2004-05-25  4:59                       ` Linus Torvalds
2004-05-25  4:43                 ` David Mosberger
2004-05-25  4:43                   ` David Mosberger
2004-05-25  4:53                   ` Andrea Arcangeli
2004-05-25  4:53                     ` Andrea Arcangeli
2004-05-27 21:56                     ` David Mosberger
2004-05-27 21:56                       ` David Mosberger
2004-05-27 22:00                       ` Benjamin Herrenschmidt
2004-05-27 22:00                         ` Benjamin Herrenschmidt
2004-05-27 22:12                         ` David Mosberger
2004-05-27 22:12                           ` David Mosberger
2004-05-25 11:44               ` Matthew Wilcox
2004-05-25 11:44                 ` Matthew Wilcox
2004-05-25 14:48                 ` Linus Torvalds
2004-05-25 14:48                   ` Linus Torvalds
2004-05-25 15:35                   ` Keith M Wesolowski
2004-05-25 15:35                     ` Keith M Wesolowski
2004-05-25 16:19                     ` Linus Torvalds
2004-05-25 16:19                       ` Linus Torvalds
2004-05-25 17:25                       ` David S. Miller
2004-05-25 17:25                         ` David S. Miller
2004-05-25 17:49                         ` Linus Torvalds
2004-05-25 17:49                           ` Linus Torvalds
2004-05-25 17:54                           ` David S. Miller
2004-05-25 17:54                             ` David S. Miller
2004-05-25 18:05                             ` Linus Torvalds
2004-05-25 18:05                               ` Linus Torvalds
2004-05-25 20:30                               ` Linus Torvalds
2004-05-25 20:30                                 ` Linus Torvalds
2004-05-25 20:35                               ` David S. Miller
2004-05-25 20:35                                 ` David S. Miller
2004-05-25 20:35                                 ` David S. Miller
2004-05-25 20:49                                 ` Linus Torvalds
2004-05-25 20:49                                   ` Linus Torvalds
2004-05-25 20:57                                   ` David S. Miller
2004-05-25 20:57                                     ` David S. Miller
2004-05-26  6:20                                   ` Keith M Wesolowski
2004-05-26  6:20                                     ` Keith M Wesolowski
2004-05-25 21:40                               ` Benjamin Herrenschmidt
2004-05-25 21:40                                 ` Benjamin Herrenschmidt
2004-05-25 21:54                                 ` Linus Torvalds
2004-05-25 21:54                                   ` Linus Torvalds
2004-05-25 22:00                                   ` Linus Torvalds
2004-05-25 22:00                                     ` Linus Torvalds
2004-05-25 22:07                                     ` Benjamin Herrenschmidt
2004-05-25 22:07                                       ` Benjamin Herrenschmidt
2004-05-25 22:14                                       ` Linus Torvalds
2004-05-25 22:14                                         ` Linus Torvalds
2004-05-26  0:21                                         ` Benjamin Herrenschmidt
2004-05-26  0:21                                           ` Benjamin Herrenschmidt
2004-05-26  0:50                                           ` Linus Torvalds
2004-05-26  0:50                                             ` Linus Torvalds
2004-05-26  3:25                                             ` Benjamin Herrenschmidt
2004-05-26  3:25                                               ` Benjamin Herrenschmidt
2004-05-26  4:08                                               ` Linus Torvalds
2004-05-26  4:08                                                 ` Linus Torvalds
2004-05-26  4:12                                                 ` Benjamin Herrenschmidt
2004-05-26  4:12                                                   ` Benjamin Herrenschmidt
2004-05-26  4:18                                                   ` Benjamin Herrenschmidt
2004-05-26  4:18                                                     ` Benjamin Herrenschmidt
2004-05-26  4:50                                                     ` Linus Torvalds
2004-05-26  4:50                                                       ` Linus Torvalds
2004-05-26  4:49                                                       ` Benjamin Herrenschmidt
2004-05-26  4:49                                                         ` Benjamin Herrenschmidt
2004-05-26  4:28                                                   ` Linus Torvalds
2004-05-26  4:28                                                     ` Linus Torvalds
2004-05-26  4:46                                                 ` Benjamin Herrenschmidt
2004-05-26  4:46                                                   ` Benjamin Herrenschmidt
2004-05-26  4:54                                                   ` Linus Torvalds
2004-05-26  4:54                                                     ` Linus Torvalds
2004-05-26  4:55                                                     ` Benjamin Herrenschmidt
2004-05-26  4:55                                                       ` Benjamin Herrenschmidt
2004-05-26  5:41                                                     ` Benjamin Herrenschmidt
2004-05-26  5:41                                                       ` Benjamin Herrenschmidt
2004-05-26  5:59                                                     ` [PATCH] (signoff) " Benjamin Herrenschmidt
2004-05-26  5:59                                                       ` Benjamin Herrenschmidt
2004-05-26  6:55                                                       ` Benjamin Herrenschmidt
2004-05-26  6:55                                                         ` Benjamin Herrenschmidt
2004-05-26  7:11                                                         ` [PATCH] ppc32 implementation of ptep_set_access_flags Benjamin Herrenschmidt
2004-05-26 15:22                                                           ` Linus Torvalds
2004-05-26 18:49                                                             ` David S. Miller
2004-05-26 21:43                                                             ` Benjamin Herrenschmidt
2004-05-28  1:29                                                             ` David Mosberger
2004-05-25 22:05                                   ` [PATCH] ppc64: Fix possible race with set_pte on a present PTE Benjamin Herrenschmidt
2004-05-25 22:05                                     ` Benjamin Herrenschmidt
2004-05-25 22:09                                 ` Linus Torvalds
2004-05-25 22:09                                   ` Linus Torvalds
2004-05-25 22:19                                   ` Benjamin Herrenschmidt
2004-05-25 22:19                                     ` Benjamin Herrenschmidt
2004-05-25 22:24                                     ` Linus Torvalds
2004-05-25 22:24                                       ` Linus Torvalds
2004-05-25 21:27                   ` Andrea Arcangeli
2004-05-25 21:27                     ` Andrea Arcangeli
2004-05-25 21:43                     ` Linus Torvalds
2004-05-25 21:43                       ` Linus Torvalds
2004-05-25 21:55                       ` Andrea Arcangeli
2004-05-25 21:55                         ` Andrea Arcangeli
2004-05-25 22:01                         ` Linus Torvalds
2004-05-25 22:01                           ` Linus Torvalds
2004-05-25 22:18                           ` Ivan Kokshaysky
2004-05-25 22:18                             ` Ivan Kokshaysky
2004-05-25 22:42                             ` Andrea Arcangeli
2004-05-25 22:42                               ` Andrea Arcangeli
2004-05-26  2:26                               ` Linus Torvalds
2004-05-26  2:26                                 ` Linus Torvalds
2004-05-26  7:06                                 ` Andrea Arcangeli
2004-05-26  7:06                                   ` Andrea Arcangeli
2004-05-25 21:44                     ` Andrea Arcangeli
2004-05-25 21:44                       ` Andrea Arcangeli
  -- strict thread matches above, loose matches on Subject: below --
2004-06-01 12:04 Martin Schwidefsky
2004-06-01 12:04 ` Martin Schwidefsky
2004-06-01 12:10 Martin Schwidefsky
2004-06-01 12:10 ` Martin Schwidefsky

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=1085460025.15024.108.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=andrea@suse.de \
    --cc=bcrl@kvack.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.