From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753955AbcBGNmA (ORCPT ); Sun, 7 Feb 2016 08:42:00 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36973 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753670AbcBGNl6 (ORCPT ); Sun, 7 Feb 2016 08:41:58 -0500 Subject: Re: [PATCH] NVMe: do not touch sq door bell if nvmeq has been suspended To: Wenbo Wang , Keith Busch References: <1454341324-21273-1-git-send-email-mail_weber_wang@163.com> <56AF8DB5.70206@fb.com> <20160203144123.GB23910@localhost.localdomain> <20160203163808.GC23910@localhost.localdomain> Cc: Jens Axboe , "Wenwei.Tao" , Wenbo Wang , "linux-nvme@lists.infradead.org" , "linux-kernel@vger.kernel.org" From: Sagi Grimberg Message-ID: <56B749A1.8030504@dev.mellanox.co.il> Date: Sun, 7 Feb 2016 15:41:53 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Keith, > > Is the following solution OK? > synchronize_rcu guarantee that no queue_rq is running concurrently with device disable code. > Together with your another patch (adding blk_sync_queue), both sync/async path shall be handled correctly. This can be acceptable I think. > Do you think synchronize_rcu shall be added to blk_sync_queue? Or, we'll add it to blk_mq_stop_hw_queues() and then scsi will enjoy it as well. > diff --git a/block/blk-mq.c b/block/blk-mq.c > index 4c0622f..bfe9132 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -865,7 +865,9 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async) > if (!async) { > int cpu = get_cpu(); > if (cpumask_test_cpu(cpu, hctx->cpumask)) { > + rcu_read_lock(); > __blk_mq_run_hw_queue(hctx); > + rcu_read_unlock(); I think the rcu is better folded into __blk_mq_run_hw_queue to cover all the call sites.