All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kent Overstreet <kmo@daterainc.com>
To: Hugh Dickins <hughd@google.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Jens Axboe <axboe@kernel.dk>, Shaohua Li <shli@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: next bio iters break discard?
Date: Thu, 16 Jan 2014 17:06:31 -0800	[thread overview]
Message-ID: <20140117010631.GR9037@kmo> (raw)
In-Reply-To: <alpine.LSU.2.11.1401161129380.1321@eggly.anvils>

On Thu, Jan 16, 2014 at 12:21:10PM -0800, Hugh Dickins wrote:
> On Tue, 14 Jan 2014, Kent Overstreet wrote:
> > 
> > Does the below patch look like what we want? I'm assuming that if
> 
> You don't fill me with confidence ;)
> 
> > multiple WRITE_SAME bios are merged, since they're all writing the same
> > data we can consider the entire request to be a single segment.
> > 
> > commit 1755e7ffc5745591d37b8956ce2512f4052a104a
> > Author: Kent Overstreet <kmo@daterainc.com>
> > Date:   Tue Jan 14 14:22:01 2014 -0800
> > 
> >     block: Explicitly handle discard/write same when counting segments
> > 
> > diff --git a/block/blk-merge.c b/block/blk-merge.c
> > index 8f8adaa..7d977f8 100644
> > --- a/block/blk-merge.c
> > +++ b/block/blk-merge.c
> > @@ -21,6 +21,12 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
> >  	if (!bio)
> >  		return 0;
> >  
> > +	if (bio->bi_rw & REQ_DISCARD)
> > +		return 0;
> > +
> > +	if (bio->bi_rw & REQ_WRITE_SAME)
> > +		return 1;
> > +
> >  	fbio = bio;
> >  	cluster = blk_queue_cluster(q);
> >  	seg_size = 0;
> 
> For me this just shifts the crash,
> from __blk_recalc_rq_segments() to blk_rq_map_sg():
> 
> blk_rq_map_sg
> scsi_init_sgtable
> scsi_init_io
> scsi_setup_blk_pc_cmnd
> sd_prep_fn
> blk_peek_request
> scsi_request_fn
> __blk_run_queue
> blk_run_queue
> scsi_run_queue
> scsi_next_command
> scsi_io_completion
> scsi_finish_command
> scsi_softirq_done
> blk_done_softirq
> __do_softirq
> irq_exit
> do_IRQ
> common_interrupt
> <EOI>
> cpuidle_idle_call
> arch_cpu_idle
> cpu_startup_entry
> start_secondary
> 
> It's GPF'ing on struct scatter_list *sg 0x800000001473e064 in
> 
> static inline void sg_assign_page(struct scatterlist *sg, struct page *page)
> {
> 	unsigned long page_link = sg->page_link & 0x3;
> 
> It appears to be in the static inline __blk_segment_map_sg(),
> and that GPF'ing address is what it just got from sg_next().
> 
> Sorry, this isn't the kind of dump you'll be used to, but it's the
> best I can do at the moment, and I've just had to reboot the machine.
> 
> O, tried again and it hit the BUG_ON(count > sdb->table.nents)
> on line 1048 of drivers/scsi/scsi_lib.c:
> 
> scsi_init_sgtable
> <IRQ> scsi_init_io
> scsi_setup_blk_pc_cmnd
> sd_setup_discard_cmnd
> sd_prep_fn
> blk_peek_request
> etc. as before
> 
> I'll have to leave the machine shortly - I'm rather hoping
> you can do your own discard testing to see such crashes.

My simple hdparm/scsi_debug based test isn't hitting it - any suggestions on how
to reproduce it?

  reply	other threads:[~2014-01-17  1:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13  3:52 next bio iters break discard? Hugh Dickins
2014-01-14  2:33 ` Kent Overstreet
2014-01-14  4:06   ` Martin K. Petersen
2014-01-14  4:48     ` Kent Overstreet
2014-01-14 20:17       ` Martin K. Petersen
2014-01-14 22:24         ` Kent Overstreet
2014-01-16  1:39           ` Martin K. Petersen
2014-01-16 20:21           ` Hugh Dickins
2014-01-17  1:06             ` Kent Overstreet [this message]
2014-01-17  1:21             ` Kent Overstreet
2014-01-31 17:17               ` Hugh Dickins
2014-01-31 21:58                 ` Jens Axboe
2014-02-04 10:17                 ` [PATCH] block: Explicitly handle discard/write same segments Kent Overstreet
2014-02-04 12:25                   ` Hugh Dickins
2014-02-04 12:35                     ` Kent Overstreet

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=20140117010631.GR9037@kmo \
    --to=kmo@daterainc.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=shli@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.