Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1038250lqd; Thu, 25 Apr 2024 04:29:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWpxYLMnWYxckHhJ7VE+002ZEolH4tXTqwRoHMpQ1kPUqrd9vM+ckTff0P8t84Y6wrLoBzbeHHE0aWuPd+RwpM43fd7XaVoDX0iuWV12Q== X-Google-Smtp-Source: AGHT+IF7FQbAfnGAPa+jOUp4ZgTKetwTjmpzuqlXQWy5ed2Bq+Yw2ZsDVIsUrS78Vkg9P/FZzOeL X-Received: by 2002:a17:907:86aa:b0:a58:a360:9ce4 with SMTP id qa42-20020a17090786aa00b00a58a3609ce4mr2825590ejc.59.1714044560442; Thu, 25 Apr 2024 04:29:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714044560; cv=pass; d=google.com; s=arc-20160816; b=xb5H3MPmMDg5uiypW/W1pmbqYilBvBLxV6blOrxShqfVMt8SGBFKzH2e4rCVfRRdm4 VShsaJNuMMoup+v2qZ9lXS/iDQuYcDQLOvLEMV7aDePH2DPOZPDvmp9X/Rt6YP1ayQl3 UZZiZowQzGgJkGrdktCut0mDWUYjlkR+6FzElz4KEpj4w4szJsLDjdo2bZ/W0XjsPsGt e43jotHOKFUPkHASiePvjvzhyoHk3MlImixKFigC7p89huGRDalk9bbc0ExjWv2Rc6YU F6xAHxcYyLN0Wf1vtUKNJQQ1uyry8jBAOmb7itE6h7B9Oc+LfyoU0cIV9tO43K3MH7Ma L5mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LucgZsZ2fF1q3sR6F54UyCTR1dPpRoPMHDd0YAuRUvo=; fh=hnDHd/um5ZyEX3WCJMhPYA/mgEQL5AJgFKiUuIL9JaY=; b=RwsFO0qBniCtmp3gbTLxdDasDAI66hTP0B5O4J7UBQ4qojU1kgO9oz0gwFRAcv9KLJ uBf+M16fQ+xuM750agQqi6RGJku/qooWxsDVw2N/Q2yMwPN4kC+LofF+M2aI6Xmla17R wCggDTAQ5tYiyqo/xk+dZ/TONMhTmL56t7x7D8lHYRJXIrB0g0rA4VkmDH1eIDq7YjL6 iQj6u5wgRAj7BHQUorKvg9oAUtwMXwUaUGzqnhnZH2OIqzFQDN/bWzBAPu3NbtnCvD4m qt1N0XmQjBnM+n5bEsNvTdFe1fnHQ5vhzcJHQRh95b+lbpX6zhdwUFeEZ4nra9E560xb KaiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=CXQU9aim; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-158443-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158443-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i23-20020a1709063c5700b00a522d16215esi9448326ejg.703.2024.04.25.04.29.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 04:29:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158443-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=CXQU9aim; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-158443-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158443-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 027CE1F22962 for ; Thu, 25 Apr 2024 11:29:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77D6912AAD2; Thu, 25 Apr 2024 11:29:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="CXQU9aim" Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 F324F12AAC4 for ; Thu, 25 Apr 2024 11:29:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714044552; cv=none; b=J1xm6UsoJnRgcFBHIHRTmOMdMv662EHcr4R+3ocHSCE1+KmQdREm39ezNoip2YLfh9MDuLmngzO1SnRZNgPz0V6FE5ZgmTZgqxMvY8HAnKYeEZ9uUXAGOBdXevAbI+g5n4JdZCiEQTKFrmdX7vtVMMv9FTcIweAJEfsntRkqzag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714044552; c=relaxed/simple; bh=EotpqrOTCgxv/fcwPtWq0HslLgdSIeDoKLBq2nO36gA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UlhzTEC6k+/U4nChjrmInThHSwrYIfXv2ZOqi7oC0kgQJkFHh/xD4r3cDCpyr3g1MbkoQv3MaDP2L5L7Zx1pEoX61mxgRI9JnF3NiiJ9+CsbCqv1X1e5qQSYEXQm0Hsu7UUxbXBIi+TVDGbtiMyMHwQFqymLFIHpLbP3iOcY6+I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=CXQU9aim; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LucgZsZ2fF1q3sR6F54UyCTR1dPpRoPMHDd0YAuRUvo=; b=CXQU9aimWDuO+U40QmpbKD9IcQ +Ld66VDCp4qb61vF9gpeawozVsbjOqRLtb/ptV4UE9qVwT8SMdx9e/aBLcgmhsqQAvJXkqZe/bZrW dnS8C1YsWn35J9URgOUA8pH9QjoRG2FpL2AZOtJmWTe1e2XpWZBHToPL8S8CFYHOlbuSvNXC+p/ES tvUT8Be6m+24MXCpAanuRtZ7yji3NBn7/3ObLHGkSyn3/Dz5SViFEKNySIvDaDzw6bFuCudctHMiV S4QS4VbZrW6blMUIBhB7YfCbmcOgYTap/ZtNbBY+AsBe1DSW+6JmeC8Ww9V44UFCZEEXQum2soge1 K+UlOSjw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzxHb-0000000EqUK-2lh6; Thu, 25 Apr 2024 11:28:56 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 51B6D300439; Thu, 25 Apr 2024 13:28:55 +0200 (CEST) Date: Thu, 25 Apr 2024 13:28:55 +0200 From: Peter Zijlstra To: Mike Galbraith Cc: K Prateek Nayak , mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, wuyun.abel@bytedance.com, tglx@linutronix.de, Chen Yu , Oliver Sang Subject: Re: [RFC][PATCH 08/10] sched/fair: Implement delayed dequeue Message-ID: <20240425112855.GF21980@noisy.programming.kicks-ass.net> References: <20240405102754.435410987@infradead.org> <20240405110010.631664251@infradead.org> <557be85d-e1c1-0835-eebd-f76e32456179@amd.com> <14330cf4-8d9e-1e55-7717-653b800e5cee@amd.com> <747627a1414f1f33d0c237f555494149d6937800.camel@gmx.de> <2b9f7617f2b2130bb6270504ec3858f15d463f1d.camel@gmx.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2b9f7617f2b2130bb6270504ec3858f15d463f1d.camel@gmx.de> On Thu, Apr 18, 2024 at 06:24:59PM +0200, Mike Galbraith wrote: > The root cause seems to be doing the delay dequeue business on > exiting tasks. > --- > kernel/sched/fair.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -5374,6 +5374,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, st > update_curr(cfs_rq); > > if (sched_feat(DELAY_DEQUEUE) && sleep && > + !(entity_is_task(se) && (task_of(se)->flags & PF_EXITING)) && > !entity_eligible(cfs_rq, se)) { > if (cfs_rq->next == se) > cfs_rq->next = NULL; So I think this can be easier done in dequeue_task_fair(), where we still know this is a task. Perhaps something like (I'll test later): if (p->flags & PF_EXITING) flags &= ~DEQUEUE_SLEEP; But now I need to go think about the case of removing a cgroup... *urgh*.