public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrea Gelmini <gelma@gelma.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: VM: Fix nasty and subtle race in shared mmap'ed page writeback
Date: Thu, 04 Jan 2007 16:07:18 +1100	[thread overview]
Message-ID: <459C8B86.2050905@yahoo.com.au> (raw)
In-Reply-To: <Pine.LNX.4.64.0701032031400.3661@woody.osdl.org>

Linus Torvalds wrote:
> 
> On Thu, 4 Jan 2007, Nick Piggin wrote:
> 
>>Yhat's when the bug was introduced -- 2.6.19. 2.6.18 does not have
>>this bug, so it cannot be years old.
> 
> 
> Actually, I think 2.6.18 may have a subtle variation on it. 
> 
> In particular, I look back at the try_to_free_buffers() thing that I hated 
> so much, and it makes me wonder.. It used to do:
> 
> 	spin_lock(&mapping->private_lock);
> 	ret = drop_buffers(page, &buffers_to_free);
> 	spin_unlock(&mapping->private_lock);
> 	if (ret) {
> 		.. crappy comment ..
> 		if (test_clear_page_dirty(page))
> 			task_io_account_cancelled_write(PAGE_CACHE_SIZE);
> 	}
> 
> and I think that at least on SMP, we had a race with another CPU doing the 
> "mark page dirty if it was dirty in the PTE" at the same time. Because the 
> marking dirty would come in, find no buffers (they just got dropped), and 
> then mark the page dirty (ignoring the lack of any buffers), but then the 
> above would do the "test_clear_page_dirty()" thing on it.
> 
> Ie the race, I think, existed where that crappy comment was.
> 
> But that much older race would only trigger on SMP (or possibly UP with 
> preempt).

Oh yes the try_to_free_buffers race, I think, does exist in older kernels.
Yes according to our earlier analysis it would trigger with UP+preempt and
SMP.

But the patch that Andrea was pointing to was your last patch (The Fix),
which stopped page_mkclean caller throwing out dirty bits. You probably
didn't see that in the mail I cc'ed you on.

So yes it would be interesting to see whether fixing try_to_free_buffers
fixes Andrea's problem on older kernels.

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

  reply	other threads:[~2007-01-04  5:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200612291859.kBTIx2kq031961@hera.kernel.org>
2006-12-29 22:43 ` VM: Fix nasty and subtle race in shared mmap'ed page writeback Andrea Gelmini
2006-12-31  3:55   ` Nick Piggin
2006-12-31 13:50     ` Andrea Gelmini
2007-01-04  3:57       ` Nick Piggin
2007-01-04  4:44         ` Linus Torvalds
2007-01-04  5:07           ` Nick Piggin [this message]
2007-01-04 13:17             ` Andrea Gelmini
2007-01-04  5:41           ` Andrew Morton
2007-01-04  6:03             ` Nick Piggin
2007-01-04  6:12               ` Andrew Morton
2007-01-04  6:56                 ` David Miller
2007-01-04  7:06                   ` Andrew Morton
2007-01-04  7:16                     ` Nick Piggin
2007-01-04 13:25                     ` Hugh Dickins
2007-01-08  7:46                     ` dean gaudet
2007-01-04 13:08                 ` Andrea Gelmini
2007-01-04 13:16               ` Andrea Gelmini
2007-01-05  5:36                 ` Nick Piggin
2007-01-10 13:54                   ` Andrea Gelmini
     [not found]                     ` <1168507298.26496.18.camel@twins>
     [not found]                       ` <20070112003955.GH4553@gelma.net>
     [not found]                         ` <1169457039.2639.17.camel@taijtu>
2007-01-29 14:08                           ` Andrea Gelmini
2007-01-29 14:11                             ` Peter Zijlstra
2007-01-29 15:12                             ` Andrea Arcangeli
2007-01-05 19:12           ` Christoph Lameter
2007-01-05 19:33             ` Linus Torvalds
2007-01-05 20:02               ` Christoph Lameter
2007-01-05 21:34                 ` Linus Torvalds
2007-01-04 13:19         ` Andrea Gelmini

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=459C8B86.2050905@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=gelma@gelma.net \
    --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