Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp973192iob; Fri, 13 May 2022 18:12:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1Cu9zg1lOAZWJsSAAcGgL50bZ8nn/+2wKk14A/suxVcwN49nN/aczXFhINyYDLlVfxpsg X-Received: by 2002:a05:6000:144e:b0:20c:ab37:70f3 with SMTP id v14-20020a056000144e00b0020cab3770f3mr6048283wrx.682.1652490753959; Fri, 13 May 2022 18:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652490753; cv=none; d=google.com; s=arc-20160816; b=O5lX0jBuLRLI5MhEIOr+O1/qKTT0RNEeeS+90dZ292Icq3f0opj9UCjlXH+wFc+7iw EbY5JLdkw8fa2VVPfVvNLFwlYAHVczl4RLkZ6A3h0Jo42mcFtev2yRwwGz8vB8rC04SA uZaCKHSIbx34wCTDIUWKEXT41+6V5jqv5jyq9A595XseSnY0ZN5ygicVlPuc46tq0f50 tqB4snR+38mzsMVtI9cqOQLJ/17FhRnG+rxnqSCQ+jgzg6Yk4KB3ruQzlcCaq1qt5NTF rPW+PpGfeWwXiAQstQqFc22rXj4cWF2d1WrkHktPpYfH9o7cG5ikX9m+um0n2XPMVbCw +Tmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=oDwzrEU/rzPVuzUSyRunDQki9Nn6D3CUZzmf451zRn0=; b=bszIjiT3YASyii6W0TBheBJTEYAByoKmDeowHK2KJ0u/dDdJ0YG5wnu4SiHkEcjtoa 8O3nmPRGZHt5/sGowrYjKgx0D4pPft/87y78dO1yqiKPAFg24CYUGarQBminig5BIYYi V3Uv4Y/CzwvItuzrESitCwYR5vsQoekWAig39/8SpPth8pCyx27Cblidm0dk5oRmoBhG I21tbKiDEGPsyX4axRfbvb1Ay3J48nbvOtamK9tyfPgZKHa7ZULUep1c/BPpUi1SgyHs iGrJsmsMyO6zHTst9EMR2vYErKW8CxccJL1mf0+QgGm+nDd31PS9utP8sGnoXQostWMp YiPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n4-20020a5d5984000000b0020a7db1e91dsi3749602wri.42.2022.05.13.18.12.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:12:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A8D0C39F789; Fri, 13 May 2022 16:43:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376493AbiEMCVX (ORCPT + 99 others); Thu, 12 May 2022 22:21:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244592AbiEMCVV (ORCPT ); Thu, 12 May 2022 22:21:21 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FB6E719D8; Thu, 12 May 2022 19:21:18 -0700 (PDT) Received: from kwepemi100014.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Kzskp2mkdzGpVV; Fri, 13 May 2022 10:18:26 +0800 (CST) Received: from kwepemm600009.china.huawei.com (7.193.23.164) by kwepemi100014.china.huawei.com (7.221.188.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 13 May 2022 10:21:16 +0800 Received: from huawei.com (10.175.127.227) by kwepemm600009.china.huawei.com (7.193.23.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 13 May 2022 10:21:15 +0800 From: Yu Kuai To: , , CC: , , , Subject: [PATCH -next v2 0/2] block, bfq: make bfq_has_work() more accurate Date: Fri, 13 May 2022 10:35:05 +0800 Message-ID: <20220513023507.2625717-1-yukuai3@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600009.china.huawei.com (7.193.23.164) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes in v2: - add reviewed-by tag for patch 1 - use WRITE_ONCE() for updating of 'bfqd->queued' in patch 2 This patchset try to make bfq_has_work() more accurate, patch 1 is a small problem found by code review. BTW, I not sure why blk_mq_run_hw_queues() is called with 'bfqd->lock' held, I think this is not necessary. And bfq_has_work() can be more accurate by reading 'bfqd->queued' with 'bfqd->lock' held after patch 2. Previous versions: v1: https://lore.kernel.org/all/20220510131629.1964415-1-yukuai3@huawei.com/ Yu Kuai (2): block, bfq: protect 'bfqd->queued' by 'bfqd->lock' block, bfq: make bfq_has_work() more accurate block/bfq-iosched.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) -- 2.31.1