All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Litke <agl@us.ibm.com>
To: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
Cc: William Lee Irwin III <wli@holomorphy.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: RE: [PATCH 2/2] hugetlb: synchronize alloc with page cache insert
Date: Thu, 12 Jan 2006 13:48:59 -0600	[thread overview]
Message-ID: <1137095339.17956.22.camel@localhost.localdomain> (raw)
In-Reply-To: <200601121907.k0CJ7og16283@unix-os.sc.intel.com>

On Thu, 2006-01-12 at 11:07 -0800, Chen, Kenneth W wrote:
> Sorry, I don't think patch 1 by itself is functionally correct.  It opens
> a can of worms with race window all over the place.  It does more damage
> than what it is trying to solve.  Here is one case:
> 
> 1 thread fault on hugetlb page, allocate a non-zero page, insert into the
> page cache, then proceed to zero it.  While in the middle of the zeroing,
> 2nd thread comes along fault on the same hugetlb page.  It find it in the
> page cache, went ahead install a pte and return to the user.  User code
> modify some parts of the hugetlb page while the 1st thread is still
> zeroing.  A potential silent data corruption.

I don't think the above case is possible because of find_lock_page().
The second thread would wait on the page to be unlocked by the thread
zeroing it before it could proceed.

-- 
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center


WARNING: multiple messages have this Message-ID (diff)
From: Adam Litke <agl@us.ibm.com>
To: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
Cc: William Lee Irwin III <wli@holomorphy.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: RE: [PATCH 2/2] hugetlb: synchronize alloc with page cache insert
Date: Thu, 12 Jan 2006 13:48:59 -0600	[thread overview]
Message-ID: <1137095339.17956.22.camel@localhost.localdomain> (raw)
In-Reply-To: <200601121907.k0CJ7og16283@unix-os.sc.intel.com>

On Thu, 2006-01-12 at 11:07 -0800, Chen, Kenneth W wrote:
> Sorry, I don't think patch 1 by itself is functionally correct.  It opens
> a can of worms with race window all over the place.  It does more damage
> than what it is trying to solve.  Here is one case:
> 
> 1 thread fault on hugetlb page, allocate a non-zero page, insert into the
> page cache, then proceed to zero it.  While in the middle of the zeroing,
> 2nd thread comes along fault on the same hugetlb page.  It find it in the
> page cache, went ahead install a pte and return to the user.  User code
> modify some parts of the hugetlb page while the 1st thread is still
> zeroing.  A potential silent data corruption.

I don't think the above case is possible because of find_lock_page().
The second thread would wait on the page to be unlocked by the thread
zeroing it before it could proceed.

-- 
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center

--
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:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-01-12 19:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-10 19:22 Hugetlb: Shared memory race Adam Litke
2006-01-10 19:22 ` Adam Litke
2006-01-10 19:44 ` William Lee Irwin III
2006-01-10 19:44   ` William Lee Irwin III
2006-01-11 22:02 ` [PATCH 1/2] hugetlb: Delay page zeroing for faulted pages Adam Litke
2006-01-11 22:02   ` Adam Litke
2006-01-11 22:24   ` [PATCH 2/2] hugetlb: synchronize alloc with page cache insert Adam Litke
2006-01-11 22:24     ` Adam Litke
2006-01-11 22:52     ` William Lee Irwin III
2006-01-11 22:52       ` William Lee Irwin III
2006-01-11 23:03       ` Adam Litke
2006-01-11 23:03         ` Adam Litke
2006-01-11 23:24         ` William Lee Irwin III
2006-01-11 23:24           ` William Lee Irwin III
2006-01-11 23:46         ` Chen, Kenneth W
2006-01-11 23:46           ` Chen, Kenneth W
2006-01-12  0:40     ` Chen, Kenneth W
2006-01-12  0:40       ` Chen, Kenneth W
2006-01-12  1:05       ` William Lee Irwin III
2006-01-12  1:05         ` William Lee Irwin III
2006-01-12 17:26         ` Adam Litke
2006-01-12 17:26           ` Adam Litke
2006-01-12 19:07           ` Chen, Kenneth W
2006-01-12 19:07             ` Chen, Kenneth W
2006-01-12 19:48             ` Adam Litke [this message]
2006-01-12 19:48               ` Adam Litke
2006-01-12 20:06               ` Chen, Kenneth W
2006-01-12 20:06                 ` Chen, Kenneth W
2006-01-11 22:42   ` [PATCH 1/2] hugetlb: Delay page zeroing for faulted pages William Lee Irwin III
2006-01-11 22:42     ` William Lee Irwin III

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=1137095339.17956.22.camel@localhost.localdomain \
    --to=agl@us.ibm.com \
    --cc=kenneth.w.chen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=wli@holomorphy.com \
    /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.