From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F2CBC55182 for ; Mon, 20 Apr 2020 21:51:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2BAFC2084D for ; Mon, 20 Apr 2020 21:51:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BAFC2084D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 943848E0005; Mon, 20 Apr 2020 17:51:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F3118E0003; Mon, 20 Apr 2020 17:51:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 809178E0005; Mon, 20 Apr 2020 17:51:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0154.hostedemail.com [216.40.44.154]) by kanga.kvack.org (Postfix) with ESMTP id 663FB8E0003 for ; Mon, 20 Apr 2020 17:51:51 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2FA37181AEF1E for ; Mon, 20 Apr 2020 21:51:51 +0000 (UTC) X-FDA: 76729581222.26.stem45_4a53ec085ab14 X-HE-Tag: stem45_4a53ec085ab14 X-Filterd-Recvd-Size: 4410 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Apr 2020 21:51:50 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id r14so5617795pfg.2 for ; Mon, 20 Apr 2020 14:51:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VgKKIxe7DirK2QHauC8VINdT+s5Rf3r97F/D9e91FTk=; b=uP9bLAsFUrdvg87/JL3VesdiAfmkvC1YZDqVa3htH37hgDUc2i5uTlmF1ba/6ghxJ9 DODmzcmGDT/TWcBy6+wY2EsJtB/Eis5S1OuN08z3cGan6LJgyp0q+Q2EepDFOLNiOjLQ A7OSgdUay6HdJfMxq/baMdSxHYSaBb7Us4i2a2VenMNynX/we1zeukQlthRSOkmf03xa 3sOTXWdh6D/PUq927eG3rZRndJHaNIQEvNw9jbgYqFTEZeH48wdtxCvXZwhPg2B3J78O M25pnPKb9YCAbhDpzJYDsHxC9EnCZNMpKHsSDJosCu8ltoiMWAVqMNrhJRK5bZ2i/QHj a1iA== X-Gm-Message-State: AGi0PuZZ5lFHifu6Lhwzx488cdQddYgsS7ZxEWHJdjPTcoUFaTS/c0Ii Df5EquQ0jpogh4uR5/cFSo4= X-Google-Smtp-Source: APiQypJn1hT4fbB9tcubgpiWGRaRQPxvG+yu2nN4pARSrEYvbs5rxdCSMPSxa0mg9FkB0ytg6Ag33w== X-Received: by 2002:aa7:9302:: with SMTP id 2mr18486299pfj.256.1587419509699; Mon, 20 Apr 2020 14:51:49 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id z15sm355748pjt.20.2020.04.20.14.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 14:51:48 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 0A6DB4028E; Mon, 20 Apr 2020 21:51:48 +0000 (UTC) Date: Mon, 20 Apr 2020 21:51:47 +0000 From: Luis Chamberlain To: Bart Van Assche Cc: axboe@kernel.dk, viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org, rostedt@goodmis.org, mingo@redhat.com, jack@suse.cz, ming.lei@redhat.com, nstange@suse.de, akpm@linux-foundation.org, mhocko@suse.com, yukuai3@huawei.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Omar Sandoval , Hannes Reinecke , Michal Hocko Subject: Re: [PATCH v2 04/10] block: revert back to synchronous request_queue removal Message-ID: <20200420215147.GP11244@42.do-not-panic.com> References: <20200419194529.4872-1-mcgrof@kernel.org> <20200419194529.4872-5-mcgrof@kernel.org> <749d56bd-1d66-e47b-a356-8d538e9c99b4@acm.org> <20200420185943.GM11244@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Apr 20, 2020 at 02:11:13PM -0700, Bart Van Assche wrote: > On 4/20/20 11:59 AM, Luis Chamberlain wrote: > > On Sun, Apr 19, 2020 at 03:23:31PM -0700, Bart Van Assche wrote: > > > On 4/19/20 12:45 PM, Luis Chamberlain wrote: > > > > + * Decrements the refcount to the request_queue kobject, when this reaches > > > > + * 0 we'll have blk_release_queue() called. You should avoid calling > > > > + * this function in atomic context but if you really have to ensure you > > > > + * first refcount the block device with bdgrab() / bdput() so that the > > > > + * last decrement happens in blk_cleanup_queue(). > > > > + */ > > > > > > Is calling bdgrab() and bdput() an option from a context in which it is not > > > guaranteed that the block device is open? > > > > If the block device is not open, nope. For that blk_get_queue() can > > be used, and is used by the block layer. This begs the question: > > > > Do we have *drivers* which requires access to the request_queue from > > atomic context when the block device is not open? > > Instead of trying to answer that question, how about changing the references > to bdgrab() and bdput() into references to blk_get_queue() and > blk_put_queue()? I think if that change is made that we won't have to > research what the answer to the bdgrab()/bdput() question is. Yeah that's fine, now at least we'd have documented what should be avoided. Luis