From: Al Viro <viro@ZenIV.linux.org.uk>
To: Theodore Tso <tytso@mit.edu>,
Stephen Rothwell <sfr@canb.auug.org.au>,
LKML <linux-kernel@vger.kernel.org>,
linux-next@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: linux-next: next-20090609 hangs in early user mode
Date: Wed, 10 Jun 2009 16:08:39 +0100 [thread overview]
Message-ID: <20090610150839.GS8633@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20090610131909.GB6647@mit.edu>
On Wed, Jun 10, 2009 at 09:19:09AM -0400, Theodore Tso wrote:
> On Wed, Jun 10, 2009 at 02:00:54PM +0100, Al Viro wrote:
> >
> > Yes, it's obviously bogus. Dropped from the tree; I don't think it's
> > really salvagable - even merging into one unsigned long will not be
> > enough, since we will end up with different locking for different bits.
>
> Oops, sorry, I didn't realize we were using bitops for i_state. As
> far as I can tell we're not using the bitops functions for i_flags,
> though. Is that right? So we can convert i_flags to be a unsigned
> short, but we can't do anything with i_state.
We can, but... it's again a matter of combining things with different
locking. i_flags is protected by i_mutex, so if you put another
unsigned short next to it, you'd better make sure that i_mutex
is necessary and sufficient for modifying it.
Depending on the target, gcc may turn 16bit read-modify-store into 32bit one,
so if you have two 16bit fields next to each other, you can run into
CPU1: CPU2:
r1 = *(u32 *)p; r2 = *(u32 *)p;
r1 |= 1; r2 |= 1 << 16;
*(u32 *)p = r1; *(u32 *)p = r2;
with obvious results. So we need the same locking for both such fields...
next prev parent reply other threads:[~2009-06-10 15:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-10 8:00 linux-next: next-20090609 hangs in early user mode Stephen Rothwell
2009-06-10 8:31 ` Christoph Hellwig
2009-06-10 8:44 ` Stephen Rothwell
2009-06-10 8:46 ` Stephen Rothwell
2009-06-10 13:00 ` Al Viro
2009-06-10 13:07 ` Stephen Rothwell
2009-06-10 13:19 ` Theodore Tso
2009-06-10 15:08 ` Al Viro [this message]
2009-06-10 16:09 ` Theodore Tso
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=20090610150839.GS8633@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).