From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 BEA1135EDC9 for ; Mon, 2 Feb 2026 14:02:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770040951; cv=none; b=O08wnejFjjhgVT56v0PN1LZ0dyZr8xwcry+XBN3JrBGsEDv4khN1grh2QTSZOd2oLDeawWBdcp00wuKssZLXCwpWNFFDUiONHI6Qo5Cd3vLYpNY6ii1Opwfc8EfSOpF0I6pk0IkOr1L7GTCaMYh9/bcis9tZKrVo3+WB0YMHytw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770040951; c=relaxed/simple; bh=KN67YReomHhuF2v6ttWfpTpFDvqqwc+2KzkltyW/oSc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=JfbjCEdAhaqhItMFZoNZuaBHUgM1+Ure6rbTwDm8uicBXxCXS/wlRsO797sY66NeMGstMdtJS643P+r6hGkCxjBv17tQtVwDuw7Xcm5ueUFfpRkh4ci6DvQJEwa2QwSpfT3K1NYLatvYG66hINe8JoyA0NItsCLN1lNpfI2guvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WtfNjyLv; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3s+yu8Bo; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WtfNjyLv"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3s+yu8Bo" From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1770040947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xdPgMIfR7/6Q8Lvn2CyoJCe5NyghQW1DDwniAobjiSc=; b=WtfNjyLvqfw/5HuonLwrKJEezA9QpinjrDwklyidy5A+84TI6Vt6tDG7+z1Kv74ESng48b 8F3iyI8zqho1ROs16+KqzFlomtu1BqLr6DDYI2kvKp9Yat5k2EZ//1lHcoZossClCxH+bK XbAS4/wwtEmfKJoh4OxM6cz4FruTfqCVKMGj8bSYNPOJxS5S3OwW/Ykc/CnLTYQ8Fc0yR6 Pr5pcKqr8uiGRKJfeGeaVvQYwkREEE1vg0C3e1GfOBvfkMkTZeCcf4rrPhujqiHge8rsFO XhQh2gbo6InGnYizuFiLEos4J5rKLdKppIqleiytjOMXct0Vx8j6IxjH0YS2IQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1770040947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xdPgMIfR7/6Q8Lvn2CyoJCe5NyghQW1DDwniAobjiSc=; b=3s+yu8BoKfFW2ttsYGdY5Q3zIK90UPhYWOwcg9kQN9/4z5hk1o/2MtGPkhXbpB+Qb2jV7e /1D2e3JjawEur9DA== To: Peter Zijlstra Cc: arnd@arndb.de, anna-maria@linutronix.de, frederic@kernel.org, peterz@infradead.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 v2 3/6] hrtimer,sched: Add fuzzy hrtimer mode for HRTICK In-Reply-To: <20260121162507.757183816@infradead.org> References: <20260121162010.647043073@infradead.org> <20260121162507.757183816@infradead.org> Date: Mon, 02 Feb 2026 15:02:26 +0100 Message-ID: <87ecn3fdl9.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Wed, Jan 21 2026 at 17:20, Peter Zijlstra wrote: > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -928,7 +928,8 @@ void hrtick_start(struct rq *rq, u64 del > static void hrtick_rq_init(struct rq *rq) > { > INIT_CSD(&rq->hrtick_csd, __hrtick_start, rq); > - hrtimer_setup(&rq->hrtick_timer, hrtick, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); > + hrtimer_setup(&rq->hrtick_timer, hrtick, CLOCK_MONOTONIC, > + HRTIMER_MODE_REL_HARD | HRTIMER_MODE_FUZZY); SHouldn't this be HRTIMER_MODE_REL_PINNED_HARD? I know it's set when starting the timer, but I had to double check it. > } > #else /* !CONFIG_SCHED_HRTICK: */ > static inline void hrtick_clear(struct rq *rq) > --- a/kernel/time/hrtimer.c > +++ b/kernel/time/hrtimer.c > @@ -1122,7 +1122,7 @@ static void __remove_hrtimer(struct hrti > * an superfluous call to hrtimer_force_reprogram() on the > * remote cpu later on if the same timer gets enqueued again. > */ > - if (reprogram && timer == cpu_base->next_timer) > + if (!timer->is_fuzzy && reprogram && timer == cpu_base->next_timer) > hrtimer_force_reprogram(cpu_base, 1); > } > > @@ -1269,6 +1269,19 @@ static int __hrtimer_start_range_ns(stru > if (new_base->cpu_base->in_hrtirq) > return 0; > > + if (timer->is_fuzzy) { > + /* > + * XXX fuzzy implies pinned! not sure how to deal with > + * retrigger_next_event() for the !local case. I'd rather say: Fuzzy requires pinned as the lazy reprogramming only works for CPU local timers. > + */ > + WARN_ON_ONCE(!(mode & HRTIMER_MODE_PINNED)); Other than that: Reviewed-by: Thomas Gleixner Thanks, tglx