Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp431085rdb; Thu, 8 Feb 2024 09:51:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMb+H+h+SllAlEskzrprHIPRD/BgXFd+P0baIQj+Aidpsqd9fnUFBKYGmDZKiDZ+95jnju X-Received: by 2002:a81:d34a:0:b0:5ff:9ac1:570b with SMTP id d10-20020a81d34a000000b005ff9ac1570bmr52745ywl.50.1707414673003; Thu, 08 Feb 2024 09:51:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707414672; cv=pass; d=google.com; s=arc-20160816; b=KHZzFFdBobxLrC8qfx6C2uQ/DSutkpclBc0iun4bz3S3AUnVxcp/Qn1gZs59syD9Yp xW00VEdTEXztOPsB/JCRPdonBoZtcR2L/CkLng+L47/hvt+9fQvGLP/7rCmxDVqZ6nOf o8yfPHcO4jZLE/gJV/NMt1cJZx6fnZ0J8x/6UClER0u3AFx/PvHFmfVQjcpNqurSpgKM ElY8DPzr2UksCiTJwHnXCwXnFhciCMizKHWYN5UZwByoFkS29q6qrhEGx6+cdpNKVbUq 4hlgagfHiOcGzuj3mkmSLLtKJ+0z4u/F0GduCZ9AOFOQ8USfXHPbs+Gvcw/JnBi+el0T AXWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=HdpAkoUbuRshwsWxZMXjJeI3qpV/uwbWvYNJ5S9P1pE=; fh=sgqy82TOIZbt0JrYVaeUzwnS614uowUBgYWN0wlm3Nc=; b=M+VMmIBJSbQemxMNki8EswNqfPuKWDzaVi1+pXSBC/RTRe3lcebpqt3oK0yPZOlF24 jtJHWxR4dtSrrsEgNuBHE6KuUscW7K8HZqhMh8FLAagmFccFS+Ah1VT79IeQFFffKaNC x7fnd1KUTAbRGZ2VY9KZJAz09lggTYZdQjtwErpmAkjt9rqDDy0WJYY0RnFa1UOHSz4/ ifq4iis4gmmOm4LcOLV/Yfs1uhYS/Fq3KU7OjDRmA9BPXnz+YEf41C3pMRnM3bs1LtUS Rw7Q3gKH9XegP08AwtiM6u9ESlfEH/RXbJDnXh1HiC/3K6tj1l7E5WZT7aTN3DuW99Fi 8H8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=BaxpnLem; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-58494-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58494-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCW1NXJ9/FMCy5+5o1Tk+WSB9+0tcIsbFobg2bcTplAzFrmCvqveBUNWOmRA/AKwu6KH5L0ssddrawa4NhtVslRkZ1h+nlA++L9nxJQfQw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id kd10-20020a056214400a00b0068cd12ecd2csi5032qvb.300.2024.02.08.09.51.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 09:51:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58494-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=BaxpnLem; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-58494-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58494-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AF1401C21B96 for ; Thu, 8 Feb 2024 17:51:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 347FB86AC7; Thu, 8 Feb 2024 17:49:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="BaxpnLem" Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (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 75B5986152 for ; Thu, 8 Feb 2024 17:49:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707414597; cv=none; b=Shf66p/B4j7QtMtm/ClDvgE/zTHRSaScVnfw6TdRS4CWZgzax4D82o7b6KI+dp+zxMUvy9+VFkNylc1X4JkqTnLFifV1STfAXBkCwH5Xy5bU9Zkj6K8bWL231kGV+rJSIFYYBCPGByhN8GBb0CCgQF4zYZOExAk5drFkrBEAx/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707414597; c=relaxed/simple; bh=Avj4yu2MM5ImiuE5+DUJwBTL1QbYr++j2dWiU/mFTlU=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=UyE4KMV0ormVFPWL7v3+/AplnNo5ZbeSo+6cnfsBPg4SHiK237HNoAz1nCxqv1xaCuAM0Lf6iHavU8qvrtXTPvmQKx4ERUz8nsJefzEl8mdTZT4q2M6EABaL6GcKmlWE6z+l65jYGneDbvlqqQLYhZPpOKehpclwS4Ja2GIMESc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=BaxpnLem; arc=none smtp.client-ip=209.85.166.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-7bf3283c18dso83639f.0 for ; Thu, 08 Feb 2024 09:49:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1707414592; x=1708019392; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=HdpAkoUbuRshwsWxZMXjJeI3qpV/uwbWvYNJ5S9P1pE=; b=BaxpnLembPWt12ftYLHqvAk0BrHduq1mVw3XsT8/dtdM/XrZ2BAHBKVk7+gk/q9329 CV0QRs5bEVvG1Ma7flVoEb+mNoHMs2lV4COGJK2CN2hyQPkaiUZbSKPZoWFt+xvTw6Go Q28R5p0cdBHF/8buaVGnhKhgZC7b4+hkFA114JsjZHd0EPRoGFGcMOYBNX0yx8q4c5As 1ewtKbNq7wKmK5LC4VMkYZTVEnTp19j94JgH94VqKu0vJx/gy9DDvg4YhbDhKV4E2JGt kwb/+VqDSbo+5NvhGl/npRcd4Ny95UAf9nJTtF4xSNZ37uPdM3+asSCHnbDGV9yZ7ypr lT6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707414592; x=1708019392; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HdpAkoUbuRshwsWxZMXjJeI3qpV/uwbWvYNJ5S9P1pE=; b=UQ8PtNwcsqp1tGXWObZG7D/JNWLsp2dFzFPe2Tckg2ZrXAycJTp274eUeW5Z8afE4s jqYh+FiH48Qe5+ByrPpcavxOdi1W2iJpQCZhbPjzQmKWTWGKFV1naMuTqsR9kJ3Tl4SC loNX4yx2ULjRhik9Y37Be8EJoKKTDVIeTUdD/UUw+XKiLBlE9AM5HUHSa1ZlbdyWhF4a Ghf02UB1l45XmrFfu9WJyjsQzznEoEvcvVGiZmihO43uAoqIJV0Y1j4v4cJ6rYOz1KAJ a1dhLxYBxKe2HP+IMSRoayhr6UBgEEI2Uyb7wy2/6RpdpM7StD6w5XpBwI03MZXei6oH ySiA== X-Gm-Message-State: AOJu0YwIBeH3h0fMjDPtluxOMznwXQ6Lgi3KgLrs/tt04UFwC41P/nCS DG5g39+lHEEUzlwrbNH5/wZmK3eUQ+xXgTs/CRzmNrilbWkv0NRRp5MzRHh856w= X-Received: by 2002:a6b:da0e:0:b0:7c4:1966:63e3 with SMTP id x14-20020a6bda0e000000b007c4196663e3mr293048iob.2.1707414592578; Thu, 08 Feb 2024 09:49:52 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUA7vvqdjyYh4bzD3MfyUvTE54+Jlv9ADT3QZEgGi2S3520wL2MV+lL1jYjuLI+0wKzl8p4F9wdfBXr9uwEs6Xgj+Yio38+hddf/QA/J/GMNmhtuX0QMDLGo2+nKtPYsleQSFl7Pvc6EZgrftXI6rYKb/Ky0DMu72UKB/Ljg2D+LBJ8N4P/ONFreWT1JC2YSIF6kGpFqiHi9RU5MYfSuVNMM9VQrZLvCOB/K6Y6goYsrW6/2nBV4pEbE/sE9XA88ITt5bTHzOgDPxIdDKIDjG9oVROUBjfj8OBD3q+gKplKNmOXIh6QGJSxSfywkWDv2PiHmJS2om1mzF+lAdBUv6en9jOlLqXEsQ== Received: from [192.168.1.116] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id t22-20020a02c496000000b004715ce9d44csm395199jam.35.2024.02.08.09.49.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Feb 2024 09:49:52 -0800 (PST) Message-ID: Date: Thu, 8 Feb 2024 10:49:51 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] block: introducing a bias over deadline's fifo_time Content-Language: en-US To: "zhaoyang.huang" , Peter Zijlstra , Ingo Molnar , Juri Lelli , Vincent Guittot , Yu Zhao , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoyang Huang , steve.kang@unisoc.com References: <20240208093136.178797-1-zhaoyang.huang@unisoc.com> <20240208093136.178797-3-zhaoyang.huang@unisoc.com> From: Jens Axboe In-Reply-To: <20240208093136.178797-3-zhaoyang.huang@unisoc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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_ctx *hctx, struct request *rq, > u8 ioprio_class = 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_ctx *hctx, struct request *rq, > /* > * set expire time and add to fifo list > */ > - rq->fifo_time = jiffies + dd->fifo_expire[data_dir]; > + fifo_expire = task_is_realtime(current) ? dd->fifo_expire[data_dir] : > + CFS_PROPORTION(current, dd->fifo_expire[data_dir]); > + rq->fifo_time = jiffies + fifo_expire; > insert_before = &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. -- Jens Axboe