Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp289298lqp; Fri, 12 Apr 2024 19:18:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUIzP/duuwpKlZVIWXyzjzdfIJo5LLpPj5JoVA4VajxZ+6C3a3Me0QnuAgnRoZ8rcHDZIADMxSq52tMbQ2weogO9AdafAweJ33Unx30Ig== X-Google-Smtp-Source: AGHT+IGzlFjc3y27DhvtuZ3Fp0oSl+3JT7kkHQTVh06PXkf/YctswFa/ENBPYBH2OUphb03rjtfx X-Received: by 2002:a17:902:da8f:b0:1e4:61b:98c6 with SMTP id j15-20020a170902da8f00b001e4061b98c6mr5772493plx.4.1712974689621; Fri, 12 Apr 2024 19:18:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712974689; cv=pass; d=google.com; s=arc-20160816; b=qDdLAYva2ucSnMDSUMDgDe4hFpLNH07RBy72m4lSwKGQoF3p3fCMCs4XJyRVi75i7+ cgreL8vqEA0pp+ZxO/QThaPzXYrqFYrR5t8CnNwNTiX5X9uwlklRL3HhHcWu7Acvgy0I ywiEbTKYpRIddvLRXLS+x0uvvjWFpjQn7b5ZlZGnDiFjllTm0i/kMRNdPSz3GdXzJt4y ZGg/zRubmzxQqyGQ+ZySI4ggp9wCGNlgLh24DPUR5SfbIdHmovSun6zhQEV4EMcTqnW3 Fb7+ghSkKwWXbB2RXadJY1Kx2clrelZvjV31SK30v4YgnZMgkwEdxD4pHqNHHPbcVXMt Pomw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:date:message-id:from :references:cc:to:subject; bh=Y82F7q0Cmmvqf8A3Mr+iGm0QsaX3QpsY8rhWJ0vE0Zg=; fh=5bajn1kmo2FZI9wvFID8pBbFodxCTS35a0WawSvaetY=; b=oM8q7mN5s9nXpOAmXbIqkjO2PdcriDXYPYJN8Fby9SUbsr8XN+Ag+W1QLJ6on0N4wC fWX1EPMKh3QVwDSP0IStbbp3u9oG/MREewGrbrabWAqIV86XmgDUphDYl/Flj0lNeIft ZzwyX+l+RjTcXHF8k8JSyteQ6lCu3J6a2IWScyYyRl7NxLgW7i/J1JjkF5dbtovVGQYQ Vj/q5V4eMJ2JnPWb7iEMVf5FRnqOWefqf3WNU9bL+sgL+xgGO7L1jFA+DPgY4sM239R3 iNZZ8cWM3VTF5f0uoH2C6zxwcjjdp7GI9orfeWdjnCXo49vzKqMzA9A8S56G3JHWGmiF KH5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-143518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143518-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id o5-20020a170902d4c500b001e412f0d7c8si4202455plg.466.2024.04.12.19.18.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 19:18:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-143518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143518-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4C11C281AB4 for ; Sat, 13 Apr 2024 02:18:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0981E17591; Sat, 13 Apr 2024 02:18:00 +0000 (UTC) Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDB2A182BB; Sat, 13 Apr 2024 02:17:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712974679; cv=none; b=KibEiD4H7K2aFbEBLp81i4EwacaUZe6fdA1GFZ5lTI0Zyz8hkqs7965T2GGVF3mqHzvcypHRp71mAcsBLC/yauhztxpKsqEw37YBlq4/oTYsoTokFT5Ja/u8A/1PKJjruzjfiVFy4Ab8eKhmbcwEx6EaTNr/F0CluDOzmLlCpU8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712974679; c=relaxed/simple; bh=LdCmdE9QF4G5X/qDNp4uy35b4SPw10KZ8RoarVrkHQU=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=PynyGJpuVmIFFeb994IOX4/Q/rj7Qkvspashrhvz0bm+zIMjMBs55GN/5eNRLG/aidekP3GogqfbDY/WCehjD1i0Aee80yaLOBSkD/hkDjMN1AcZY9rHXgSz6HWFNIyqrvo1jrVhQtaMcV+wbJlm04795Nqv3hiL5D8noIeYjlM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VGcXY1Lc7z4f3l95; Sat, 13 Apr 2024 10:17:49 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id A56571A0572; Sat, 13 Apr 2024 10:17:53 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP1 (Coremail) with SMTP id cCh0CgAn9g5P6xlmLzJcJw--.19418S3; Sat, 13 Apr 2024 10:17:53 +0800 (CST) Subject: Re: [PATCH RFC v2 6/6] blk-throtl: switch to use rq_qos To: Tejun Heo , Yu Kuai Cc: axboe@kernel.dk, chenhuacai@kernel.org, josef@toxicpanda.com, jhs@mojatatu.com, svenjoac@gmx.de, raven@themaw.net, pctammela@mojatatu.com, qde@naccy.de, zhaotianrui@loongson.cn, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, cgroups@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawei.com, "yukuai (C)" References: <20240406080059.2248314-1-yukuai1@huaweicloud.com> <20240406080059.2248314-7-yukuai1@huaweicloud.com> From: Yu Kuai Message-ID: Date: Sat, 13 Apr 2024 10:17:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgAn9g5P6xlmLzJcJw--.19418S3 X-Coremail-Antispam: 1UD129KBjvJXoWrZr4kZFykGF18Jw45tF1rCrg_yoW8JrWfpa ySgay8Jr4ktrZ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ด??: > Hello, > > On Sat, Apr 06, 2024 at 04:00:59PM +0800, Yu Kuai wrote: >> From: Yu Kuai >> >> To avoid exposing blk-throttle internal implementation to general block >> layer. > ... >> @@ -832,7 +832,7 @@ void submit_bio_noacct(struct bio *bio) >> goto not_supported; >> } >> >> - if (blk_throtl_bio(bio)) >> + if (rq_qos_throttle_bio(q, bio)) >> return; >> submit_bio_noacct_nocheck(bio); >> return; > > This is a half-way conversion, right? You're adding a dedicated hook to > rq_qos and none of the other hooks can be used by blk-throtl. Even the name, > rq_qos_throttle_bio(), becomes a misnomer. I'm not really sure this makes > things better or worse. It makes certain things a bit cleaner but other > things nastier. I don't know. Yes, the final goal is making all blk-cgroup policies modular, and this patch use rq-qos to prevent exposing blk-throtle to block layer, like other policies. There is another choice that I think is feasible: Let blk-throttle ping a policy id, and use the id to call throttle function directly, this will require initializing the 'plid' from blkcg_policy() during definition instead of blkcg_policy_register(). Thanks, Kuai > > Thanks. >