Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1655694imj; Sun, 10 Feb 2019 07:24:26 -0800 (PST) X-Google-Smtp-Source: AHgI3IbWrd5d98Kh735k2UmBuzvPCuo+3NeBW1LNX/SDUYSWioyR9UPnxNVDDXOIjl8jvxajU4rw X-Received: by 2002:a62:8d46:: with SMTP id z67mr13955246pfd.249.1549812266692; Sun, 10 Feb 2019 07:24:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549812266; cv=none; d=google.com; s=arc-20160816; b=MtqsxnecaplXoOTEvQ1ThK8NpkOk/+1R9Q91x8kWTbQfDnVCM8leWo/WOpkL2i01KO LjqwI6WAIxVebUG10GRUMXCLd5w3L0u4KNKnZXRzw3qKvvz2cwZ0Hq++/U/cUc8mRQDC 3pcFZJK6vBer1NFZBuwwNCY9KSUCzijNcbSP9YI23RIMwCuR0TJGSVzRfZsEo2YVvR/M TjT248YKNCVDtyCqFfwuDPpqN5HbWWyp9qQapuHN5KN7UaKVBle4ypAnm4kuc30E4tew bYoQb9Gsq/uVhzcfUz+gYtT+IAylzsnw7emxcZ+ZKrq4JWI+LpBpyUquPai08NgHIraR 9xKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=cwOfBmCsWpM2ET3DtQtEGtek6cK7DN1HHieUktob4oI=; b=q3svm5U+zvt2KmNi+SJerWFqsfucum4KiFaJxItD5TAo9H/+SntwKHwh0mboT3GVXf Wbu0pdRRuW0bCibvOhZF8WoRujmgNuvYIHq3Nzwsfj2aVTtIpQ5+P9GdURjtP/rrvS4K c87amqmdadTzpshnvDumORg6p1rte8A0w2iIZ30djp1GkXTUzVQH8l0e2ck6P7RS43w6 SOMuvXMV9qeFt0jYFGwinHZs8ixnv7YjB94+6XLgNl7gDDn+LTE+O4XvvtejWeWivDKt AP9Ft7+z4gEIuv9WBWiBIOIzcrL71gHrslkD151oBKt1i0TFhgBx78Devd7W1YV22odL OqhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=AuMcXZWL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2si1412986pfb.214.2019.02.10.07.24.09; Sun, 10 Feb 2019 07:24:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=AuMcXZWL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726274AbfBJPX3 (ORCPT + 99 others); Sun, 10 Feb 2019 10:23:29 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36844 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726042AbfBJPX3 (ORCPT ); Sun, 10 Feb 2019 10:23:29 -0500 Received: by mail-pg1-f195.google.com with SMTP id n2so3797978pgm.3 for ; Sun, 10 Feb 2019 07:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cwOfBmCsWpM2ET3DtQtEGtek6cK7DN1HHieUktob4oI=; b=AuMcXZWL4HEjqA4r7F/JNZr0kRnk66YwIatOSFwyJTwng2Vt2M3YJnNNs7I92gi3M3 TXIzp4Ay+uMC6Ojukk66fmUjC/pW+E62/qZDh+Uabv4DJDJ05OxouhYyxu/4D8/8ULpL G7DfW587MbMqnm+CSYBjv1wvVHAorL8h1hng3YPtC2sWZVkoiDxAMSdjd8Ski8tAr2HB ITsgawq1+ldxjYwuf5LneyMwXsmWs9LAtnhow59Uqw5PCVQxK29sEiADEKSyVqyTenZW gOgArzGPi2qri3uOWxf3lDLRUH5KtjUJtbEwIHtDAiFzIXe6HI6E5/8EBqWAsHh+pA7X vLZg== 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=cwOfBmCsWpM2ET3DtQtEGtek6cK7DN1HHieUktob4oI=; b=tEjZGEC3R7qElKSrgTVE7HjejDrDW5TbxPSJcujdwD1E/UxSr5lwJR+Qw5lSTmPEmG Qr8qXhkO9gM/6QNU65nIgE6Z4PGgpK9IQBi5THkAO+CGNQRHzFQzUTbc6z2WtaNoNRF4 DJxRhOq43EcSIJ8HFfDaksSnW1eb/7RMy3VpiEA2gvFGj+bf5A5+fDTMJMdkqWC6uUBd 9IIQUWEfxq0vjxCMikkOriZ+NiQF5Yq86wCBckrxiGRCuB2t4SD8t9Hdp/Hbgx98HeHR qLCigK0Gc+X943BukRMzw0juF8R83/AJ29q6B4FfHnvluCTzTBhyhlpV4wnfTjt1tfUH Kb6Q== X-Gm-Message-State: AHQUAuaL1dNsd0+zizc7JlpNxA+BOIyzjKw+M33QqZ93eBfH3hF7rqGV 3vDeKPOCbFxm6UwCsNRziekcBA== X-Received: by 2002:a63:ef50:: with SMTP id c16mr21041199pgk.3.1549812208052; Sun, 10 Feb 2019 07:23:28 -0800 (PST) Received: from [192.168.1.121] (66.29.188.166.static.utbb.net. [66.29.188.166]) by smtp.gmail.com with ESMTPSA id b26sm12132897pfe.91.2019.02.10.07.23.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 07:23:27 -0800 (PST) Subject: Re: [PATCH] blk-sysfs: Rework documention of __blk_release_queue To: Marcos Paulo de Souza , linux-kernel@vger.kernel.org Cc: "open list:BLOCK LAYER" References: <20190131011139.2264742-1-marcos.souza.org@gmail.com> <02fcaaa4-3667-7144-5ca2-4e5346380439@gmail.com> From: Jens Axboe Message-ID: <813bdf91-83de-332d-5d6b-2287039578b5@kernel.dk> Date: Sun, 10 Feb 2019 08:23:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <02fcaaa4-3667-7144-5ca2-4e5346380439@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/9/19 11:34 AM, Marcos Paulo de Souza wrote: > Ping :) > > On 1/30/19 11:11 PM, Marcos Paulo de Souza wrote: >> The Notes section of the comment was removed, because now >> blk_release_queue can only be executed from blk_cleanup_queue (being >> called when the q->kobj reaches zero), and also blk_init_queue was removed >> in a1ce35fa4985. >> >> Signed-off-by: Marcos Paulo de Souza >> --- >> This is basically a v2 of https://lkml.org/lkml/2019/1/14/1098 >> >> But, I tried to describe when this function is called, removing redundancies. >> Maybe it would be better placed in blk-core.c, where the q->kobj is initialized >> with blk_queue_ktype (which .release pointer points to blk_release_queue)? >> >> block/blk-sysfs.c | 19 +++++++------------ >> 1 file changed, 7 insertions(+), 12 deletions(-) >> >> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c >> index 590d1ef2f961..d4dea9179fa6 100644 >> --- a/block/blk-sysfs.c >> +++ b/block/blk-sysfs.c >> @@ -817,21 +817,16 @@ static void blk_free_queue_rcu(struct rcu_head *rcu_head) >> } >> >> /** >> - * __blk_release_queue - release a request queue when it is no longer needed >> + * __blk_release_queue - release a request queue >> * @work: pointer to the release_work member of the request queue to be released >> * >> * Description: >> - * blk_release_queue is the counterpart of blk_init_queue(). It should be >> - * called when a request queue is being released; typically when a block >> - * device is being de-registered. Its primary task it to free the queue >> - * itself. >> - * >> - * Notes: >> - * The low level driver must have finished any outstanding requests first >> - * via blk_cleanup_queue(). >> - * >> - * Although blk_release_queue() may be called with preemption disabled, >> - * __blk_release_queue() may sleep. >> + * This function is called when a block device is being de-registered. The unregistered >> + * process of releasing a request queue starts with blk_cleanup_queue, which >> + * set the appropriate flags and the calls blk_put_queue, that decrements s/the/then >> + * the reference counter of the request queue. Once the reference counter >> + * of the request queue reaches zero, blk_release_queue is called to release >> + * all allocated resources of the request queue. >> */ >> static void __blk_release_queue(struct work_struct *work) >> { >> -- Jens Axboe