Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp791244rbd; Fri, 23 Feb 2024 03:55:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW/EoTwhonnTZu4uqpfil5YW9cmJiGTlp6EfLlsFkLRvRrcIlli2csxW37pKyQHGN5QjHEPz5dYavy4wdrS4doR/TUtKiw6eMlk5FVtYg== X-Google-Smtp-Source: AGHT+IFTq/PqBblZiXYncyiwYIdwpnE2NueH/yx2vuhnUlYduefWwduhOo6+ToNq1eDOuLxY1oZR X-Received: by 2002:a05:620a:388d:b0:787:a8d1:ebc0 with SMTP id qp13-20020a05620a388d00b00787a8d1ebc0mr1904611qkn.72.1708689343785; Fri, 23 Feb 2024 03:55:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708689343; cv=pass; d=google.com; s=arc-20160816; b=bQ05rYZB1jn0I+R0QsX3sHG8E4RxKqch/SZLoBlv9yWTTR1FlmV++aEhrIqX5Shbgv XRsmYMQ6JqgXJzX6efLkdlPSX6AQnwPQDZd/QWnIPQ4Itufgimp7l/KpjtjDakcVNno0 Z2plWwU+eFiZ2k+Jp/4yS9CAcIiSyA6EBla/7nrjtAXvnpNMIvt7uC6TDkaZhizF5rGi JwmqM7H3EZOipotVEuViYWyLUa5PbyutF4Esl99oEYg1kVbdaywGVmCAsQM0ZotEJ+yo DMWqM6VY63RZaQd6ynW8ojyJylzM64aGA2m0bd5jZ33peas/BpIYQiJ7p/WQ5OK6gC1z 317w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=ZgAbRxJ5InPZt9odwVM5BuYjWb/ovDZ+HPdjW5c9yV4=; fh=bzbbCa4EEFlo4seDzzADBpTrwc5Sn9qmZ6Rkrdt+SjQ=; b=QPHYROoKUQu+TgCCQ4Gh9yDk1YQO5255vroJQGm4OWAj0czeRcXe057KepbHF1s041 GPJMMTQxyvNaervH/wCXh8sKzrq/irgsnTDIAocPMFr5KsHQ4NZRz9LM+AuHq7gd60TI wYoMuOUMkI28qqoXQyzk+i8cv2R5ZSzpJXmbvEoy2m36FWhrnfvW6vvqpKYrqKAMIeks 75XyHKuy66LYFELK83dEswNBJK7DZGg3ipaObhgedMTjVSIplfiOIgRPkVLZOuEMA2RZ zzqQ1f2iAbNSZtMZAw1v4qw/ou+gkPbyyyNJCUm5fUUiKux7gQn5/66kQLPboQ4QYsL+ 7erQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=bLcq86JP; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-78258-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78258-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ow37-20020a05620a822500b0078341830e2esi15100209qkn.337.2024.02.23.03.55.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 03:55:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78258-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=bLcq86JP; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-78258-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78258-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 82AF01C21B83 for ; Fri, 23 Feb 2024 11:55:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 76B6A7AE5A; Fri, 23 Feb 2024 11:55:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="bLcq86JP" Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 4F76A627FC for ; Fri, 23 Feb 2024 11:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708689337; cv=none; b=oYP8wObeqiBheJhx7pDVeT+kPvnx5Tfj0hUcwqaGaozDErCW2HH+MW7vr+taVpNIulD1iKlTVCzE/ucIPj4yA7CU8v9w2FykM1XkvQ7Hkr4dgauGc/abukefMVXKp+MaZxYraq8P+hI/zBLD5itQZZgIS0ZQdSATMqUZS2MCp7Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708689337; c=relaxed/simple; bh=cvHhbH5015GODLP9rzC/0ihNiAUiBPPcD/8uRZNKXRQ=; h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type; b=dV7XyWpgV4w4fgrWTAp8PoFlDQONvgxrXLFaTZNIochwTdX7BGcgRmrL5xYgYN3y/KU8UIdNKZ0dwxexLIYBgfnANF33yN0Oo30rH2DVTCUFypwVn1kJBOY4XliVJ8boVaIqVH4DWfG9mTHOQCojJPBLyk6Vhnl0ht2nNgT09GM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=bLcq86JP; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41NBVjtC003784; Fri, 23 Feb 2024 11:55:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : to : from : subject : content-type : content-transfer-encoding; s=pp1; bh=ZgAbRxJ5InPZt9odwVM5BuYjWb/ovDZ+HPdjW5c9yV4=; b=bLcq86JPHhlnQl/61YZprtkm2+am7buD3eFyinDhrwzabUm6Ye/o3KCR+HPx9kzUR434 VRX094cVk1vH9Zq6H+wGcBa8vgvQM8mjfy63xI8IkAesSZVWace2muiIOvbMgRdpUqPn YOoHPTTZRqxw81/RZ+hr2/9t77nEfpb6IGnm8O8/QEBDZn4X9iFJBC/ZvJxCNhIZmh79 lpjOWeOCta/tYX123A1Ja2TI065UfnAKUAIBDn7cGIG8JvK1W15++RQzddkVHpr5kuy5 5uxrcBBzaYLsGlB03SnLyjGkmnLA85NazAuv0pKP49MZHLAVUb8HtWq1l4Plex/IaxcW LA== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wetjqrky1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Feb 2024 11:55:29 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41NBhJjA009577; Fri, 23 Feb 2024 11:55:28 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3wb84pw3x0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Feb 2024 11:55:28 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41NBtPLm37421476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Feb 2024 11:55:27 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EA7BC58058; Fri, 23 Feb 2024 11:55:24 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7F54B5805B; Fri, 23 Feb 2024 11:55:23 +0000 (GMT) Received: from [9.171.23.236] (unknown [9.171.23.236]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Fri, 23 Feb 2024 11:55:23 +0000 (GMT) Message-ID: <0818a331-cea3-4962-88ad-09bccbd3659d@linux.ibm.com> Date: Fri, 23 Feb 2024 17:25:22 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org From: Vishal Chourasia Subject: Question about DOUBLE_TICK's role alongside EEVDF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 4KNkVefN7YCc6OyWCoabgxtlIyIlN0G3 X-Proofpoint-GUID: 4KNkVefN7YCc6OyWCoabgxtlIyIlN0G3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_15,2024-02-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 bulkscore=0 suspectscore=0 impostorscore=0 adultscore=0 malwarescore=0 mlxscore=0 clxscore=1031 lowpriorityscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402230085 Hi, I hope you're doing well. I've been looking into some recent changes in the scheduler code and would like to get your perspective on a few things. I was examining commit 5e963f2bd465 ("sched/fair: Commit to EEVDF"), which removed the check_preempt_tick method. As a result, the DOUBLE_TICK feature used within the entity_tick function no longer seems to directly influence scheduling decisions. I understand that this feature was designed to handle interactions between periodic ticks and the high-resolution timer (hrtick). Here's my understanding so far (please correct me if there are any inaccuracies): DOUBLE_TICK: Enabled periodic ticks to proceed even when an hrtick timer was active, potentially canceling the hrtick timer in __schedule if active. Commit 5e963f2bd465: Removed a key decision point where DOUBLE_TICK played a role, making its current utility questionable. This brings me to my main question: As we transition towards EEVDF for calculating preemption points(based on entity lag) and the scheduler manages resource allocation in quanta, is there a continued need for the hrtick timer? In the case of multiple processes with different nice values, EEVDF handles their preemption according to their lag. However, the exact behavior depends on the values of base_slice_ns and config_hz. It's possible I don't have all the pieces of the puzzle, so my question might not make sense. But I wanted to bring forth this point. It would be great to know your thoughts. Thank you for your time. -- vishal.c diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 533547e3c90a..73e1372d1a0d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5510,12 +5510,6 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) resched_curr(rq_of(cfs_rq)); return; } - /* - * don't let the period tick interfere with the hrtick preemption - */ - if (!sched_feat(DOUBLE_TICK) && - hrtimer_active(&rq_of(cfs_rq)->hrtick_timer)) - return; #endif }