mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Smarduch Mario-CMS063 <CMS063@motorola.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Multi-Threaded fork() correctness on Linux 2.4 & 2.6
Date: Mon, 19 Sep 2005 21:14:10 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0509192106460.25004@goblin.wat.veritas.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0509191216050.2553@g5.osdl.org>

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.

Hugh

  reply	other threads:[~2005-09-19 20:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-19 16:24 Smarduch Mario-CMS063
2005-09-19 18:42 ` Hugh Dickins
2005-09-19 19:24   ` Linus Torvalds
2005-09-19 20:14     ` Hugh Dickins [this message]
2005-09-19 20:39       ` Linus Torvalds
2005-09-19 21:30         ` Hugh Dickins
2005-09-19 20:21 Smarduch Mario-CMS063
2005-09-19 20:47 ` Linus Torvalds
2005-09-19 20:34 Smarduch Mario-CMS063

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=Pine.LNX.4.61.0509192106460.25004@goblin.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=CMS063@motorola.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®