Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp968800rdb; Wed, 24 Jan 2024 00:06:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcUl3wfyR5ybzeLppiDHvmHTI1/Pc6JOd4JCaW8s0sGH4WHqaOWb5ENLT3qyNrB4AE5SI/ X-Received: by 2002:a92:1303:0:b0:35f:9f2f:d67a with SMTP id 3-20020a921303000000b0035f9f2fd67amr1172086ilt.44.1706083583463; Wed, 24 Jan 2024 00:06:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706083583; cv=pass; d=google.com; s=arc-20160816; b=bW9IJ3wQ4eFRE9CqJpQu7jE1G3ZYtYA8a2jRivlzfPHTWZTNVfRlKSGH2iJ05W+nA2 qsHQwUd1jkQKEJECDU0zpNcjad0pcUBqlka9Bosack7lK49xcjoU7ZeAbirebbQ3ftXK F+uepGESC704vdQRPoiUo6fPfdkgY/dV/5bwFnqz8EGr9iYHU4/3CCtiL7JuV4S7UyEC xCT+esNMmcyMjY6j3FSiTqaNTS8C4c8/v4eEA71MfzI3fZnFXu+U6TqVqrW8ICRWiqhm 5hk51jF472EhSxMdBSjbvrqZOhVdtlUTStkzFnENo2FVj0bSIsOG37AFKLDpcXLGwiRm zWlA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=JzlYpDM5q2ItPg3GY2j9GxLh93+1lpjpq8xQsFJhc/Y=; fh=mzKfVc5qk++VemgD/MfxUJqEh9yeyPWtJAkjljhWuA8=; b=DgQKfIDYxYFvSdEw6JnIL0RC5+DICRHkbEMYkqJT++8a19IgjF1H+DxpLcUz0L9ROK viBX86Abg9ryHA+n3m85BorlJHuj+vttlWpulKSj+xmLjNCO8FZOeNQr7EGKMsuYlH3d RLaxUfNDzbjFzahSyZDB0DsnOR6C/WZZNf+bv4NXnbZZygmiRCA9U9UwluctOG7CNgwD BW55dA7CQYaxYfYIoFaxfZ5BvZlRJBlYjwD2znE2npfieKA3CjnBBPQBkQbGVG3tYhD4 In/4MmKYbhUccWPCVVkAoVxJc8tl4vGgXtqQ7MVhb3qc4VVYMpb48QEhOB/Ex1E/8zfF 7j/A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pjz3HyVu; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-36596-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36596-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bz42-20020a056a02062a00b005cdfde5e3f3si12033989pgb.250.2024.01.24.00.06.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 00:06:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36596-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pjz3HyVu; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-36596-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36596-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0C11BB2A4DB for ; Wed, 24 Jan 2024 07:54:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCE72171D2; Wed, 24 Jan 2024 07:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Pjz3HyVu" Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A17C171A2; Wed, 24 Jan 2024 07:54:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706082846; cv=none; b=fnyHV31PE1JKSSg1thYQujNmhlB+0JtopLNx8MibwMsWILHGqNa7ivxqmxHW6rwtM8vKMatGAybr975La7ApID182D1IZOAlGyuL8Qrlhs1nyR6cPdqmdhv+whOBah8jh1r4ifG2gmch6lGgt6ue+GWYyyR1BFLprVFO1LPAQfk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706082846; c=relaxed/simple; bh=3t6xH3QbW5FMmzWRwU4q1T3GJ8BzpO16CpDp0xXh9LU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=j2t8i58UsObUP4/QiAJdqJ1XEQ/ZKQjwNIrMLW/r1C6hFFE0bj6s2KUeDXp/phkn/K33rquuD7ceMFe3PkWs/C7TECq0+yN1R8LwmM0cNPDkzZDZ0qaghlV7+7ByitaJhWnOZR+LrXiI6V2x9jj8x6DhWG+b7g45Guv+t5GHEok= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Pjz3HyVu; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-5100b424f8fso1242140e87.0; Tue, 23 Jan 2024 23:54:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706082842; x=1706687642; darn=vger.kernel.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=JzlYpDM5q2ItPg3GY2j9GxLh93+1lpjpq8xQsFJhc/Y=; b=Pjz3HyVuLaTt6aqgu+cLnpC2hLjRtfQ4RQgPyakOB75GHuw6EeTwrF7GCYAwuat/9B sEJ3Z4Ojl/n8EjesevEp2xvLEalt+quuNhm3UjTkarFFiudKglVQN4UX5rcctrt1zeV1 zvmGV8HxDWhj3wLD3gnobWz0p8c/D9lMxVJi89LH5lub5dfHsnL+RPuG91AYeiji18dp XQMF3ZF7f5etaxujXjwK9/R65WH6lXs797RQfY/o1N5PeyifIp1SGkYRKVG6gfY+j9W1 npPSiBV5QUwX7dvyGyUxpSQUD5ZzXc+WsFDDzOTMwQEHvk9Ns4Y/grtnTXZ+ZEwWATB2 PFZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706082842; x=1706687642; 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=JzlYpDM5q2ItPg3GY2j9GxLh93+1lpjpq8xQsFJhc/Y=; b=urdBUJTUDB+Dy3UGIVYAs0lXKbbyfz4ZBQwbQ7ca3j6KYMFU3kbHtWAioDMkCvA78p IfudmIhRYNSyppGL0Z6kEdPF4iMLLL1H+nFT5Mj7zrscax3/eDuHL0KdXvcF1LGhFk0w eSdzPl7xqy4t1pSTYcuw3Hfq5+9tjgZEFNkO8v4cIAqR691P6OZDnqVa/OdO778eWSpX PS3vTwhnsN4CFySERaRc+hzPZtPTgeg3xAmJNvGgQ2B7AFecjxDA7zUwxHbfWQ3lK44t iXxJ6NgaWhe9F8FdA4q8YDbbggmyYju/73pJuqt5MwgAMYaiBSWLmpGg/4xgEWuOqbYN TuYw== X-Gm-Message-State: AOJu0YzD+K1TA9mIFRfi0YrhYzphXLdVfh3wtVnse8jjcjREOv6luTH9 foIYUKzNa/cSGjVx4AqXcdMdHL56CnU6uVUTMeMj5Py1vgApQqxB7k8LNUjgmJovreLK2UOpiRC QSVS7kgPpd7ZGuOIEqeuogVYrMcNQMncb X-Received: by 2002:a05:6512:6c2:b0:50e:c642:3aed with SMTP id u2-20020a05651206c200b0050ec6423aedmr4218396lff.43.1706082842020; Tue, 23 Jan 2024 23:54:02 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240123093352.3007660-1-zhaoyang.huang@unisoc.com> In-Reply-To: From: Zhaoyang Huang Date: Wed, 24 Jan 2024 15:53:50 +0800 Message-ID: Subject: Re: [PATCH] block: introduce content activity based ioprio To: Christoph Hellwig Cc: "zhaoyang.huang" , Jens Axboe , 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 On Tue, Jan 23, 2024 at 9:06=E2=80=AFPM Christoph Hellwig wrote: > > On Tue, Jan 23, 2024 at 05:33:52PM +0800, zhaoyang.huang wrote: > > #define ALLOC_CACHE_MAX 256 > > @@ -1069,12 +1070,21 @@ EXPORT_SYMBOL_GPL(bio_add_zone_append_page); > > void __bio_add_page(struct bio *bio, struct page *page, > > unsigned int len, unsigned int off) > > { > > + int class, level, hint, activity; > > + > > + class =3D IOPRIO_PRIO_CLASS(bio->bi_ioprio); > > + level =3D IOPRIO_PRIO_LEVEL(bio->bi_ioprio); > > + hint =3D IOPRIO_PRIO_HINT(bio->bi_ioprio); > > + activity =3D IOPRIO_PRIO_ACTIVITY(bio->bi_ioprio); > > + > > WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED)); > > WARN_ON_ONCE(bio_full(bio, len)); > > > > bvec_set_page(&bio->bi_io_vec[bio->bi_vcnt], page, len, off); > > bio->bi_iter.bi_size +=3D len; > > bio->bi_vcnt++; > > + activity +=3D (bio->bi_vcnt <=3D IOPRIO_NR_ACTIVITY && PageWorkin= gset(page)) ? 1 : 0; > > The block layer must not look at page bits. I've fixed all this crap > with a lot of work and we're not going to re-add it for another qute > hack. The place to figure out any kind of I/O priority is the file > system (preferably using generic helpers). ok, will use helper function in next version >