From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51C04C47258 for ; Thu, 25 Jan 2024 07:52:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C1D9E8D0015; Thu, 25 Jan 2024 02:52:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BCA5F8D000C; Thu, 25 Jan 2024 02:52:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A6BBA8D0015; Thu, 25 Jan 2024 02:52:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 8BB868D000C for ; Thu, 25 Jan 2024 02:52:31 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3884B80D11 for ; Thu, 25 Jan 2024 07:52:31 +0000 (UTC) X-FDA: 81717066102.28.5B748C9 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by imf11.hostedemail.com (Postfix) with ESMTP id 68A184000A for ; Thu, 25 Jan 2024 07:52:29 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Wa31oFcS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of huangzhaoyang@gmail.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=huangzhaoyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706169149; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=5uK2qKsb1JHnaulezlSEoy6gr4tqLbF94nnEz1jH0Oo=; b=oj0GpWd6YBK0VedpJwaV+wDNUinNtp42Fi4BCwn4uaMnuKugdWEsNo05ay5kLijXdCwBJk XGmxLlP2Yc9+wOPFWe4EDh7iCs041TUVna9wV3xZcQbP5GujMzP+x1MvdTNyVAz/HQ97Mw bL5lwcqfG+5QfYYa4fn4wFcEo+6TwLA= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Wa31oFcS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of huangzhaoyang@gmail.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=huangzhaoyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706169149; a=rsa-sha256; cv=none; b=4al1NLuoq5Hh8PWOdnwCH8tN3IYhLnUXBWrC+/t9xWgw/iNm5Om4qhUiMsQ0otv+tkrcU1 UNp7pwNyzn3+SAoSRXJVkR+Rx/5lX3o/IbgVhP39hT0WKxcPwdnlQ3E797xHv4/sfpbFV6 vFLtliI+43bL1HFUpmiFDPMY0z6nRhY= Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5101f2dfd97so117602e87.2 for ; Wed, 24 Jan 2024 23:52:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706169147; x=1706773947; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5uK2qKsb1JHnaulezlSEoy6gr4tqLbF94nnEz1jH0Oo=; b=Wa31oFcS0W7nO49uQKzYA7ESB0ifsYYjcRCJ+vqioCjUw/LLJklqBp4ZYVBptZy0df v2FKreQi1mN4gCQcMwGJBSkTswg7hF09AxBKNvUPoju+DVNgqfJ0gJGuZNzYTli2BLtj QZdCqFnBLJneTE8G1DRQ1BUlVk4xEWNndFfeXwj/mUY+NFKKlzZatxU7T/+Y/PQ77vNm z5bEEOZ6PafKY63ShsvFSFeu62FE0KD5EWMGVK9aGOlJKq4SPEGm65BRSL7unn36/ame Nv0z2E6TrxiFXBfVKaeHkFbDD7EDCzbs8B576UxpCBo+qRsu9ltvVvX9WX40IXthso05 em7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706169147; x=1706773947; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5uK2qKsb1JHnaulezlSEoy6gr4tqLbF94nnEz1jH0Oo=; b=WqwUNxqMiEWK+/DsrVl+u+BsMw81XaXac+MsX+Xn69Sg6Bgtmojrorf7w4SFqzNJ5Y sVyB6/t8e32mslWzPnbiEaolRFE+TtKIb2X0yD5BLUG/YCO7R/WvNjQ4l014aW88s18G tOoh5OpR0rcUxOwmRRjJr6U71+VX22MJoFR15ke6ViF8OhQM+mCoKjdqBhijPBxFmk0a 81ze4BtHwfghf5kJhEthlIxOWmxRFNpmZv7LJeruQR78AJYb9pw55tebUTGjQ5/22uNy UogL2mVzxWUMTUViYZhKwU62M/SiQiy+MqlSR8mSOaFR96Gwq28U7AZrjPA62VibpljT Q1bA== X-Gm-Message-State: AOJu0YyYpvguTJOyrz14xx3GqqscXYUJJjKnMi67+pjruBy5po32eebM vA7p+KhxDhg3aYfOgojkvgQ3uzm3heCxNJh0UkjGEQJE2AfLgWFJEtDk1URwSUM8MRVG8Wr3PLp f8QsNKbCvNcocZ66cOMbV/XKVwlg= X-Google-Smtp-Source: AGHT+IHc5UO3q54Qrbj7KL7mYwjWK6D70f7fzJAn72OzNVdUkSQgBVntcy5ppmoUPTdhI3q7nrnPVGxIMuyQorJy7S0= X-Received: by 2002:a05:6512:3ba1:b0:510:d29:cf57 with SMTP id g33-20020a0565123ba100b005100d29cf57mr311022lfv.33.1706169147484; Wed, 24 Jan 2024 23:52:27 -0800 (PST) MIME-Version: 1.0 References: <20240125071901.3223188-1-zhaoyang.huang@unisoc.com> <6b2d5694-f802-43a4-a0fd-1c8e34f8e69a@kernel.org> In-Reply-To: <6b2d5694-f802-43a4-a0fd-1c8e34f8e69a@kernel.org> From: Zhaoyang Huang Date: Thu, 25 Jan 2024 15:52:16 +0800 Message-ID: Subject: Re: [PATCHv3 1/1] block: introduce content activity based ioprio To: Damien Le Moal Cc: "zhaoyang.huang" , Andrew Morton , Jens Axboe , Yu Zhao , Niklas Cassel , "Martin K . Petersen" , Hannes Reinecke , Linus Walleij , linux-mm@kvack.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, steve.kang@unisoc.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 68A184000A X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 4hxj8e6bo9n9keq75cadry3jd7attgcx X-HE-Tag: 1706169149-288861 X-HE-Meta: U2FsdGVkX1/hXW7XtM+mZsnX9etEAHM29KfPSOaSASPdcxravgNoq45PG1XEcvNnRW5ItaHW6vwrfj6hQ5zgVrgTriC2d4aGsNU77gNFu8R6yAeZI63HXPdPcJW67FEgQuZV29cmX/wvpMc5PkJq8rDTkqdu+lPEuh1Ti8hFXa+Rm2y+6qEYHFpx8M3Fv4LfREOfn35Qq5tlOxKNgbQtkfLnlsTbZtbWiEdga6RLbzyA0Mq+9tKXgNYgDrcn7g0NRIqcsTIKN8gRUndlqbkelyyAbauZr5qESCwjixxyEBX5RCnvPOD7Fxaf3uEJkzE209ecAUFheWglvRm3tw8XpOD1cl+AOOodF9d+yYmo8DqI2IXsYzFD67TXOfYQtORS+QqRGgl011QrEYWpb5n8RWD1KzP6X924KejnC5xSeIsRjxuMeJJianrZDiSzC06urFJyx6ME5W1vTw81uSIdEMuo943GQMahZmHgbl7X+hXY/zVOjiF/MosX4gD+Ek40OY0xv390QT2n8q/iGuFamOib/qlZWHsVtxBey9U4eZi4uOHO0JVDRk3/rA4eb71nruMv2QPRxGje4FYkqz6FG/FphjRLRrJsO5060CEV2PKAvVJ30cCdCMKdDuTw1IaU78OX2Gm9VgRUQBOJjZq/4537gxE9M5A/on0ahKwIY764h+1Yw5F4ThREAVud9RW57fqIC8plG5ZEjjk7ZBgmH5VnOy6srbcIt9pJ5IfN8sn53TTFUvROxXr0OA7w6EbStpzteUsHBeldg76u9SonOkFyAWRP+zLcsSNCyaoN6Xy9fGET+IyIHJrB4U7tDGByU4WPNTeR2wGo9nl4gMpGabCmeEU0c7BIff2KcOhWzhOqWhK2P3zF0vxMltAazsgGvj1pT3iT40SPL6iDsRgtQnz7b6vWpyxABC59zPCoZ72+W6VGzPlPxrga0+ISz8HaeIFkadUoohgEiHaptYO 8hN6+CU9 rgH7mbh+VcONJjablz8GpdzR2Z7LXXvh/K/ev3IexzPCHLL0S+D2iClgpydIPYTbJ+wu4aUuEm3PwDorZTZB1n6qNcJIMtiQtfRfLGf4Cd/ZkJJlQbUcdM2wqamwlngk64OlpLbIk9RCkMNKx0SYbAfHPWr/pbBJKIulJQbSbIjDKVBfw/h1SqZAHAOd+E2SaacG9jQEB0ThOWEy5omLMg8OhREcR1Wps0ArxFl2FidpBT2iTAYOBTavfnxZDn716Xa0yJK3pSdbrzx8FyOUte2UGg+mDVk7pLjmVe45wBl2jo5fYIgQGNCk8WDBAiXyjErhlfkXYmgPP4wjxhNJWnUU6IAX2YyzxcZUGCClDyNoHYirx7KL9V4/8wp3TJMI2Sjy12LfmMq+4+hQlOkWwqdixgXaiptWzTY8pwrqxMeXa3nQFu0Kj9Kd4bd3IKIbOG4j5p06ECIm120quWDcNJCCKLw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000064, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Jan 25, 2024 at 3:40=E2=80=AFPM Damien Le Moal = wrote: > > On 1/25/24 16:19, zhaoyang.huang wrote: > > From: Zhaoyang Huang > > > > Currently, request's ioprio are set via task's schedule priority(when n= o > > blkcg configured), which has high priority tasks possess the privilege = on > > both of CPU and IO scheduling. > > This commit works as a hint of original policy by promoting the request= ioprio > > based on the page/folio's activity. The original idea comes from LRU_GE= N > > which provides more precised folio activity than before. This commit tr= y > > to adjust the request's ioprio when certain part of its folios are hot, > > which indicate that this request carry important contents and need be > > scheduled ealier. > > > > This commit is verified on a v6.6 6GB RAM android14 system via 4 test c= ases > > by changing the bio_add_page/folio API in ext4 and f2fs. > > And as mentioned already by Chrisoph and Jens, why don't you just simply = set > bio->bi_ioprio to the value you want before calling submit_bio() in these= file > systems ? Why all the hacking of the priority code for that ? That is not > justified at all. > > Furthermore, the activity things reduces the ioprio hint bits to the bare > minimum 3 bits necessary for command duration limits. Not great. But if y= ou > simply set the prio class based on your activity algorithm, you do not ne= ed to > change all that. That is because bio->io_prio changes during bio grows with adding different activity pages in. I have to wrap these into an API which has both of fs and block be transparent to the process. > > Note: Your patch is full of whitespace changes. Sorry, I double checked the source code and the patch with checkpatch.pl again, no whitespace found, don't know why > > -- > Damien Le Moal > Western Digital Research >