Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp631329rdb; Thu, 8 Feb 2024 16:56:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHufGjG1LgieR9FajAH/ic9ZRqmFWXYzNCdt0YFCxBVGVbsxc2m6wA2e4b8ebEP0cnxDhCq X-Received: by 2002:a17:903:98d:b0:1d9:259b:5708 with SMTP id mb13-20020a170903098d00b001d9259b5708mr76547plb.13.1707440165668; Thu, 08 Feb 2024 16:56:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707440165; cv=pass; d=google.com; s=arc-20160816; b=H6PTLCTHRKAtS3ZBheag09Sm8wCU25YOPj/0bQYeYPPG2AnbF7CLXasksWwGU3QYgQ YylOmIgXwb+3dBdkjU6TtJ2Lhg+iwcELmKIswXCz4sPRb+SnohBvIjDP2u9kOFFp3Ikk t+VGliVjwaKZKCuwiifpB4iYA/jOE4NjCCpYOnUnr7mUnnqhoqEGDJRe9eKfGec7cfQY gx8R/dBwPnYzpggZTJNnZwqkpvWKKZ+OExFOGqCXXZ5NDgrhdYCFHmw61TcQofYC9Hh0 UKkAQL2aZ8jlaMbP1W2GKqNqO5ZKb6zCpDdSKFw2JFv2sYQkFm1ZXf1YgdboT+W/kBzC edxA== 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=m85Rc7O+xtvz/kv98+mO9yNpBrc4x6v0UIlGlomnOFQ=; fh=vu3df94XePBGqvJLS9NZlbC6cJhEkQNMvG2VmHQreqM=; b=Dh9GlpE41vvHPe3JvS3WmOUp9uzAQakvP6EmdTzLSSk8hvckJcaaQufdZIItLo79cX F/Tu0pmL8thGrK+hmz1SWfCYTfYQ8JJkk01LIb4a0Pm6+NSS35XgEbqvqcaAWrSRTgzz r+ukfODDJckrViL8OfwDMI3UHSbMoWf1YuVXZMKEBbcQ655YBfoo3jMF0m7a8ET3re9P CvSzJ9ad54DW3XmZYbNcHpjHlSe7piwhoEMd8TAdMjKYwduHfJ7Ts+VYzb6BICUJr36e o+mrCgmNyhaE2AmiNVVa1kIBR+5zRkg7rwKhCXYLSf/Z1xfO8ROke28Lzz97BRBTiTMm LMEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ik+BM2gX; 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-58904-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58904-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCVQkkidYdpnpWkvCRMjxYgA5COSKYkatOXkcq/rNMPAXj7lRx4OrQLo2YsPjFnWsA4u1c17EQVGKeFx0nBG914gp1ENM53NsHAbnsPjcQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n2-20020a170902d2c200b001d9b281c1a6si685515plc.311.2024.02.08.16.56.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 16:56:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58904-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ik+BM2gX; 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-58904-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58904-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 80238B22BDC for ; Fri, 9 Feb 2024 00:29:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0358BA23; Fri, 9 Feb 2024 00:29:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ik+BM2gX" Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 55301360; Fri, 9 Feb 2024 00:29:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707438551; cv=none; b=l+SJHsSZwcoFLcDWW/PRpAwF9Iid4zJZKg8RVgOkrXKRjgf1vhNwJ5o/w8vrbNdv127enLbQaB7P9IMydpL2m8KwMQBkx/ccb7muogc29q1kzHJZynaHSaXJRH01roLxJV7tFbxXs9Z3un422R1OIVCD9cZuE0aDL8sPhupAJpI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707438551; c=relaxed/simple; bh=mxIXfavPDX1gqzM3y8fLX5I+QOs8CzXzRcxl+812TWM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=BNreBpaOcfErBZwU1Z6xb9FJyTGg0PTrE+GtB7HpghhE9YQqNfJgVuUm9CKeNxec5VTbIOTxM8xhZ1IgnwQ/KHflaU55uUdqZ4F3UoMOvdsPheEaQMXIWxJHKC2pNXT+K/WzbjAQAINFo3yROKG7ekQcCET2hp0nIqXPFJD7Zsk= 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=ik+BM2gX; arc=none smtp.client-ip=209.85.208.172 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-lj1-f172.google.com with SMTP id 38308e7fff4ca-2d09faadba5so6367731fa.1; Thu, 08 Feb 2024 16:29:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707438547; x=1708043347; 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=m85Rc7O+xtvz/kv98+mO9yNpBrc4x6v0UIlGlomnOFQ=; b=ik+BM2gXhfF9TUoMmIOIIJdBeBjOdrVLMcEZuYtfeXLmRs1jnhYjMGw/g2OHTIS7ia /AbsV9SJ5eDWC1DSMh9gtkcWiokEzAR6Yn+B3rGLg3m+kR/On6nB3hyIRjnQD/tkY+/f tAX4HUXOeLJa7ZC3uPQwWb6OqtF1V2INhREp08xL4HjgqBp6vjRmUuR524fgT48BNDFz euwR1CRj4e0MaJFxsFxjPWxh8RkE+ESoNO8McOpZcop4Oqv2YGsliZ6axmEHUzNfD1ty hwOGTy0MS+6re1c081OXK49CsNm0L77B51Ui1UQUhOYUEbHODIQoDK5dcRPAmMGUCbq0 EkOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707438547; x=1708043347; 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=m85Rc7O+xtvz/kv98+mO9yNpBrc4x6v0UIlGlomnOFQ=; b=b8SOOlODQAwEcnEOKnPSf7mX6z9cCYoucfHzPMkD9uHKKWeljg6bw0yny2S20VgmK6 2FIE5n/c7S9RBxQzbUWVnrPt0m0ieEr606BnRnFYu1b7xawKQYbqXmlQZCq6vvK49l9X B6AUepxixFQHWFydOGqrRLZctlmXSi7Yh1zej0CcpckrqMoskUZy3JYmHjpiTAWyW+cb 5AnrvhEE49oNp6dl+LHbQh2uAZWmo9GKQ4aA18KQ8SMrZRPFB1OLQdcC4PygQmoA+4JT KnTHmfAJB2avR4cqbcTcKA5AzyotcKGSrG6fTE3JGJ2J1vkTzTWiq3GyniFKH0jQZoqn +Zbg== X-Gm-Message-State: AOJu0YzMO06ZCNfNhQxlZBk9MYUOg49fKia54xQeL3djvXF/cjPNX0YU gO9/I8BfIW2z9HC1MToFeGW+GuRZzYilazsXCJAqzU08vu0eicEr/We/LuxGnYn2iik7p9jlxhk Mr/t9ykVUuiFzFQ+L0WXP7VNUKII= X-Received: by 2002:a2e:83d0:0:b0:2d0:af09:e3df with SMTP id s16-20020a2e83d0000000b002d0af09e3dfmr98586ljh.16.1707438547136; Thu, 08 Feb 2024 16:29:07 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240208093136.178797-1-zhaoyang.huang@unisoc.com> <20240208093136.178797-3-zhaoyang.huang@unisoc.com> In-Reply-To: From: Zhaoyang Huang Date: Fri, 9 Feb 2024 08:28:55 +0800 Message-ID: Subject: Re: [PATCH 3/3] block: introducing a bias over deadline's fifo_time To: Jens Axboe Cc: "zhaoyang.huang" , Peter Zijlstra , Ingo Molnar , Juri Lelli , Vincent Guittot , Yu Zhao , 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 Fri, Feb 9, 2024 at 8:11=E2=80=AFAM Jens Axboe wrote: > > On 2/8/24 5:02 PM, Zhaoyang Huang wrote: > > On Fri, Feb 9, 2024 at 1:49?AM Jens Axboe wrote: > >> > >> On 2/8/24 2:31 AM, zhaoyang.huang wrote: > >>> diff --git a/block/mq-deadline.c b/block/mq-deadline.c > >>> index f958e79277b8..43c08c3d6f18 100644 > >>> --- a/block/mq-deadline.c > >>> +++ b/block/mq-deadline.c > >>> @@ -15,6 +15,7 @@ > >>> #include > >>> #include > >>> #include > >>> +#include "../kernel/sched/sched.h" > >>> > >>> #include > >>> > >>> @@ -802,6 +803,7 @@ static void dd_insert_request(struct blk_mq_hw_ct= x *hctx, struct request *rq, > >>> u8 ioprio_class =3D IOPRIO_PRIO_CLASS(ioprio); > >>> struct dd_per_prio *per_prio; > >>> enum dd_prio prio; > >>> + int fifo_expire; > >>> > >>> lockdep_assert_held(&dd->lock); > >>> > >>> @@ -840,7 +842,9 @@ static void dd_insert_request(struct blk_mq_hw_ct= x *hctx, struct request *rq, > >>> /* > >>> * set expire time and add to fifo list > >>> */ > >>> - rq->fifo_time =3D jiffies + dd->fifo_expire[data_dir]; > >>> + fifo_expire =3D task_is_realtime(current) ? dd->fifo_ex= pire[data_dir] : > >>> + CFS_PROPORTION(current, dd->fifo_expire[data_di= r]); > >>> + rq->fifo_time =3D jiffies + fifo_expire; > >>> insert_before =3D &per_prio->fifo_list[data_dir]; > >>> #ifdef CONFIG_BLK_DEV_ZONED > >>> /* > >> > >> Hard pass on this blatant layering violation. Just like the priority > >> changes, this utterly fails to understand how things are properly > >> designed. > > IMHO, I don't think this is a layering violation. bio_set_ioprio is > > the one which introduces the scheduler thing into the block layer, > > this commit just wants to do a little improvement based on that. This > > commit helps CFS task save some IO time when preempted by RT heavily. > > Listen, both this and the previous content ioprio thing show a glaring > misunderstanding of how to design these kinds of things. You have no > grasp of what the different layers do, or how they interact. I'm not > sure how to put this kindly, but it's really an awful idea to hardcore > some CFS helper into the IO scheduler. The fact that you had to fiddle > around with headers to make it work was the first warning sign, and the > fact that you didn't stop at that point to consider how it could be > properly done makes it even worse. > > You need to stop sending kernel patches until you understand basic > software design. Neither of these patches are going anywhere until this > happens. There's been plenty of feedback to telling you that, but you > seem to just ignore it and plow on ahead. Stop. Ok, thanks for pointing this out, I will follow your advice. But I have to say that '[PATCHv9 1/1] block: introduce content activity based ioprio' really solved layering violation things. I would like to humbly ask for your kindly patient to have a look, as it is really helpful. > > -- > Jens Axboe >