public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: "홍신 shin hong" <hongshin@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: BUG? a possible bug for the absence of memory barrier
Date: Thu, 10 Sep 2009 16:38:53 -0400	[thread overview]
Message-ID: <20090910203853.GB18366@think> (raw)
In-Reply-To: <2014bcab0909090815jf4929efib21cbf52b963e330@mail.gmail.com>

On Thu, Sep 10, 2009 at 12:15:24AM +0900, =ED=99=8D=EC=8B=A0 shin hong =
wrote:
> Hello. I am reporting possible bugs caused
> by the absence of memory barriers.
>=20
> Please examine this issue and let me know your opinion.
>=20
> In add_async_extent(), an async_extent object is allocated and initia=
lized
> and then links to &cow->extents.

Memory barriers have an impact when there are multiple CPUs accessing
the same data structures at the same time.  In the case of
add_async_extent only one worker thread is working on that list at a
time.

>=20
> However, since there is no memory barrier
> between the initialization and the linking to the list,
> these two operations are executed opposite order.
> And the re-ordering might result race condition.
>=20
> The similar issue is also in join_transaction().

In join_transaction, that list is protected by the trans_mutex.

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2009-09-10 20:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-09 15:15 BUG? a possible bug for the absence of memory barrier 홍신 shin hong
2009-09-10 20:38 ` Chris Mason [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=20090910203853.GB18366@think \
    --to=chris.mason@oracle.com \
    --cc=hongshin@gmail.com \
    --cc=linux-btrfs@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