lkml.org 
[lkml]   [2005]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Multi-Threaded fork() correctness on Linux 2.4 & 2.6


On Mon, 19 Sep 2005, Hugh Dickins wrote:
>
> 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.

Hmm. But we do hold the mmap_sem for writing, and we flush before we
release it, so it should still be ok. The page fault case needs to get it
for reading anyway.

Yeah, the page_table_lock might make more sense, but I think the mmap_sem
thing works equally well.

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

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.081 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site