Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp167150pxf; Thu, 11 Mar 2021 00:27:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6LAtDbUP5tp3h8pK53J7dOfEc3ZbxpWarHCivGbujIiCAA5p4tPog8OQdNQ5fLypfpJ3O X-Received: by 2002:a17:906:fcc7:: with SMTP id qx7mr1967918ejb.486.1615451237846; Thu, 11 Mar 2021 00:27:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615451237; cv=none; d=google.com; s=arc-20160816; b=Kpu2tNkBcDzYpSa5mHssGgRha2ICfLFwuwIya6Vv0kMFPFIMmevZz5V1dTB4U1p5Jm qzdnI+XtC7qCNYc/ds71XANPRWb/+XNNE7rMFW7qt1eFyHjkLTUf/9NcOKukUkfNTzw6 D2cV+1WASKbpvsvbVjn5atAfb8pj6tKLPgd3Qn+MO73KogEPkcv2HhgrhfFr3M2g3kkD bAE70uMSl7CdcmsZATDl3kKS28h+f/pqA0FjD/QHkOCg2R++m73EsTpR2o+8lSz7Br3s zub+tkF8Ti0nngxhM9cctp1j3USsK3ciPmSeas+Tv+73d7rsY19E56a8MPDKPYAl9/TH 5Ujw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=4q5h+9cpSDF0toE3+RVHyB+vd7zc6WHE2krl3ZCPXvI=; b=EwlQOXWs0Iz/mK/VC+dHxWQKIuM3f3/yLGfnaXUxZhBPTfwFZQVjUZ1a19Z85OzFCG rw4TVktJ5AIpOW9SnQ8lpnZDfZOIOPyAEKrtd9Oj+6yrT58xkyUSDQAq5iDEcJXBGBXn aJsF6P0AU2hfPCYnxATT57lTj7CIT0tNyRjt2TlbxKoOdIffQNt9mq9T3inBzf/LFQ1m NaRvvlfc/VnqrB7wX+sogBVckY7sfrzaYdg9StH2m7lC9xcVOjc4YDHmJqtPNZzQktvM cm2Bc6LHaMbcy/FskAa0iyhmHrFh8s7RmJ1vKFFrKk7mdW7gelJWeBsQCp8THvhJFE93 A3XA== ARC-Authentication-Results: i=1; mx.google.com; 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 b26si1348763ejb.374.2021.03.11.00.26.55; Thu, 11 Mar 2021 00:27:17 -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; 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 S231237AbhCKIXh (ORCPT + 99 others); Thu, 11 Mar 2021 03:23:37 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2684 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbhCKIX2 (ORCPT ); Thu, 11 Mar 2021 03:23:28 -0500 Received: from fraeml715-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Dx20N5kFxz67wjQ; Thu, 11 Mar 2021 16:19:00 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml715-chm.china.huawei.com (10.206.15.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 11 Mar 2021 09:23:25 +0100 Received: from [10.47.4.196] (10.47.4.196) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 11 Mar 2021 08:23:24 +0000 Subject: Re: [RFC PATCH v3 2/3] blk-mq: Freeze and quiesce all queues for tagset in elevator_exit() To: Ming Lei CC: , , , , , , , , References: <1614957294-188540-1-git-send-email-john.garry@huawei.com> <1614957294-188540-3-git-send-email-john.garry@huawei.com> From: John Garry Message-ID: <8c6c6783-6152-2332-2f50-14c409e40320@huawei.com> Date: Thu, 11 Mar 2021 08:21:21 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.4.196] X-ClientProxiedBy: lhreml715-chm.china.huawei.com (10.201.108.66) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/03/2021 00:58, Ming Lei wrote: >> Indeed, blk_mq_queue_tag_busy_iter() already does take a reference to its >> queue usage counter when called, and the queue cannot be frozen to switch >> IO scheduler until all refs are dropped. This ensures no stale references >> to IO scheduler requests will be seen by blk_mq_queue_tag_busy_iter(). >> >> However, there is nothing to stop blk_mq_queue_tag_busy_iter() being >> run for another queue associated with the same tagset, and it seeing >> a stale IO scheduler request from the other queue after they are freed. >> >> To stop this happening, freeze and quiesce all queues associated with the >> tagset as the elevator is exited. > I think this way can't be accepted since switching one queue's scheduler > is nothing to do with other request queues attached to same HBA. > > This patch will cause performance regression because userspace may > switch scheduler according to medium or workloads, at that time other > LUNs will be affected by this patch. Hmmm..that was my concern also. Do you think that it may cause a big impact? Depends totally on the workload, I suppose. FWIW, it is useful though for solving both iterator problems. Thanks, John