[lkml]   [2005]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: Multi-Threaded fork() correctness on Linux 2.4 & 2.6
mmap_sem is also acquired in 2.4 properly. 
It seemed a little bit too obvious.
Thanks for your help!

- mario

-----Original Message-----
From: Hugh Dickins []
Sent: Monday, September 19, 2005 3:14 PM
To: Linus Torvalds
Cc: Smarduch Mario-CMS063;
Subject: Re: Multi-Threaded fork() correctness on Linux 2.4 & 2.6

On Mon, 19 Sep 2005, Linus Torvalds wrote:
> We hold the page_table_lock when doing the fork(), so T2 can't
> actually be copying the page until we've done the TLB flush, no? And
> once the TLB flush is done, all the writes by T3 should be in the
> page, so we copy the right thing at that point, and there is no consistency problems?

I was totally overlooking the page_table_lock during the fork.

But no matter, it's not good enough: src_mm->page_table_lock is acquired and dropped at the inner level, in copy_pte_range (looking at latest 2.6):
it cannot be held across allocating page tables for dst_mm.

So each time T1 drops it, there's a window for the T2 vs. T3 problem.
Yet we don't much want to flush TLB each time we leave copy_pte_range.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-09-19 22:37    [W:1.963 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site