On 4/15/2019 10:26 PM, TomK wrote:
On 4/15/2019 3:35 PM, Laurence Oberman wrote:
On Mon, 2019-04-15 at 08:39 -0700, Bart Van Assche wrote:
On Mon, 2019-04-15 at 08:55 -0400, Laurence Oberman wrote:
On Sun, 2019-04-14 at 23:25 -0400, TomK wrote:
Hey All,
I'm getting a kernel panic on an Gigab
Hi,
Since supporting to blk-mq, big pre-allocation for sg list is introduced,
this way is very unfriendly wrt. memory consumption.
There were Red Hat internal reports that some scsi_debug based tests
can't be run any more because of too big pre-allocation.
Also lpfc users commplained that 1GB+ r
Now sg_alloc_table_chained() allows user to provide one preallocated
SGL, and returns simply if the requested number isn't bigger than size of
that SGL. This way is nice for inline small SGL to small IO request.
However, scattergather code only allows that size of the 1st preallocated
SGL is SG_CH
Looks good:
Reviewed-by: Christoph Hellwig
Now scsi_mq_setup_tags() pre-allocates a big buffer for protection
sg entries, and the buffer size is scsi_mq_sgl_size().
This way isn't correct, scsi_mq_sgl_size() is used to pre-allocate
sg entries for IO data. And the protection data buffer is much less,
for example, one 512byte sector needs 8b
Now scsi_mq_setup_tags() pre-allocates a big buffer for IO sg list,
and the buffer size is scsi_mq_sgl_size() which depends on smaller
value between shost->sg_tablesize and SG_CHUNK_SIZE.
Modern HBA's DMA is often capable of deadling with very big segment
number, so scsi_mq_sgl_size() is often big
With holding queue's kobject refcount, it is safe for driver
to schedule requeue. However, blk_mq_kick_requeue_list() may
be called after blk_sync_queue() is done because of concurrent
requeue activities, then requeue work may not be completed when
freeing queue, and kernel oops is triggered.
So m
Just like aio/io_uring, we need to grab 2 refcount for queuing one
request, one is for submission, another is for completion.
If the request isn't queued from plug code path, the refcount grabbed
in generic_make_request() serves for submission. In theroy, this
refcount should have been released af
In normal queue cleanup path, hctx is released after request queue
is freed, see blk_mq_release().
However, in __blk_mq_update_nr_hw_queues(), hctx may be freed because
of hw queues shrinking. This way is easy to cause use-after-free,
because: one implicit rule is that it is safe to call almost al
Split blk_mq_alloc_and_init_hctx into two parts, and one is
blk_mq_alloc_hctx() for allocating all hctx resources, another
is blk_mq_init_hctx() for initializing hctx, which serves as
counter-part of blk_mq_exit_hctx().
Cc: Dongli Zhang
Cc: James Smart
Cc: Bart Van Assche
Cc: linux-scsi@vger.ke
Once blk_cleanup_queue() returns, tags shouldn't be used any more,
because blk_mq_free_tag_set() may be called. Commit 45a9c9d909b2
("blk-mq: Fix a use-after-free") fixes this issue exactly.
However, that commit introduces another issue. Before 45a9c9d909b2,
we are allowed to run queue during clea
Hi,
Since 45a9c9d909b2 ("blk-mq: Fix a use-after-free"), run queue isn't
allowed during cleanup queue even though queue refcount is held.
This change has caused lots of kernel oops triggered in run queue path,
turns out it isn't easy to fix them all.
So move freeing of hw queue resources into hc
Now freeing hw queue resource is moved to hctx's release handler,
we don't need to worry about the race between blk_cleanup_queue and
run queue any more.
So don't drain in-progress dispatch in blk_cleanup_queue().
This is basically revert of c2856ae2f315 ("blk-mq: quiesce queue before
freeing que
hctx is always released after requeue is freed.
With holding queue's kobject refcount, it is safe for driver to run queue,
so one run queue might be scheduled after blk_sync_queue() is done.
So moving the cancel of hctx->run_work into blk_mq_hw_sysfs_release()
for avoiding run released queue.
Cc
Looks good,
Reviewed-by: Christoph Hellwig
> +static struct blk_mq_hw_ctx *
> +blk_mq_alloc_hctx(struct request_queue *q,
> + struct blk_mq_tag_set *set,
Nit: The second paramter would easily fit on the first line.
> + unsigned hctx_idx, int node)
> +{
> + struct blk_mq_hw_ctx *hctx;
> +
> + hctx = kzalloc_
On Sun, Apr 28, 2019 at 04:14:06PM +0800, Ming Lei wrote:
> In normal queue cleanup path, hctx is released after request queue
> is freed, see blk_mq_release().
>
> However, in __blk_mq_update_nr_hw_queues(), hctx may be freed because
> of hw queues shrinking. This way is easy to cause use-after-f
On Sun, Apr 28, 2019 at 02:14:26PM +0200, Christoph Hellwig wrote:
> On Sun, Apr 28, 2019 at 04:14:06PM +0800, Ming Lei wrote:
> > In normal queue cleanup path, hctx is released after request queue
> > is freed, see blk_mq_release().
> >
> > However, in __blk_mq_update_nr_hw_queues(), hctx may be
On Wednesday 24 April 2019 08:02:12 Christoph Hellwig wrote:
> > +static void fdomain_work(struct work_struct *work)
> > +{
> > + struct fdomain *fd = container_of(work, struct fdomain, work);
> > + struct Scsi_Host *sh = container_of((void *)fd, struct Scsi_Host,
> > +
Resurrect previously removed fdomain driver, in modern style.
Initialization is rewritten completely, with support for multiple cards,
no more global state variables.
Most of the code from interrupt handler is moved to a workqueue.
This is a modularized version with core separated from bus-speci
Future Domain 16xx ISA SCSI support card support.
Currently untested.
Signed-off-by: Ondrej Zary
---
drivers/scsi/Kconfig | 14 +++
drivers/scsi/Makefile | 1 +
drivers/scsi/fdomain_isa.c | 231 +
3 files changed, 246 insertions(+)
crea
Future Domain TMC-16xx/TMC-3260 SCSI driver.
This is the core driver, common for PCI, ISA and PCMCIA cards.
Signed-off-by: Ondrej Zary
---
drivers/scsi/Kconfig | 4 +
drivers/scsi/Makefile | 1 +
drivers/scsi/fdomain.c | 600 +
drivers/scsi
Future Domain PCMCIA SCSI support card support.
Currently untested.
Signed-off-by: Ondrej Zary
---
drivers/scsi/pcmcia/Kconfig | 10 +
drivers/scsi/pcmcia/Makefile | 1 +
drivers/scsi/pcmcia/fdomain_cs.c | 89
3 files changed, 100 insertion
Future Domain TMC-3260/AHA-2920A PCI card support.
Tested on Adaptec AHA-2920A PCI card.
Signed-off-by: Ondrej Zary
---
drivers/scsi/Kconfig | 17
drivers/scsi/Makefile | 1 +
drivers/scsi/fdomain_pci.c | 68 ++
3 files change
On 4/28/19 10:14 AM, Ming Lei wrote:
Split blk_mq_alloc_and_init_hctx into two parts, and one is
blk_mq_alloc_hctx() for allocating all hctx resources, another
is blk_mq_init_hctx() for initializing hctx, which serves as
counter-part of blk_mq_exit_hctx().
Cc: Dongli Zhang
Cc: James Smart
Cc:
25 matches
Mail list logo