mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
Cc: Christoph Hellwig <hch@infradead.org>,
	akpm@linux-foundation.org, jack@ucw.cz,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [patch 12/17] vfs: pagecache usage optimization for pagesize!=blocksize
Date: Tue, 12 Aug 2008 16:07:55 +1000	[thread overview]
Message-ID: <200808121607.55673.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <6.0.0.20.2.20080812113004.03c68f48@172.19.0.2>

On Tuesday 12 August 2008 13:57, Hisashi Hifumi wrote:
> Hi Nick.
>
> >This patch unfortunately appears like it may introduce an
> >uninitialized memory leak due to a data race between one
> >thread initializing a buffer then marking it uptodate, and
> >the other testing buffer uptodate then reading from the
> >buffer (buffer, read as: page memory covered by buffer head).
> >
> >For reference, this is basically the same class of data race
> >that I fixed 0ed361dec36945f3116ee1338638ada9a8920905
>
> I think the same issue that your patch 0ed361dec36945f3116ee
> 1338638ada9a8920905 "fix PageUptodate data race" pointed out
> is there around buffer_head without my patch "vfs: pagecache usage
> optimization for pagesize!=blocksize".
> Because set_buffer_uptodate or buffer_uptodate are used without
> distinct locking facility (lock_buffer, or lock_page) in many places,
> so it would be needed to deal with memory ordering issue.

Right.


> Do you add wmb/rmb to BUFFER_FNS macros?

That would fix it, yes. But now the patch is no longer a single
predictable branch but will make the code measurably larger and
slower. On some architectures these can cost hundreds or thousands
of cycles.

So IMO it requires either more thought for a better fix, or we
now need more justification that we want to do this rather than
a artificial microbenchmark numbers.

      reply	other threads:[~2008-08-12  6:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200807282246.m6SMkaHT032267@imap1.linux-foundation.org>
     [not found] ` <20080728230031.GA22218@infradead.org>
     [not found]   ` <200808041719.43293.nickpiggin@yahoo.com.au>
2008-08-06  5:36     ` Nick Piggin
2008-08-12  3:57     ` Hisashi Hifumi
2008-08-12  6:07       ` Nick Piggin [this message]

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=200808121607.55673.nickpiggin@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=hifumi.hisashi@oss.ntt.co.jp \
    --cc=jack@ucw.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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®