Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2727441pxb; Tue, 9 Mar 2021 09:22:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2l9Eeyaz5KQvb6pdrpjz+wjrw74EmnoybUJvnKu+3n1nL5fYBj8pQD9dJtBsNvjOfgLVb X-Received: by 2002:a7b:c24e:: with SMTP id b14mr5244031wmj.73.1615310558647; Tue, 09 Mar 2021 09:22:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615310558; cv=none; d=google.com; s=arc-20160816; b=b/qlP6rmc98pvv7Oo4alwskedjy6BdDyokY8liA/zWVVMSwMYGAbnKP+aXB3SXUiO0 j/oKUNpaJrhGrLbkbmDCJmE0eWCV41xqGiHnR4VKS+V9ppVXerS+x5oUkLBxeD7cUDRv 5hpI8ysP5ftK20NG3urVfL36k1Z3NxGpuWwpmCuv8+pV0PRa7i/VEcjG6tdDzfaFtrU2 aDs/1dao8aJZc+jEO2sKju6wc3fNmimF7wleZ29TD7t2IevH4XZjpsJl0h8+aGmvnTvf sd38hkqCO9REs/8AhLg/ir+eZJfjOHPcL0b7+vrnVoE073zft5kOxPEuGJZpvGvHQCUJ TDyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hKqQl5whCBmaWHSVBpXAHPsHwOMZKD0Kuuvea7IZx9c=; b=tHRryu8xyB4aiGSLNs5K6MKKySDruqMLv+hGk0C0G9d4Yx9tjEkFYWnLXRFZZYyF/Z OHYjXO6h9uLmwm8X4rLnavMt6zqE5Dz8COuPPqb0/kSv6c9Oxow/7fy1hEo+Q4BKpWZD l9T8maxsrHkQPXKuyfuJyLWRRc20Drj/AqTvq9B3twGaucx9+xhRr1WFhybOgKP0a5WE jfgKLnaiZXDm5dtSsoi/5V3NshZAVJs69jbyJ2UkKXgSH5GOfMtmmxgK8LQJJQGsfc/b SVHO8y8UOROPzEfQkN9XKMQiDgjl4S15Lh7xfY2sJC1yxR7kIdV10U9OyIt7tUYTx0Xf D2oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZOVa5yLA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g21si9183551ejf.645.2021.03.09.09.22.15; Tue, 09 Mar 2021 09:22:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZOVa5yLA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231613AbhCIRUf (ORCPT + 99 others); Tue, 9 Mar 2021 12:20:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231278AbhCIRUV (ORCPT ); Tue, 9 Mar 2021 12:20:21 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0C27C06174A; Tue, 9 Mar 2021 09:20:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=hKqQl5whCBmaWHSVBpXAHPsHwOMZKD0Kuuvea7IZx9c=; b=ZOVa5yLAv+xDhi3GToUKObjegn RCruCVhHBNy0GLlE5OzxBZPZii/m399pItn9FOhuHsElrHUlTkzG0dpMGP1NB4ECaHEmM3Yqj1jTB WZoywTHK8egpU9tF/yvLL8PD8phZjIJwvY1pdILweD013a6pzFY0uo1WmwbXHoReTOvPGwd8Mpt10 UgoDOs2YL4DCNB+CW2IugCVine+qtpIlmUp4RmtLhYbeLMSEfPwsEytnpbP0xD51OqrmntQsnTMNC mNqlDP3uHYDIDsJUsjKfUG1n34H/CHKnqflsG8xxDygJNJrmLJKJG61M6VsnpaJRxOIxO3V1xBuxU 0KhlVQUw==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lJg15-000qT0-AJ; Tue, 09 Mar 2021 17:19:39 +0000 Date: Tue, 9 Mar 2021 17:19:31 +0000 From: Christoph Hellwig To: Sergei Shtepa Cc: snitzer@redhat.com, agk@redhat.com, hare@suse.de, song@kernel.org, axboe@kernel.dk, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-api@vger.kernel.org, pavel.tide@veeam.com Subject: Re: [PATCH v6 1/4] block: add blk_mq_is_queue_frozen() Message-ID: <20210309171931.GA201344@infradead.org> References: <1614774618-22410-1-git-send-email-sergei.shtepa@veeam.com> <1614774618-22410-2-git-send-email-sergei.shtepa@veeam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1614774618-22410-2-git-send-email-sergei.shtepa@veeam.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 03, 2021 at 03:30:15PM +0300, Sergei Shtepa wrote: > +bool blk_mq_is_queue_frozen(struct request_queue *q) > +{ > + bool ret; > + > + mutex_lock(&q->mq_freeze_lock); > + ret = percpu_ref_is_dying(&q->q_usage_counter) && percpu_ref_is_zero(&q->q_usage_counter); Please avoid the overly long line. Also maybe frozen is a better name for the variable currently called ret?