linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 2.4.0-test10-pre6  TLB flush race in establish_pte
@ 2000-10-30 21:31 Steve Pratt/Austin/IBM
  2000-10-30 21:39 ` Kanoj Sarcar
  2000-10-31  0:30 ` Andrea Arcangeli
  0 siblings, 2 replies; 7+ messages in thread
From: Steve Pratt/Austin/IBM @ 2000-10-30 21:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds, linux-mm

Back in April there were discussions about the race in establish_pte with
the flush_tlb before the set_pte.  Many options were discussed, but due in
part to a concern about S/390 having introduced the code, no patch ever
appeared.  I talked with Martin Schwidefsky of the S/390 Linux development
team and he said that:

>the establish_pte was in fact introduced because of Linux/390. We wanted
to use the special S/390 instruction ipte (invalidate page >table entry).
In the meantime we found out that we need a lot more changes to be able to
use this instruction, so we disabled it again. >Until we have a proper
patch you should revoke the establish_pte change if you found it to be
faulty. I too think there is a race >condition.

So while there may be a more elegant solution down the road, I would like
to see the simple fix put back into 2.4.  Here is the patch to essential
put the code back to the way it was before the S/390 merge.  Patch is
against 2.4.0-test10pre6.

--- linux/mm/memory.c    Fri Oct 27 15:26:14 2000
+++ linux-2.4.0-test10patch/mm/memory.c  Fri Oct 27 15:45:54 2000
@@ -781,8 +781,8 @@
  */
 static inline void establish_pte(struct vm_area_struct * vma, unsigned long address, pte_t *page_table, pte_t entry)
 {
-    flush_tlb_page(vma, address);
     set_pte(page_table, entry);
+    flush_tlb_page(vma, address);
     update_mmu_cache(vma, address, entry);
 }




Linux Technology Center - IBM Corporation
11400 Burnet Road
Austin, TX  78758
(512) 838-9763  EMAIL: SLPratt@US.IBM.COM

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] 2.4.0-test10-pre6  TLB flush race in establish_pte
  2000-10-30 21:31 [PATCH] 2.4.0-test10-pre6 TLB flush race in establish_pte Steve Pratt/Austin/IBM
@ 2000-10-30 21:39 ` Kanoj Sarcar
  2000-10-31  0:30 ` Andrea Arcangeli
  1 sibling, 0 replies; 7+ messages in thread
From: Kanoj Sarcar @ 2000-10-30 21:39 UTC (permalink / raw)
  To: Steve Pratt/Austin/IBM; +Cc: linux-kernel, torvalds, linux-mm

> 
> So while there may be a more elegant solution down the road, I would like
> to see the simple fix put back into 2.4.  Here is the patch to essential
> put the code back to the way it was before the S/390 merge.  Patch is
> against 2.4.0-test10pre6.
> 
> --- linux/mm/memory.c    Fri Oct 27 15:26:14 2000
> +++ linux-2.4.0-test10patch/mm/memory.c  Fri Oct 27 15:45:54 2000
> @@ -781,8 +781,8 @@
>   */
>  static inline void establish_pte(struct vm_area_struct * vma, unsigned long address, pte_t *page_table, pte_t entry)
>  {
> -    flush_tlb_page(vma, address);
>      set_pte(page_table, entry);
> +    flush_tlb_page(vma, address);
>      update_mmu_cache(vma, address, entry);
>  }
>

Great, lets do it. Definitely solves one race. 

Kanoj 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] 2.4.0-test10-pre6  TLB flush race in establish_pte
  2000-10-30 21:31 [PATCH] 2.4.0-test10-pre6 TLB flush race in establish_pte Steve Pratt/Austin/IBM
  2000-10-30 21:39 ` Kanoj Sarcar
@ 2000-10-31  0:30 ` Andrea Arcangeli
  2000-10-31 16:23   ` Steven Pratt
  1 sibling, 1 reply; 7+ messages in thread
From: Andrea Arcangeli @ 2000-10-31  0:30 UTC (permalink / raw)
  To: Steve Pratt/Austin/IBM; +Cc: linux-kernel, torvalds, linux-mm

On Mon, Oct 30, 2000 at 03:31:22PM -0600, Steve Pratt/Austin/IBM wrote:
> [..] no patch ever
> appeared. [..]

You didn't followed l-k closely enough as the strict fix was submitted two
times but it got not merged. (maybe because it had an #ifdef __s390__ that was
_necessary_ by that time?)

You can find the old and now useless patch here:

	ftp://ftp.us.kernel.org/pub/linux/kernel/people/andrea/patches/v2.4/2.4.0-test5/tlb-flush-smp-race-1

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] 2.4.0-test10-pre6  TLB flush race in establish_pte
  2000-10-31  0:30 ` Andrea Arcangeli
