On Fri, 2017-08-18 at 16:01 -0400, Waiman Long wrote:
> [ ... ]
> Instead of using bd_mutex, a new global blktrace mutex is now used
> to protect against concurrent access, creation and destruction of the
> blk_trace structure that is used only in the blktrace.c file. As
> blktrace files will not
On Fri, 2017-08-18 at 13:54 -0400, Waiman Long wrote:
> Instead, a global blktrace
> mutex will be used to serialize the read/write of the blktrace sysfs
> attributes.
Hello Waiman,
Using a mutex to serialize code is wrong. What is needed is exact
documentation of what data structures and/or
On Fri, 2017-08-18 at 08:47 -0700, Bart Van Assche wrote:
> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index e53b6129ca5a..9fac2915d897 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -73,6 +73,8 @@ static const char *const blk_
Avoid that smatch reports the following warning when building with
C=2 CHECK="smatch -p=kernel":
drivers/block/xen-blkback/blkback.c:710 xen_blkbk_unmap_prepare() warn:
inconsistent indenting
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Konrad Rzeszute
It is easy to add a flag to one of the block layer headers and to
forget to update blk-mq-debugfs.c. E.g. QUEUE_FLAG_SCSI_PASSTHROUGH,
QUEUE_FLAG_QUIESCED and REQ_NOWAIT are missing from blk-mq-debugfs.c.
Hence generate the symbol-to-text translation tables.
Signed-off-by: Bart Van Assche
and to analyze.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Sagi Grimberg <s...@grimberg.me>
Cc: James Smart <james.sm...@broadcom.com>
Cc: Johannes Thumshirn <jthumsh...@suse.de>
---
block/blk-mq-tag.c | 9 +++
This was detected by sparse.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Cc: Omar Sandoval <osan...@fb.com>
---
block/blk-mq-debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index
It is nontrivial to derive from the blk-mq source code when
blk_mq_tags.active_queues is decremented. Hence add a comment that
explains this.
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.de>
Cc:
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: David S. Miller <da...@davemloft.net>
Cc: linux-...@vger.kernel.org
---
drivers/ide/ide-floppy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ide/
mprove documentation of the locking requirements of
the modified functions.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Cc: Tejun Heo <t...@kernel.org>
Cc: Jan Kara <j...@suse.cz>
Cc: Dan Williams <dan.j.willi...@intel.com>
Cc: Christoph Hellwig <h...@lst.de>
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
Cc: Roger Pau Monn303251 <roger@citrix.com>
Cc: xen-de...@lists.xenproject.org
---
drivers/block/xen-blkback/blkback.c | 1 +
drivers/block/xen-blkback/xenbus.c | 3 ++
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Michael S. Tsirkin <m...@redhat.com>
Cc: Jason Wang <jasow...@redhat.com>
Cc: virtualizat...@lists.linux-foundation.org
---
drivers/block/virtio_blk.c | 2 +-
1 file ch
This function is only used inside the block layer core. Hence
unexport it.
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.de>
Cc: Johannes Thumshirn <jthumsh...@suse.de>
---
block/blk-tag.c
On Thu, 2017-08-17 at 16:30 -0400, Steven Rostedt wrote:
> On Thu, 17 Aug 2017 12:24:39 -0400
> Waiman Long wrote:
>
> > On 08/17/2017 09:34 AM, Steven Rostedt wrote:
> > > On Wed, 16 Aug 2017 16:40:40 -0400
> > > Waiman Long wrote:
> > >
> > > > The
Hello Jens,
The twelve patches in this series are patches I came up with while working
on block drivers and SCSI drivers. Please consider these for inclusion in
kernel v4.14.
Thanks,
Bart.
Bart Van Assche (12):
block: Fix two comments that refer to .queue_rq() return values
block: Unexport
drained/blocked by stopping queue")
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Ming Lei <ming@redhat.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.de>
Cc: Johannes Thumshirn <jthumsh...@suse.de>
---
block/blk-mq.c | 4
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
Cc: Roger Pau Monn303251 <roger@citrix.com>
Cc: xen-de...@lists.xenproject.org
---
drivers/block/xen-blkfront.c | 2 +-
1 file changed, 1 insertion(+), 1 delet
The symbolic constants QUEUE_FLAG_SCSI_PASSTHROUGH, QUEUE_FLAG_QUIESCED
and REQ_NOWAIT are missing from blk-mq-debugfs.c. Add these to
blk-mq-debugfs.c such that these appear as names in debugfs instead of
as numbers.
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Omar Sandoval
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> +static inline bool blk_mq_hctx_is_dispatch_busy(struct blk_mq_hw_ctx *hctx)
> +{
> + return test_bit(BLK_MQ_S_DISPATCH_BUSY, >state);
> +}
> +
> +static inline void blk_mq_hctx_set_dispatch_busy(struct blk_mq_hw_ctx *hctx)
> +{
> +
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> +static inline void blk_mq_do_dispatch_ctx(struct request_queue *q,
> + struct blk_mq_hw_ctx *hctx)
> +{
> + LIST_HEAD(rq_list);
> + struct blk_mq_ctx *ctx = NULL;
> +
> + do {
> +
On Tue, 2017-08-22 at 19:47 +0900, Sergey Senozhatsky wrote:
> ==
> WARNING: possible circular locking dependency detected
> 4.13.0-rc6-next-20170822-dbg-00020-g39758ed8aae0-dirty #1746 Not tainted
>
]
irq_forced_thread_fn+0x2a/0x70
irq_thread+0x144/0x1a0
kthread+0x125/0x140
ret_from_fork+0x2a/0x40
Fixes: commit e41d58185f14 ("fault-inject: support systematic fault injection")
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Jens Axboe <ax...@kernel.dk>
Cc: Dmitry Vyukov &
Hello Andrew,
A recent change in the fault injection code introduced an undesired change
in the behavior of the I/O timeout failure injection code. This series
restores the original behavior. Please consider these patches for kernel
v4.14.
Thanks,
Bart.
Bart Van Assche (2):
fault-inject
fault-inject: support systematic fault
injection")
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Dmitry Vyukov <dvyu...@google.com>
Cc: Akinobu Mita <akinobu.m...@gmail.com>
Cc: Michal Hocko <mho...@kernel.org>
Cc: Andrew Morton <a...@linux-foundation.o
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> easy to cause queue busy becasue of the small
^^^
because?
> -static void blk_mq_do_dispatch(struct request_queue *q,
> -struct elevator_queue *e,
> -
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> -static inline void sbitmap_for_each_set(struct sbitmap *sb, sb_for_each_fn
> fn,
> - void *data)
> +static inline void __sbitmap_for_each_set(struct sbitmap *sb,
> +
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> /**
> * sbitmap_for_each_set() - Iterate over each set bit in a sbitmap.
> + * @off: Offset to iterate from
> * @sb: Bitmap to iterate over.
> * @fn: Callback. Should return true to continue or false to break early.
> * @data: Pointer
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> So that it becomes easy to support to dispatch from
> sw queue in the following patch.
Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> More importantly, for some SCSI devices, driver
> tags are host wide, and the number is quite big,
> but each lun has very limited queue depth.
This may be the case but is not always the case. Another important use-case
is one LUN per host and
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> The following patch will propose some hints to figure out
> default queue depth for scheduler queue, so introduce helper
> of blk_mq_sched_queue_depth() for this purpose.
Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> + /*
> + * Wherever DISPATCH_BUSY is set, blk_mq_run_hw_queue()
> + * will be run to try to make progress, so it is always
> + * safe to check the state here.
> + */
> + if (test_bit(BLK_MQ_S_DISPATCH_BUSY, >state))
>
t; This patch trys to use q->queue_depth as hint for computing
tries?
> q->nr_requests, which should be more effective than
> current way.
Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> This patch introduces per-request_queue dispatch
> list for this purpose, and only when all requests
> in this list are dispatched out successfully, we
> can restart to dequeue request from sw/scheduler
> queue and dispath it to lld.
Wasn't one
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> + /*
> + * if there is q->queue_depth, all hw queues share
> + * this queue depth limit
> + */
> + if (q->queue_depth) {
> + queue_for_each_hw_ctx(q, hctx, i)
> + hctx->flags |=
with CONFIG_FAIL_PAGE_ALLOC, CONFIG_FAIL_IO_TIMEOUT and/or
CONFIG_FAIL_FUTEX enabled.
Bart Van Assche (2):
fault-inject: Restore support for task-independent fault injection
block: Make I/O timeout failure injection again task-independent
block/blk-timeout.c | 2 +-
include/linux
]
irq_forced_thread_fn+0x2a/0x70
irq_thread+0x144/0x1a0
kthread+0x125/0x140
ret_from_fork+0x2a/0x40
Fixes: commit e41d58185f14 ("fault-inject: support systematic fault injection")
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Jens Axboe <ax...@kernel.dk>
Cc: Dmitry Vyukov &
fault-inject: support systematic fault
injection")
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Dmitry Vyukov <dvyu...@google.com>
Cc: Akinobu Mita <akinobu.m...@gmail.com>
Cc: Michal Hocko <mho...@kernel.org>
Cc: Andrew Morton <a...@linux-foundation.o
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote:
> +static inline bool blk_mq_has_dispatch_rqs(struct blk_mq_hw_ctx *hctx)
> +{
> + return !list_empty_careful(>dispatch);
> +}
> +
> +static inline void blk_mq_add_rq_to_dispatch(struct blk_mq_hw_ctx *hctx,
> + struct request *rq)
The symbolic constants QUEUE_FLAG_SCSI_PASSTHROUGH, QUEUE_FLAG_QUIESCED
and REQ_NOWAIT are missing from blk-mq-debugfs.c. Add these to
blk-mq-debugfs.c such that these appear as names in debugfs instead of
as numbers.
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Omar Sandoval
It is nontrivial to derive from the blk-mq source code when
blk_mq_tags.active_queues is decremented. Hence add a comment that
explains this.
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.de>
Cc:
or_switch_mq() and blk_mq_update_nr_requests().
Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com>
On Tue, 2017-05-02 at 16:41 +0200, Jan Kara wrote:
> So I'm also not aware of any particular breakage this would cause. However
> logically the freeing of request mempools really belongs to
> blk_release_queue() so it seems a bit dumb to move blk_exit_rl() just
> because SCSI stores the fact from
On Thu, 2017-05-04 at 01:19 +0800, Ming Lei wrote:
> On Wed, May 03, 2017 at 05:08:30PM +0000, Bart Van Assche wrote:
> > Callers of blk_mq_quiesce_queue() really need blk_mq_stop_hw_queue() to
> > cancel delayed work synchronously. The above call stack shows that we have
> >
On Wed, 2017-05-03 at 11:24 -0600, Jens Axboe wrote:
> diff --git a/drivers/block/mtip32xx/mtip32xx.c
> b/drivers/block/mtip32xx/mtip32xx.c
> index 3a779a4f5653..33b5d1382c45 100644
> --- a/drivers/block/mtip32xx/mtip32xx.c
> +++ b/drivers/block/mtip32xx/mtip32xx.c
> [ ... ]
> @@ -4009,7 +4009,7
rs from drivers, particularly from ->queue_rq()
> when we have to stop processing for a bit. We can't block from
> those locations, and we don't have to guarantee that we're
> fully flushed.
Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com>
On Thu, 2017-05-04 at 00:52 +0800, Ming Lei wrote:
> Looks v4.11 plus your for-linus often triggers the following hang during
> boot, and it seems caused by the change in (blk-mq: unify hctx
> delayed_run_work
> and run_work)
>
>
> BUG: scheduling while atomic: kworker/0:1H/704/0x0002
>
Hello Tejun and Christoph,
While testing a series of SCSI target patches I ran into the following
crash in the initiator call stack after I requested the iSCSI initiator
code to log out:
general protection fault: [#1] SMP
Modules linked in: target_core_user uio target_core_iblock
On Wed, 2017-05-03 at 20:25 +0100, Russell King - ARM Linux wrote:
> There were comments on the patch which seemed to be unresolved.
Do you mean the header guard? That's easy to resolve.
> However, it would be nice if rd_size could go with some other related
> declarations somewhere (if there
existing declarations
in .
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Cc: Russell King <li...@armlinux.org.uk>
Cc: Jens Axboe <ax...@kernel.dk>
Cc: Jan Kara <j...@suse.cz>
Cc: <yanai...@huawei.com>
Cc: <zhaohongji...@huawei.com>
Cc: &l
On Tue, 2017-05-16 at 17:39 +0800, Anand Jain wrote:
> BTRFS wanted a block device flush function which does not wait for
> its completion, so that the flush for the next device can be called
> in the same thread.
>
> Here is a RFC patch to provide the function
> 'blkdev_issue_flush_no_wait()',
On Mon, 2017-06-19 at 11:04 -0600, Jens Axboe wrote:
> +static long fcntl_rw_hint(struct file *file, unsigned int cmd,
> + u64 __user *ptr)
> +{
> + struct inode *inode = file_inode(file);
> + long ret = 0;
> + u64 hint;
> +
> + switch (cmd) {
> + case
On Tue, 2017-06-20 at 19:48 -0600, Jens Axboe wrote:
> Good catch. Bart, will you spin a v2?
Hello Jens,
That's the first task I will work on tomorrow morning.
Bart.
From: Bart Van Assche <bart.vanass...@sandisk.com>
Add a comment above the queue_lockdep_assert_held() macro that
explains the purpose of the q->queue_lock test.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst.de>
C
From: Bart Van Assche <bart.vanass...@sandisk.com>
Some functions in block/blk-core.c must only be used on blk-sq queues
while others are safe to use against any queue type. Document which
functions are intended for blk-sq queues and issue a warning if the
blk-sq API is misused. Thi
From: Bart Van Assche <bart.vanass...@sandisk.com>
Since scsi_req_init() works on a struct scsi_request, change the
argument type into struct scsi_request *.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst.de>
Reviewed-by:
On Wed, 2017-05-03 at 12:46 -0700, Bart Van Assche wrote:
> The global variable 'rd_size' is declared as 'int' in source file
> arch/arm/kernel/atags_parse.c and as 'unsigned long' in
> drivers/block/brd.c. Fix this inconsistency. Additionally, remove
> the declarations of rd
Hello Jens,
The three patches in this series fix issues in the patches that are queued
for kernel v4.13. Please consider these for kernel v4.13.
Thanks,
Bart.
Bart Van Assche (3):
block: Declare local symbols static
block: Fix off-by-one errors in blk_status_to_errno
Since blk_mq_quiesce_queue_nowait() can be called from interrupt
context, make this safe. Since this function is not in the hot
path, uninline it.
Fixes: commit f4560ffe8cec ("blk-mq: use QUEUE_FLAG_QUIESCED to quiesce queue")
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com&
This was detected by the smatch static analyzer.
Fixes: commit 2a842acab109 ("block: introduce new block status code type")
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.com>
Cc: Ming Lei <
Avoid that building with W=1 causes the compiler to complain that
a declaration for bounce_bio_set and bounce_bio_split is missing.
References: commit a8821f3f32be ("block: Improvements to bounce-buffer
handling")
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com>
Cc
On Sun, 2017-06-18 at 20:55 -0600, Jens Axboe wrote:
> On 06/08/2017 11:33 AM, Bart Van Assche wrote:
> > This patch series contains one patch that reduces the size of struct
> > blk_mq_hw_ctx, a few patches that simplify some of the block layer code and
> > also patches t
From: Bart Van Assche <bart.vanass...@sandisk.com>
Instead of documenting the locking assumptions of most block layer
functions as a comment, use lockdep_assert_held() to verify locking
assumptions at runtime.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-b
From: Bart Van Assche <bart.vanass...@sandisk.com>
A queue must be frozen while the mapped state of a hardware queue
is changed. Additionally, any change of the mapped state is
followed by a call to blk_mq_map_swqueue() (see also
blk_mq_init_allocated_queue() and blk_mq_update_nr_hw_
From: Bart Van Assche <bart.vanass...@sandisk.com>
The variable 'disk_type' is never modified so constify it.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.com>
Cc: Omar Sandoval &
From: Bart Van Assche <bart.vanass...@sandisk.com>
Since the srcu structure is rather large (184 bytes on an x86-64
system with kernel debugging disabled), only allocate it if needed.
Reported-by: Ming Lei <ming@redhat.com>
Signed-off-by: Bart Van Assche <bart.vanass...@sandis
From: Bart Van Assche <bart.vanass...@sandisk.com>
Document the locking assumptions in functions that modify
blk_mq_ctx.rq_list to make it easier for humans to verify
this code.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst
From: Bart Van Assche <bart.vanass...@sandisk.com>
Initialization of blk-mq requests is a bit weird: blk_mq_rq_ctx_init()
is called after a value has been assigned to .rq_flags and .rq_flags
is initialized in __blk_mq_finish_request(). Initialize .rq_flags in
blk_mq_rq_ctx_init() i
From: Bart Van Assche <bart.vanass...@sandisk.com>
Instead of explicitly calling scsi_req_init() after blk_get_request(),
call that function from inside blk_get_request(). Add an
.initialize_rq_fn() callback function to the block drivers that need
it. Merge the IDE .init_rq_fn() fu
From: Bart Van Assche <bart.vanass...@sandisk.com>
Some functions in block/blk-core.c must only be used on blk-sq queues
while others are safe to use against any queue type. Document which
functions are intended for blk-sq queues and issue a warning if the
blk-sq API is misused. Thi
From: Bart Van Assche <bart.vanass...@sandisk.com>
Since scsi_req_init() works on a struct scsi_request, change the
argument type into struct scsi_request *.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst.de>
Reviewed-by:
q and blk-mq.
* Added several new patches, e.g. "block: Rename blk_mq_rq_{to,from}_pdu()".
Bart Van Assche (12):
blk-mq: Reduce blk_mq_hw_ctx size
block: Make request operation type argument declarations consistent
block: Introduce request_queue.initialize_rq_fn()
block: Make most scsi_
From: Bart Van Assche <bart.vanass...@sandisk.com>
Instead of declaring the second argument of blk_*_get_request()
as int and passing it to functions that expect an unsigned int,
declare that second argument as unsigned int. Also because of
consistency, rename that second argument fr
From: Bart Van Assche <bart.vanass...@sandisk.com>
Add a comment above the queue_lockdep_assert_held() macro that
explains the purpose of the q->queue_lock test.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst.de>
C
From: Bart Van Assche <bart.vanass...@sandisk.com>
Several block drivers need to initialize the driver-private request
data after having called blk_get_request() and before .prep_rq_fn()
is called, e.g. when submitting a REQ_OP_SCSI_* request. Avoid that
that initialization co
On Tue, 2017-06-20 at 08:37 +0200, Hannes Reinecke wrote:
> On 06/20/2017 12:07 AM, Bart Van Assche wrote:
> > +static void sas_initialize_rq(struct request *rq)
> > +{
> > + scsi_req_init(rq);
> > +}
>
> Any particular reason why you didn't use scsi_ini
On Mon, 2017-06-19 at 17:06 -0600, Jens Axboe wrote:
> On 06/19/2017 04:08 PM, Bart Van Assche wrote:
> > --- a/block/blk-mq.c
> > +++ b/block/blk-mq.c
> > @@ -1140,8 +1140,9 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx
> > *hctx)
> > static void _
From: Bart Van Assche <bart.vanass...@sandisk.com>
A queue must be frozen while the mapped state of a hardware queue
is changed. Additionally, any change of the mapped state is
followed by a call to blk_mq_map_swqueue() (see also
blk_mq_init_allocated_queue() and blk_mq_update_nr_hw_
From: Bart Van Assche <bart.vanass...@sandisk.com>
Instead of explicitly calling scsi_req_init() after blk_get_request(),
call that function from inside blk_get_request(). Add an
.initialize_rq_fn() callback function to the block drivers that need
it. Merge the IDE .init_rq_fn() fu
From: Bart Van Assche <bart.vanass...@sandisk.com>
The variable 'disk_type' is never modified so constify it.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.com>
Cc: Omar Sandoval &
From: Bart Van Assche <bart.vanass...@sandisk.com>
Instead of declaring the second argument of blk_*_get_request()
as int and passing it to functions that expect an unsigned int,
declare that second argument as unsigned int. Also because of
consistency, rename that second argument fr
From: Bart Van Assche <bart.vanass...@sandisk.com>
Document the locking assumptions in functions that modify
blk_mq_ctx.rq_list to make it easier for humans to verify
this code.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst
From: Bart Van Assche <bart.vanass...@sandisk.com>
Instead of documenting the locking assumptions of most block layer
functions as a comment, use lockdep_assert_held() to verify locking
assumptions at runtime.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-b
From: Bart Van Assche <bart.vanass...@sandisk.com>
Initialization of blk-mq requests is a bit weird: blk_mq_rq_ctx_init()
is called after a value has been assigned to .rq_flags and .rq_flags
is initialized in __blk_mq_finish_request(). Initialize .rq_flags in
blk_mq_rq_ctx_init() i
From: Bart Van Assche <bart.vanass...@sandisk.com>
Several block drivers need to initialize the driver-private request
data after having called blk_get_request() and before .prep_rq_fn()
is called, e.g. when submitting a REQ_OP_SCSI_* request. Avoid that
that initialization co
h blk-sq and blk-mq.
* Added several new patches, e.g. "block: Rename blk_mq_rq_{to,from}_pdu()".
Bart Van Assche (12):
blk-mq: Reduce blk_mq_hw_ctx size
block: Make request operation type argument declarations consistent
block: Introduce request_queue.initialize_rq_fn()
bl
From: Bart Van Assche <bart.vanass...@sandisk.com>
Since the srcu structure is rather large (184 bytes on an x86-64
system with kernel debugging disabled), only allocate it if needed.
Reported-by: Ming Lei <ming@redhat.com>
Signed-off-by: Bart Van Assche <bart.vanass...@sandis
This patch suppresses gcc 7 warnings about falling through in switch
statements when building with W=1. From the gcc documentation: The
-Wimplicit-fallthrough=3 warning is enabled by -Wextra. See also
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Warning-Options.html.
Signed-off-by: Bart Van
existing declarations
in .
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Cc: Russell King <li...@armlinux.org.uk>
Cc: Jens Axboe <ax...@kernel.dk>
Cc: Jan Kara <j...@suse.cz>
Cc: <yanai...@huawei.com>
Cc: <zhaohongji...@huawei.com>
Cc: &l
On Thu, 2017-05-18 at 15:18 +0200, Christoph Hellwig wrote:
> We've cleaned up our headers sufficiently that we don't need this split
> anymore.
Hello Christoph,
Request-based drivers need the structure definitions from and
the type definitions from but do not need the definition of
struct
On Wed, 2017-05-24 at 07:51 +0200, Hannes Reinecke wrote:
> On 05/24/2017 02:33 AM, Bart Van Assche wrote:
> > Enable this mechanism for all scsi_target_*block() callers but not
> > for the scsi_internal_device_unblock() calls from the mpt3sas driver
> > because
This simplifies the memset() call in scsi_initialize_rq() and avoids
that any stale data is left behind in struct scsi_request.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.com>
---
drive
Since the SCSI core zeroes driver-private command data, remove
that code from the virtio driver.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Cc: Michael S. Tsirkin <m...@redhat.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.c
split scsi_request out of struct
request")
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Cc: Jens Axboe <ax...@fb.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Omar Sandoval <osan...@fb.com>
Cc: Hannes Reinecke <h...@suse.com>
Cc: linux-block@vger.ker
-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.com>
---
drivers/scsi/scsi_error.c | 1 -
drivers/scsi/scsi_lib.c | 10 ++
drivers/scsi/scsi_priv.h | 1 -
3 files changed, 2 insertions(+), 10
truct
request")
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Cc: J. Bruce Fields <bfie...@fieldses.org>
Cc: Jeff Layton <jlay...@poochiereds.net>
Cc: Jens Axboe <ax...@fb.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Omar Sandoval <osan...@fb.
it as a
separate function.
References: commit 82ed4db499b8 ("block: split scsi_request out of struct
request")
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Cc: Jens Axboe <ax...@fb.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Omar Sandoval <osan...@fb.com>
;scsi: allocate scsi_cmnd structures as part of
struct request")
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Cc: Jens Axboe <ax...@fb.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Tejun Heo <t...@kernel.org>
Cc: Jan Kara <j...@suse.cz>
Cc:
This patch is a preparation for the next patch that will zero
the struct scsi_request embedded in struct scsi_cmnd before
calling scsi_req_init().
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke &l
Since scsi_req_init() works on a struct scsi_request, change the
argument type into struct scsi_request *.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.com>
---
block/scsi_ioctl.c
The only functional change is that this patch causes scsi_setup_fs_cmnd()
to clear scsi_request.sense_len.
Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Reviewed-by: Christoph Hellwig <h...@lst.de>
Cc: Hannes Reinecke <h...@suse.com>
---
drivers/scsi/scsi_lib.
501 - 600 of 2095 matches
Mail list logo