From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 24902823DD for ; Fri, 28 Nov 2025 08:25:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764318335; cv=none; b=uygIqjsHlR0ND4ZmRGgNtHRST/yaD0Pc3pZQELKxal3WaXDsv5KPdznyfBrCv5UPrRz/JZwtCy7f4X55l4wOIuIk37i7+tywnl9X/pRGQFNt25vzyhd2ov82MjHH1P/cLlymQ4TCQzsU0d/pcjLnZwsaYN5IzJvJ7TA7UQCnkdk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764318335; c=relaxed/simple; bh=McsraIfa3JQswTD9RwKS7+91NhfjpFqpz3STO/RqprQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D5tQTRnB+3RdhOUFfHR6OGj5BCTSTNeedhD76HcpR9p8wokCcjIm2YDtbpMHHBtTV1+6ojeXIcGOy5YWoJydeBpLib4w1Ro+Q5CHIDsR2rZvKrggkSMWwchPb/bkq0SstUcvU5sao4n0uvY2XAUSds8997lbW2r1KyGlwWXblSQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (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=ec5XAWri; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ec5XAWri" 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=wFA5R9ntYLzo3KqaD/uC9kUd+Lkk6gKB8PEKPYPcdV8=; b=ec5XAWri+OjEeVJuUKvFBGz2pe 0OqIsPjZcytjI0IAdDALFjFgO1CxbZd01rE4XaFnJvw7Q75mhV7jewMZp1NeniF67MB8CRijxWN2/ bCgcpqcDULEAA9EPrzy46JueY5ol9cUvwWtxD3/3goRUUfwjmqN0NzEKTODQa3zorvCAnWiD1Tssz APOPBH2c/zFALhv3iqjSiKA/YaVMTb+5tqse2p/yTg/GU9nzfHEnAtJ+rk5bllfXitdd5ju6hRdjb OqqJwRWB8Uu5ih75PnkFd+cCOH9zqhZ04CIQfX2EqAK6s/B8GU1rn7AQQTI8FzXW+O7ML2uptbqOb hycw6I5A==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vOtn4-0000000CvzO-3VKq; Fri, 28 Nov 2025 08:25:18 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 6FE26300230; Fri, 28 Nov 2025 09:25:17 +0100 (CET) Date: Fri, 28 Nov 2025 09:25:17 +0100 From: Peter Zijlstra To: K Prateek Nayak Cc: tglx@linutronix.de, arnd@arndb.de, anna-maria@linutronix.de, frederic@kernel.org, luto@kernel.org, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, oliver.sang@intel.com Subject: Re: [PATCH 2/8] sched/fair: Limit hrtick work Message-ID: <20251128082517.GA3245006@noisy.programming.kicks-ass.net> References: <20250918075219.091828500@infradead.org> <20250918080205.563385766@infradead.org> 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: On Fri, Sep 19, 2025 at 08:29:09PM +0530, K Prateek Nayak wrote: > Hello Peter, > > On 9/18/2025 1:22 PM, Peter Zijlstra wrote: > > @@ -13119,6 +13119,12 @@ static void task_tick_fair(struct rq *rq > > entity_tick(cfs_rq, se, queued); > > } > > > > + if (queued) { > > + if (!need_resched()) > > + hrtick_start_fair(rq, curr); > > Do we need a hrtick_start_fair() here? Queued tick will always do a > resched_curr_lazy() - if another HRTICK fires before the next tick, > all it'll do is resched_curr_lazy() again and the next opportunity to > resched is either exit to userspace or the periodic tick firing and > promoting that LAZY to a full NEED_RESCHED. I think I had a version where entity_tick() doesn't force need_resched on queue, and in that case the timer, which is wallclock, and update_curr(), which is task_clock, might disagree and we might not have reached the deadline, and so we need to try again.