Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22563075rwd; Fri, 30 Jun 2023 09:30:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/qbQ3gWRTEtjFIYo3nRANeMVG55OiPvLvuK/xJg+B1rsSadPCgu5wRuANNdG9jfaNX8eD X-Received: by 2002:a05:6808:11ce:b0:3a3:7e62:fca2 with SMTP id p14-20020a05680811ce00b003a37e62fca2mr3323185oiv.0.1688142619801; Fri, 30 Jun 2023 09:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688142619; cv=none; d=google.com; s=arc-20160816; b=FK3OGA/r24yGZPLF5f/VexuaNbVd2JXpjD2DVABo9d0wLbIxt+WToXleIcRQtgc+01 uQQL6gjmy/4YYepIzpoaIQWJo0GDK5/bcz3dC+q1aGMEFYI9FLivxnVOo9CQq6ysdJuw AryaE7abGqDj3ME5Zul6bwpVPUB2C11fMCBJas2m76jgVWkieJfRCHmmdn9+zwYnA9H4 bMUXV0A/otCFWt/NCm5qmzTue2sVCidVnS8mMc1YQhgzKMp0s4Thea1E90/p8CK2pg68 CNH3EuPRw+hxbq/u66DtU4FhlEWzq3wQNSmNAPiMe5jp2HxOJ1Rs7vwxbupX/RcuUAz0 j8Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=newNkzFEJllKnCBciXY0VHCy4kHIzTBuLOvHfxzKinM=; fh=BViwvfI3hPQQocLi7+kLTiPHFnazRdk/2LNltQpnJw0=; b=zbX8q+zNywMAjxZhFRZdypnkQoGRaDltnxvpIWEtuiwMiOgmj53qVctfV1Dm3Q39yl hjmxvW2xTMdPK9k6TbpvexNhWqVOeC+IpEiD3yzWJDmNj2Hf8YtgBt0lxi7j8N6gzrNo bEwHpN5kyuoijDpypJk81uytffCt1PXwOXG11IpdLArDivmrcGiGSCz+WPijkw0k5cma 7hc/lQ9ApvV/4t20Bhx7CGtNgrgPbM2aWS1QqzmXK8R/AIXIwwCB1elkLgVi6XZlf1+R CCqaXqSEApP/fii5pwiZQheycrn5ryS0eN2iHPWm+hSyH1RNrjyKyTo0O6AyFv6fqfvf 7PlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=pkqQOggU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020a655087000000b005538ee20ecbsi12644706pgp.355.2023.06.30.09.30.06; Fri, 30 Jun 2023 09:30:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=pkqQOggU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232827AbjF3QF6 (ORCPT + 99 others); Fri, 30 Jun 2023 12:05:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230388AbjF3QF5 (ORCPT ); Fri, 30 Jun 2023 12:05:57 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DB70A9 for ; Fri, 30 Jun 2023 09:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=newNkzFEJllKnCBciXY0VHCy4kHIzTBuLOvHfxzKinM=; b=pkqQOggUhgvgXuDJ1UwGQ3uNAf u6cBJDoIo+iGE3e8Xa9sZ4Z0ulMPovK2BqxqCQUI+xI+5E96oJj5upoq71Kz7FC3N/DfNVx6Lui+B Sr3uwyErKaRHjT98US1DX0entxMAqDZ02UMZHd7wtMZiq/ikeCeJ0HR5pAGEu0M5eVzurS5sRLUwu 0D0z+fLouH45PLNcpSxmvRWoR1ZB57eNxlE+IbNYvHcXKDOYm3Mn5IlRsvxzrGXCiLquF1PirOPIl Q948Jsa8l8QiG0C/dWTpb8sevwRNkFwgJ2gnoQ9xRRe59EOqNOA6mmxpj6JGJ4lm4OkbLadMCtLfY zdVuxpdw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qFGcp-005pZw-7M; Fri, 30 Jun 2023 16:05:35 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5C1C03002D9; Fri, 30 Jun 2023 18:05:34 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 478152C2A6C41; Fri, 30 Jun 2023 18:05:34 +0200 (CEST) Date: Fri, 30 Jun 2023 18:05:34 +0200 From: Peter Zijlstra To: Phil Auld Cc: linux-kernel@vger.kernel.org, Juri Lelli , Ingo Molnar , Daniel Bristot de Oliveira , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Ben Segall , Steven Rostedt , Mel Gorman , Frederic Weisbecker Subject: Re: [PATCH v4] Sched/fair: Block nohz tick_stop when cfs bandwidth in use Message-ID: <20230630160534.GA2534344@hirez.programming.kicks-ass.net> References: <20230630135714.1018434-1-pauld@redhat.com> <20230630150641.GH2533791@hirez.programming.kicks-ass.net> <20230630152824.GC43299@lorien.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230630152824.GC43299@lorien.usersys.redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 30, 2023 at 11:28:24AM -0400, Phil Auld wrote: > No. Or at least not without plumbing the enqueued/dequeued task all the way > through. I can do it that way if you prefer but that seemed a lot more > intrusive. When we are in sched_can_stop_tick() we don't have access to the > cfs task which will end up running. Curr is idle in that case. We'd have to > essential run pick_next_task_fair() to find the task to check which seemed > wrong. Maybe there is a better way? Ah, you worry about where we have two runnable tasks, one is bandwidth constrained the other is not. One task goes away, how can we tell what the remaining task is? This is never a concern for add_nr_running(), the only case there is 0->1 and then only the hierarchy you just walked for enqueue is relevant. But if you remove the unconstrained task, sub_nr_running() can't tell what the remaining task is. Unless, of course, you have enqueue() set a bit somewhere in task_struct::sched_bw_constrained:1. Then pick and your should_stop thing can look at that, no?