Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6540795imu; Wed, 30 Jan 2019 17:11:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN4s0M5kjuoAZoR5ixHJHWfI5haU6y+NyFck6q1WpkbMKgfe/o14mJOOj6Ar3OTifVtmQfoh X-Received: by 2002:a17:902:161:: with SMTP id 88mr33516544plb.306.1548897095163; Wed, 30 Jan 2019 17:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548897095; cv=none; d=google.com; s=arc-20160816; b=yLru/g/TT5cBt1ZyakP/IPWeeEk3CIqLQm9XUW6Dva7t/sP2XVVRtcz5JE5tCtS7sN ZUEiY0JslPPUqniev825LNYGnCW6S2qi0AviFPG9likjhxEzKlX+3coYV6ZBjDyvfz6M 6UYfcarzm6RvTnI/FytQDIC4m6c0y8tIbBbCstUA9qvjy0UpaXur+Yn/iXXeNztwNyCo LgdqmDYIbyBhq43h+CjIMiewt9/PGEzSAbgMedRFsAxbGlvdDurrX3CB8yXCQfuT7aPx GwzIozgDn/g4qevaJlKYfIBzwMp6ILgp6pTfBU8id4NaVqaxEcHGl1e+Sxgfkk90vOQU nVdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=GyEcPoXgNXrtjeMYiCYnP5UTpN6S7ZaIihBq844d7Lk=; b=ivNg07Omn5wvxy3AzsWgvqFTfYHXSO3jH+RXlKsubOGVA/TfuSZQ2CJu3PHH4c0xEr yqN0rKk3ZkmNd0kjCvemv5+kmXjVrqzIINLS1uTSgfazpDAkK+tMmiNKbhUHGqhiAZdZ 10XHxvwywyRehAgaHay8GvDuGvjOtbGo3jZAAKNdTDziipvsuqhIYK1Azky9M6K4i4Jr IcNenbTLHeiitWywtsmaas6jyIPTQSLKILsS5YQAr7cdiFazskgfG4+dZagfUdDmgISS ci2O6Lzx5DGnnO5Wy3tqdA9aPVo27pR0VHYueOD5G2JfQ22a6xGLQq0RLn09Y2mnKtMt /1ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B03Rrf0d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m35si2879264pgb.246.2019.01.30.17.11.16; Wed, 30 Jan 2019 17:11:35 -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=@gmail.com header.s=20161025 header.b=B03Rrf0d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726906AbfAaBLK (ORCPT + 99 others); Wed, 30 Jan 2019 20:11:10 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43354 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbfAaBLK (ORCPT ); Wed, 30 Jan 2019 20:11:10 -0500 Received: by mail-pl1-f195.google.com with SMTP id gn14so659269plb.10; Wed, 30 Jan 2019 17:11:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=GyEcPoXgNXrtjeMYiCYnP5UTpN6S7ZaIihBq844d7Lk=; b=B03Rrf0dthPdoHdErqn3Q+xokGwZLuA7O3ewO8AmoONLlTTJfzpQCd20OrKx0ODd1w Hu6eP4+DU6TVMq/IMz/xraJ8mebjs1EuRlYEs3XJFSl5uqgkScxIZzuASwQYSAaKsPkP nVuCMDVzZi41/qWyoJwJ4Cuh5s8ocbpz9Pu/Htjw0cXXcdzzU8tUbJwerQCHj1MDLW6Y sLBs2tuZz+fDeVYOlu+vMQET5pxyCB9eZJNWa0sBNv9XwL7QUvgop9f3xe9IpFgGRk7+ QFT9L0YxoyxhO6MKkJUNNOatuHOcFVyVPyEQi20/tmnc+hlv4HfiAR8vVPmrNcAP2HX9 FYOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GyEcPoXgNXrtjeMYiCYnP5UTpN6S7ZaIihBq844d7Lk=; b=qrWFeRMkbChxV4tlVVX5OfafDWygS5S6rXbPjDlthsTHjF3RqCbW2VbijT9IyhXLsS +uNh9qoyFXLtCdJ1itDXqBtD+PNpsv64kNciYDk8CuMq6AtOz2Y9QXXuBH66C5rgsoaK WiaD201qhUvviO3aGhWg9IJkDcu0oJhQz605cgGE+UaqVaLIsmfPFxyFSDTLvX0Ryu2e DtyfTPuPfCVCHz8hFnAdqOv3jkvAHIjv1PCdfsEkC/NK/Jq2ATMnLZr41PGBBQtM6LHO sf+HmejqylZkCsZcQIRixu36F7ocKh3uCWI/eu81bnO1UqPDF3ghQ7YOmMTfoI4IhZ1G ++Gw== X-Gm-Message-State: AJcUuke5jO+nDSPVbjD9tgF/y3O7QPLZx3O/nb5WSQm0SChL5wx1gSg7 GljygqAU7sz+US2GLcLolf+BdvyTtAw= X-Received: by 2002:a17:902:be0e:: with SMTP id r14mr30749390pls.124.1548897068856; Wed, 30 Jan 2019 17:11:08 -0800 (PST) Received: from bebop.suse.de ([179.185.209.200]) by smtp.gmail.com with ESMTPSA id d18sm4308642pfj.47.2019.01.30.17.11.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jan 2019 17:11:07 -0800 (PST) From: Marcos Paulo de Souza To: linux-kernel@vger.kernel.org Cc: Marcos Paulo de Souza , Jens Axboe , linux-block@vger.kernel.org (open list:BLOCK LAYER) Subject: [PATCH] blk-sysfs: Rework documention of __blk_release_queue Date: Wed, 30 Jan 2019 23:11:39 -0200 Message-Id: <20190131011139.2264742-1-marcos.souza.org@gmail.com> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 + * process of releasing a request queue starts with blk_cleanup_queue, which + * set the appropriate flags and the calls blk_put_queue, that decrements + * 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) { -- 2.16.4