Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp336824lqb; Tue, 16 Apr 2024 18:40:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUe0hSxxsiiz5N2+Pka16Xw56IcWW0bl+ACObvGcdC4GWssCEM2oLBM3Zg/90zRl+kg089Htb53SPcW13TxJd3cSo4Pjml6fdoq2xd/lw== X-Google-Smtp-Source: AGHT+IGwDhU9ne5oD0VwKCrx3XYxx/SvkP+zgS8iaF4RgS06ZAe3lmiBEYvBGprqWVBHJsTlWj/k X-Received: by 2002:a17:90a:bc83:b0:2a2:40c4:5175 with SMTP id x3-20020a17090abc8300b002a240c45175mr14577675pjr.14.1713318003526; Tue, 16 Apr 2024 18:40:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713318003; cv=pass; d=google.com; s=arc-20160816; b=y4BIQKlkXjuA7pzmpU3VIJXq38a9OaY/AKnAWJDZrIM0PlBB6wUSS9Xpmj5OvB1dXt o6ZA4VnXdJedsLUI9wv4rXTj31OHNMe/xD0NKSmsiULGO+84g+zNk2VDSPD2/6t8QEKB HPpBKN9FXuPWIJUbkQJJWyYG+zmNsTKQJ9ahgEhbMO5B6dzBPeOJ/hN9ieyR8cmY331Z PwWZYWgGhBJxD8h6ZjSiuOuW3EFfr+Bk3HCpdQtBw4z5dt792hD/UnT12bocMQuxW+Mx MR1iiZMB7uKF2D1d0zg0HbXqe/4x1lDtWfylsMrGxKW4mvaMRZ2evkrdWr1ZKU9Ulr/F 7CrQ== 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=CWA4QLdTgSKpE4zSs2YYCymXW+gO6MpXZCW40dPVa0o=; fh=5bajn1kmo2FZI9wvFID8pBbFodxCTS35a0WawSvaetY=; b=AxngA6P6LpZk9Gn8AjxzqNK4JGUdmK0ludlPHpzt7GGMrjMEdFhNEB0AQ3z6yifysW id5//kE6W9+hLMBozd/63cWXDsyvETNf/Yd0SyVno2y+FVDQbYGF0cVBBIwNglYT+pma 5WH2qzNQzEkRVwu0ckVoDXnTbsfDVqc8VRonHZEeFeNaxvcysO1EU+sL5p10Ex+dhuD0 EPXxyt9Ake10EU5OAbE5QUK+Qp+NZI1kIsbe3Yvshi1BRSQh0prMXOtOqKA7OD7bIpwW IfntE66qSPcOywvoOa97TvAgv1cGwJ2/HRve60mULfxO1Hq3nZBsWgfL20MSc1UyXXw6 2S8w==; 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-147829-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147829-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x2-20020a17090ad68200b002a5ef7a3d69si381320pju.100.2024.04.16.18.40.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 18:40:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147829-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-147829-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147829-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 34CA3283AEF for ; Wed, 17 Apr 2024 01:40:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63EEF4C90; Wed, 17 Apr 2024 01:39:53 +0000 (UTC) Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) (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 F285AA47; Wed, 17 Apr 2024 01:39:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713317992; cv=none; b=oHt6T2Fr94L1E9ls/q8hVE/yrNr7Xkc5EgTgOj+QJqCK3DvUOLpXRAtS4Oyv6ydTgGH3s9ZBUSqxPynpbD5L/kl6CxrT/WSKUJEzsrqpl9bDc6ixc5873tHP5xscsLPLBY74TLD6QGZPuP7t6Snbg3DjXTkJSQElM5cdzSGgCIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713317992; c=relaxed/simple; bh=vUkyGPXH/WxKh8Mk0phahzeyUfhPSs5vaQQASy0FhlQ=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=o3MpojJ2p7fkWkV+0eQ3wdHWdTaTRjHiVJw5U0ayW+NTOxhDTXOtGG69STIFzRB6LciEoxK1hp8GW9lw5lMS2F8F9umc+W6R/VOeUUfmAdtoMQY151BTCpB10wSnR+SnuoMbgtD3/WngHGLP9SbRf8eOxNmTbZ3vqartbTcJZv8= 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.56 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 dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4VK3Vf1s6Gz4f3kjK; Wed, 17 Apr 2024 09:39:38 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 650AF1A0568; Wed, 17 Apr 2024 09:39:45 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP1 (Coremail) with SMTP id cCh0CgAX5g5fKB9mO6K9KA--.49490S3; Wed, 17 Apr 2024 09:39:45 +0800 (CST) Subject: Re: [PATCH RFC v2 5/6] blk-throttle: support to destroy throtl_data when blk-throttle is disabled 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-6-yukuai1@huaweicloud.com> <1bb85208-1224-77dc-f0b2-7b7a228ef70b@huaweicloud.com> <19086c09-3060-a4ce-4ac6-811a29653979@huaweicloud.com> From: Yu Kuai Message-ID: <1ed63126-d2e6-f0b6-42ef-127ecb464955@huaweicloud.com> Date: Wed, 17 Apr 2024 09:39:43 +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:cCh0CgAX5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9x0JUQvtAUUUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ Hi, ?? 2024/04/17 9:22, Tejun Heo ะด??: > Hello, > > On Wed, Apr 17, 2024 at 09:13:34AM +0800, Yu Kuai wrote: >>> Probably a better interface is for unloading to force blk-throtl to be >>> deactivated rather than asking the user to nuke all configs. >> >> I was thinking that rmmod in this case should return busy, for example, >> if bfq is currently used for some disk, rmmod bfq will return busy. >> >> Is there any example that unloading will deactivate resources that users >> are still using? > > Hmm... yeah, I'm not sure. Pinning the module while in use is definitely > more conventional, so let's stick with that. It's usually achieved by > inc'ing the module's ref on each usage, so here, the module refs would be > counting the number of active rules, I guess. Yes, aggred. > > I'm not sure about modularization tho mostly because we've historically had > a lot of lifetime issues around block and blkcg data structures and the > supposed gain here is rather minimal. We only have a handful of these > policies and they aren't that big. > > If hot path overhead when not being used is concern, lazy init solves most > of it, no? For performance, yes. Another point is that we can reduce kernel size this way, without losing support for blk-cgroup policies. Yes, it's just blk-throttle is the most pain in the ass becasue it exposed lots of implementations to block layer. Other rq_qos based policy should be much easier. I guess I'll do lazy init first, and then modularization for rq_qos, and leave blk-throtl there for now. Perhaps add a new throtl model in iocost can replace blk-throtl in the future. BTW, currently during test of iocost, I found that iocost can already achieve that, for example, by following configure: echo "$dev enable=1 min=100 max=100" > qos echo "$dev wbps=4096 wseqiops=1 wrandiops=1" > model In the test, I found that wbps and iops is actually limited to the set value. Thanks, Kuai > > Thanks. >