Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753370AbdLMQNT (ORCPT ); Wed, 13 Dec 2017 11:13:19 -0500 Received: from mail-qt0-f170.google.com ([209.85.216.170]:33477 "EHLO mail-qt0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750916AbdLMQNP (ORCPT ); Wed, 13 Dec 2017 11:13:15 -0500 X-Google-Smtp-Source: ACJfBos+eQ0xM77M5My0NkOcozZ9k1cgycBXkK/90R5CxE3+2hGulaMAxAV5s7wsuNKdizZ6YZDgfg== Date: Wed, 13 Dec 2017 08:13:12 -0800 From: Tejun Heo To: "jianchao.wang" Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, oleg@redhat.com, peterz@infradead.org, kernel-team@fb.com, osandov@fb.com, linux-block@vger.kernel.org, hch@lst.de Subject: Re: [PATCH 1/6] blk-mq: protect completion path with RCU Message-ID: <20171213161312.GS3919388@devbig577.frc2.facebook.com> References: <20171212190134.535941-1-tj@kernel.org> <20171212190134.535941-2-tj@kernel.org> <402aea05-8d04-99e2-5e31-803d2423283d@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <402aea05-8d04-99e2-5e31-803d2423283d@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 750 Lines: 21 Hello, On Wed, Dec 13, 2017 at 11:30:48AM +0800, jianchao.wang wrote: > > + } else { > > + srcu_idx = srcu_read_lock(hctx->queue_rq_srcu); > > + if (!blk_mark_rq_complete(rq)) > > + __blk_mq_complete_request(rq); > > + srcu_read_unlock(hctx->queue_rq_srcu, srcu_idx); > > The __blk_mq_complete_request() could be executed in irq context. There should not be any > sleeping operations in it. If just synchronize with the timeout path to ensure the aborted_gstate > to be seen, only rcu is needed here ,as well as the blk_mq_timeout_work. Sure, but it's just a lot cleaner to use the same to protect both issue and completion; otherwise, whoever who wants to synchronize against them have to do awkward double rcu locking. Thanks. -- tejun