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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 91B72C54FD0 for ; Mon, 20 Apr 2020 21:11:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 59CB92078C for ; Mon, 20 Apr 2020 21:11:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59CB92078C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E1B3E8E0005; Mon, 20 Apr 2020 17:11:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DCC098E0003; Mon, 20 Apr 2020 17:11:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE0DF8E0005; Mon, 20 Apr 2020 17:11:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id B36988E0003 for ; Mon, 20 Apr 2020 17:11:18 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 733A7181AEF31 for ; Mon, 20 Apr 2020 21:11:18 +0000 (UTC) X-FDA: 76729479036.02.bite79_b59fa040410d X-HE-Tag: bite79_b59fa040410d X-Filterd-Recvd-Size: 4165 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Apr 2020 21:11:17 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id n24so4400672plp.13 for ; Mon, 20 Apr 2020 14:11:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wrPH749mUN8hliBUrahYDBfQbFobH/RtFO+RluKgR0c=; b=unTq8UbJfCCgAGWivPNS8Snj+Hki3jBAPxIr370c7EZfS+QIiJg+EZW9X+Rb9ZWhio o13IzOLZlibSGuTgOa+56dSSF1Sc8A1ZaVlGF0YWvLknuB/EAMiIJDLVFUdJkh5tF9Fk viHMO0xwEe2jdLJnPaaQfGtUx7VNlET1904rVloswJIVX8FsYJ+gVcxvUcTSXBtx0TUj 0A4t9aQz0iqQFa0iId1GlDhkuF2i6pI361Ic9qmEFUWtxPLOMo/HihNJxzav7yIFZWrs lvrqFQdb7dRCfsuOPCN3UqXO3Z/zEVuzuuv0YlxuXNAZpsvpipLoBCCBEqF7jqOK96eI 9I7w== X-Gm-Message-State: AGi0PubngCAdZnhRA4WMTJBIrVyZoUrsJ4Awds+D+i40qv/Tw86Y3W/e 2ujelR0bLSDV0Lx6Mr3dF0I= X-Google-Smtp-Source: APiQypLpcT/SUkIQmuuXSrPoqK0E8Cp2xLvNfCZASPQMFboRu2ZZ34NFyvthqIVZYVdzDqs93Z4ZTg== X-Received: by 2002:a17:90b:3751:: with SMTP id ne17mr1574517pjb.114.1587417077115; Mon, 20 Apr 2020 14:11:17 -0700 (PDT) Received: from [100.124.9.192] ([104.129.199.10]) by smtp.gmail.com with ESMTPSA id 71sm394670pfw.111.2020.04.20.14.11.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Apr 2020 14:11:16 -0700 (PDT) Subject: Re: [PATCH v2 04/10] block: revert back to synchronous request_queue removal To: Luis Chamberlain 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 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> From: Bart Van Assche Message-ID: Date: Mon, 20 Apr 2020 14:11:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200420185943.GM11244@42.do-not-panic.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 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. Thanks, Bart.