@ 2000-10-31 16:23   ` Steven Pratt
  2000-10-31 16:44     ` Andrea Arcangeli
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Pratt @ 2000-10-31 16:23 UTC (permalink / raw)
  To: linux-kernel, linux-mm; +Cc: Andrea Arcangeli

Andrea Arcangeli wrote:
> 
> On Mon, Oct 30, 2000 at 03:31:22PM -0600, Steve Pratt/Austin/IBM wrote:
> > [..] no patch ever
> > appeared. [..]
> 
> You didn't followed l-k closely enough as the strict fix was submitted two
> times but it got not merged. (maybe because it had an #ifdef __s390__ that was
> _necessary_ by that time?)
> 
> You can find the old and now useless patch here:
> 
>ftp://ftp.us.kernel.org/pub/linux/kernel/people/andrea/patches/v2.4/2.4.0-test5/tlb-flush-smp-race-1


I stand corrected, I missed this is my searching.  Hopefully this will
get in this time.

Steve
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] 2.4.0-test10-pre6  TLB flush race in establish_pte
  2000-10-31 16:23   ` Steven Pratt
@ 2000-10-31 16:44     ` Andrea Arcangeli
  0 siblings, 0 replies; 7+ messages in thread
From: Andrea Arcangeli @ 2000-10-31 16:44 UTC (permalink / raw)
  To: Steven Pratt; +Cc: linux-kernel, linux-mm

On Tue, Oct 31, 2000 at 10:23:12AM -0600, Steven Pratt wrote:
> I stand corrected, I missed this is my searching. [..]

Never mind, it's nearly impossible to track every single message to l-k.
It was only informational.

> [..] Hopefully this will
> get in this time.

I hope too indeed :).

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] 2.4.0-test10-pre6 TLB flush race in establish_pte
  2000-10-31 18:42 Ulrich.Weigand
@ 2000-10-31 19:13 ` Andrea Arcangeli
  0 siblings, 0 replies; 7+ messages in thread
From: Andrea Arcangeli @ 2000-10-31 19:13 UTC (permalink / raw)
  To: Ulrich.Weigand; +Cc: slpratt, linux-kernel, torvalds, linux-mm

On Tue, Oct 31, 2000 at 07:42:21PM +0100, Ulrich.Weigand@de.ibm.com wrote:
> IMO you should apply Steve's patch (without any #ifdef __s390__) now.

Agreed.

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] 2.4.0-test10-pre6 TLB flush race in establish_pte
@ 2000-10-31 18:42 Ulrich.Weigand
  2000-10-31 19:13 ` Andrea Arcangeli
  0 siblings, 1 reply; 7+ messages in thread
From: Ulrich.Weigand @ 2000-10-31 18:42 UTC (permalink / raw)
  To: Andrea Arcangeli; +Cc: slpratt, linux-kernel, torvalds, linux-mm




Andrea Arcangeli wrote:

>>On Mon, Oct 30, 2000 at 03:31:22PM -0600, Steve Pratt/Austin/IBM wrote:
>> [..] no patch ever
>> appeared. [..]
>
>You didn't followed l-k closely enough as the strict fix was submitted two
>times but it got not merged. (maybe because it had an #ifdef __s390__ that
was
>_necessary_ by that time?)


Unfortunately, the current code is racey even on the S/390.
We originally wanted to use the IPTE instruction to flush
a particular TLB entry, and this requires that the old PTE
value is still present at the time IPTE is performed.

Thus we wanted to place IPTE inside flush_tlb_page, and have
flush_tlb_page called before the new PTE is written.  However,
even with the current establish_pte routine this doesn't work,
as flush_tlb_page is called from several other places *after*
the PTE has been changed, so we still cannot actually use IPTE.

So, what we do now is simply flush the complete TLB in
flush_tlb_page, and don't use IPTE at all.  This is obviously
not ideal, but at least correct.  Except, that is, for the
race condition in establish_pte that we now share with the
other architectures :-/

IMO you should apply Steve's patch (without any #ifdef __s390__) now.
However, we'd like to look further for a more general solution
that would allow us to make use of IPTE again in the future.
This would possibly involve something like making establish_pte
architecture-specific.




Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-10-31 19:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-30 21:31 [PATCH] 2.4.0-test10-pre6 TLB flush race in establish_pte Steve Pratt/Austin/IBM
2000-10-30 21:39 ` Kanoj Sarcar
2000-10-31  0:30 ` Andrea Arcangeli
2000-10-31 16:23   ` Steven Pratt
2000-10-31 16:44     ` Andrea Arcangeli
2000-10-31 18:42 Ulrich.Weigand
2000-10-31 19:13 ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).