From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@lst.de>,
Chandan Rajendra <chandan@linux.ibm.com>,
linux-xfs@vger.kernel.org
Subject: Re: BUG: iomap_dio_rw() accesses freed memory
Date: Tue, 15 Jan 2019 15:24:30 -0800 [thread overview]
Message-ID: <20190115232430.GG12689@magnolia> (raw)
In-Reply-To: <20190115231851.GN4205@dastard>
On Wed, Jan 16, 2019 at 10:18:51AM +1100, Dave Chinner wrote:
> On Tue, Jan 15, 2019 at 10:09:03PM +0100, Christoph Hellwig wrote:
> > On Wed, Jan 16, 2019 at 07:51:41AM +1100, Dave Chinner wrote:
> > > Atomic operations don't imply a memory barrier for dependent data,
> > > right?
> >
> > Documentation/atomic_t.txt says:
> >
> > -------------------------- snip --------------------------
> > The rule of thumb:
> >
> > - non-RMW operations are unordered;
> >
> > - RMW operations that have no return value are unordered;
> >
> > - RMW operations that have a return value are fully ordered;
> >
> > [...]
> >
> > Fully ordered primitives are ordered against everything prior and everything
> > subsequent. Therefore a fully ordered primitive is like having an smp_mb()
> > before and an smp_mb() after the primitive.
>
> I guess I haven't looked at the documentation for a while. Or the
> implementation for that matter.
>
> /me goes off and looks.
>
> Oh, they are now implemented with built in, explicit
> smp_mb__before_atomic() and smp_mb__after_atomic() barriers. Ok,
> so the necessary barriers are there, my brain was telling me they
> still needed to be added manually and needed updating.....
FWIW this fixes the machine that was cranking out generic/323 hangs,
having run it repeatedly in a loop for the ~4 hours in between falling
down the stairs this morning and finally getting back from all the
errands I had to do today.
Ready for this crap year to be over with, which means this ought to have
someone other than me look over it:
Tested-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com
next prev parent reply other threads:[~2019-01-15 23:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 10:17 BUG: iomap_dio_rw() accesses freed memory Chandan Rajendra
2019-01-10 14:25 ` Christoph Hellwig
2019-01-10 16:49 ` Chandan Rajendra
2019-01-10 17:09 ` Darrick J. Wong
2019-01-15 18:27 ` Christoph Hellwig
2019-01-15 20:51 ` Dave Chinner
2019-01-15 21:09 ` Christoph Hellwig
2019-01-15 23:18 ` Dave Chinner
2019-01-15 23:24 ` Darrick J. Wong [this message]
2019-01-16 5:59 ` Chandan Rajendra
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=20190115232430.GG12689@magnolia \
--to=darrick.wong@oracle.com \
--cc=chandan@linux.ibm.com \
--cc=david@fromorbit.com \
--cc=hch@lst.de \
--cc=linux-xfs@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;
as well as URLs for NNTP newsgroup(s).