Message ID | 03cda65e-3a82-6ccd-861b-67a55888eb19@kernel.dk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Nov 08, 2016 at 07:02:52PM -0700, Jens Axboe wrote: > It smells like an accounting error. One thing that I don't like with the > current scheme is the implicit knowledge that certain flags imply sync > as well. If we clear any of those flags, then we screw up accounting at > the end. > > Does this make a difference? That looks interesting. In the meantime I reproduced a similar hang, but only half-way through an xfstests run with a non-mq device. I'll see how far I can narrow it down and will give your patch a try as well. -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/08/2016 07:05 PM, Christoph Hellwig wrote: > On Tue, Nov 08, 2016 at 07:02:52PM -0700, Jens Axboe wrote: >> It smells like an accounting error. One thing that I don't like with the >> current scheme is the implicit knowledge that certain flags imply sync >> as well. If we clear any of those flags, then we screw up accounting at >> the end. >> >> Does this make a difference? > > That looks interesting. In the meantime I reproduced a similar > hang, but only half-way through an xfstests run with a non-mq device. > I'll see how far I can narrow it down and will give your patch a try as > well. It'd only trigger on non-mq, and the symptoms (and the bisect) point at this being an accounting issue. Damien/Logan, would be great you could try the debug patch I sent. My non-mq drive on my test box has write through caching, which probably explains why I haven't seen the issue.
Jens, On 11/9/16 11:02, Jens Axboe wrote: > It smells like an accounting error. One thing that I don't like with the > current scheme is the implicit knowledge that certain flags imply sync > as well. If we clear any of those flags, then we screw up accounting at > the end. > > Does this make a difference? > > > diff --git a/block/blk-flush.c b/block/blk-flush.c > index c486b7aa62ee..d70983e28115 100644 > --- a/block/blk-flush.c > +++ b/block/blk-flush.c > @@ -395,6 +395,8 @@ void blk_insert_flush(struct request *rq) > if (!(fflags & (1UL << QUEUE_FLAG_FUA))) > rq->cmd_flags &= ~REQ_FUA; > > + rq->cmd_flags |= REQ_SYNC; > + > /* > * An empty flush handed down from a stacking driver may > * translate into nothing if the underlying device does not That worked. Still seeing hangs/failures at boot with the latest for-4.10/block (networkmanager failing, no login shell, etc) but with the above patch, I get a clean boot and login with network working. Once booted, simple tests on ext4 and xfs do not show any problem, but that was only very light testing. Best regards.
On 11/08/2016 07:17 PM, Damien Le Moal wrote: > > Jens, > > On 11/9/16 11:02, Jens Axboe wrote: >> It smells like an accounting error. One thing that I don't like with the >> current scheme is the implicit knowledge that certain flags imply sync >> as well. If we clear any of those flags, then we screw up accounting at >> the end. >> >> Does this make a difference? >> >> >> diff --git a/block/blk-flush.c b/block/blk-flush.c >> index c486b7aa62ee..d70983e28115 100644 >> --- a/block/blk-flush.c >> +++ b/block/blk-flush.c >> @@ -395,6 +395,8 @@ void blk_insert_flush(struct request *rq) >> if (!(fflags & (1UL << QUEUE_FLAG_FUA))) >> rq->cmd_flags &= ~REQ_FUA; >> >> + rq->cmd_flags |= REQ_SYNC; >> + >> /* >> * An empty flush handed down from a stacking driver may >> * translate into nothing if the underlying device does not > > That worked. Still seeing hangs/failures at boot with the latest > for-4.10/block (networkmanager failing, no login shell, etc) but with > the above patch, I get a clean boot and login with network working. > Once booted, simple tests on ext4 and xfs do not show any problem, but > that was only very light testing. Great, thanks for testing! So that validates the theory. I'll get something committed with a comment. It's not the prettiest patch, but it'll do for now.
On Tue, Nov 08, 2016 at 07:38:29PM -0700, Jens Axboe wrote: > Great, thanks for testing! So that validates the theory. I'll get > something committed with a comment. It's not the prettiest patch, but > it'll do for now. Should we revert the change instead (logically, not with an actual git revert as that would break) and require and add REQ_SYNC to all users instead? -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/08/2016 07:40 PM, Christoph Hellwig wrote: > On Tue, Nov 08, 2016 at 07:38:29PM -0700, Jens Axboe wrote: >> Great, thanks for testing! So that validates the theory. I'll get >> something committed with a comment. It's not the prettiest patch, but >> it'll do for now. > > Should we revert the change instead (logically, not with an actual > git revert as that would break) and require and add REQ_SYNC to > all users instead? I just committed the work-around. But yes, let's have a logical revert and require that REQ_SYNC be set for REQ_FUA|REQ_PREFLUSH to avoid it being this fragile.
Jens, On 11/9/16 11:45, Jens Axboe wrote: > I just committed the work-around. But yes, let's have a logical revert > and require that REQ_SYNC be set for REQ_FUA|REQ_PREFLUSH to avoid it > being this fragile. Great ! Thank you.
Hey, I just tested with the latest for-4.10/block branch and it looks like it fixed our problem. Thanks! Logan On 08/11/16 07:55 PM, Damien Le Moal wrote: > > Jens, > > On 11/9/16 11:45, Jens Axboe wrote: >> I just committed the work-around. But yes, let's have a logical revert >> and require that REQ_SYNC be set for REQ_FUA|REQ_PREFLUSH to avoid it >> being this fragile. > > Great ! Thank you. > -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/block/blk-flush.c b/block/blk-flush.c index c486b7aa62ee..d70983e28115 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -395,6 +395,8 @@ void blk_insert_flush(struct request *rq) if (!(fflags & (1UL << QUEUE_FLAG_FUA))) rq->cmd_flags &= ~REQ_FUA; + rq->cmd_flags |= REQ_SYNC; + /* * An empty flush handed down from a stacking driver may * translate into nothing if the underlying device does not