From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 9DE6A318EC2 for ; Thu, 22 Jan 2026 13:12:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769087568; cv=none; b=jVYY7g1rmo916sm41mHffzdglociYk7wE00SoR26087kaoIlbSY+NkXQC9Vwas1jBtmdHSs7UdyoEjgootSJOyoLVnOJsk9YxJ5ZzcNe1+JiMNOmxM+ROiJ5rYitYY+PMjNou7XKEti9fIkJ4mUf3pQo4NDVxnNpHYvM1dYCzlg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769087568; c=relaxed/simple; bh=WUE81LKCbh75Bk3CMTyPzSifPTyOeNS98AIvDuC7Adw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZUIrI4TQUbO9HsFlVhpxHlaHEskCfW8HPDTn1PDZ+C7Yzs6ofzA30YiOSAuBWg65/ule/ifyLBNLw46R5V+NloB7IH5ePHdPkxBgwyr7UtJytvoCXMn74+R0VdB7+GHKDKuM8myqhBcsqeSru/bZhSSvRP4QhGkUukgGggZ+2XM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=NdzooX8O; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=PJUZ8DlX; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NdzooX8O"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="PJUZ8DlX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769087565; 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=nRrR2ueLk04PGK0thRAJ6Z7uiFrebektt8n3vBB3Oco=; b=NdzooX8OMIQuSTp+7rKAtWaM/BtW7WbqBDVI/ri6sRdGNcBNh/j+68jVQbjVvIpZUY50Tq JmbcQDtSq0UINhQjH0pKSSWnEZLVcTgm9pID1JoCG2L2RX70WevVfVIbyI2iOkmEFh5YX+ /DYTbhyZti44iEvpfyEeTtPBm21W+U8= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-522-g9PruPUpPe62O3iMFrOGCw-1; Thu, 22 Jan 2026 08:12:32 -0500 X-MC-Unique: g9PruPUpPe62O3iMFrOGCw-1 X-Mimecast-MFC-AGG-ID: g9PruPUpPe62O3iMFrOGCw_1769087552 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4801e9e7159so10404975e9.1 for ; Thu, 22 Jan 2026 05:12:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769087551; x=1769692351; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nRrR2ueLk04PGK0thRAJ6Z7uiFrebektt8n3vBB3Oco=; b=PJUZ8DlXyJwf8wfX/VoOFqFYYILCf3B2mtGgy/3sHmEko1nxLcfGmBGwiif4aRnoXU fDgvnBaKRCpqqMBeQBfEdMEEajLjhV0+/eAkmpWc9SIFI0j91Pw7M4z7GVI358/R9BmM TphsjopWfYs+wYN0oDQN0JtGcxf903pnE/TkDaq0WQhSoxkJn6mmaB0uWmpvOuzW/HFS 5KEjcE3eEZ5v8AXSlgTj0NhRqObNOtRVzfZVG55/u3TbvPeQojfMxbraIr56sSbn8JbY C+s6dphT7/P3HnPsFT2kp0KBgOJNaoeQPJRjO/LmYcVoZzJbk2sNwr3xIuEi1UswdSbE c2nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769087551; x=1769692351; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nRrR2ueLk04PGK0thRAJ6Z7uiFrebektt8n3vBB3Oco=; b=YTzj4nYFXqaiZCo2IlycUjoqOryR49FOHI+dqZrxuBih897+9VIaJeBXzEV/HJN6C5 zzii0yZ3y/BMmy+wUHuO0QnFGUSOkhqbNX/LmVMPRlxOWB8hoYNIxrDV9HqKBpeDNPmM 4+rsO6K+FxrxXcxAYIHE0M5PFvCYq9bnUvWU43YzcHS8c8+hyj5ulQ2M2Ac96nMSZFMd I+NHe8BNtbmBeY4jRoVQLE46Oh4Ox66ENjPWzV8EVJEjKCQfE2Ev2HrCk+h4e0yJsUVH CJWqd0mZvzFiUm2f1FPBKvgfhGXG93GptyS0jp2OzHn59Sq2mvvi1Pd4j1DCF7rtZQWx 3ihw== X-Forwarded-Encrypted: i=1; AJvYcCWlus9JuqEiiuZjzTCa+qz/ttOhPD50mXxXd5JSjwQ8quwUCEAIe1VVnBoi9GGKSggy/hnHE8JNaM47u4w=@vger.kernel.org X-Gm-Message-State: AOJu0YyFIBqNiFJdaZgSp7Duldzzykn4KrvthpubXMxsbOi0FS7Hhb46 3arz4mWWVdzRzZJVRxY/+0Askxgug1sGLvDcn4PJ9CpQFIVvYRRYHKyUOjk55GxvYS7fa+QOkdJ a9FlbXw2dvj17dUA9pX24KJu3xpmP+qXSRhfnSXu9ODSDPgt78vl3CEYyW6kzmJZ9+Q== X-Gm-Gg: AZuq6aK6JnigGXRf66TJo7loiQ9RqR4vCA41kKeOrKa5KtIhSjvCEohrAv346UZxonQ oxqAfVCt2LIzdxhHyLn78D+jBTgIe7KzYAPPkCVhehlqiz2n018fdVttbMNdde2/pGjsbgMAfU0 XHVYXvJyP33LedndyA4VsEI8IlAazXjdLfXcdeqJIJ41AKwKZE0SREDm6nFNQePgTBzS0FPhXq4 elxbhsthROUqVZ9X2G4QglzhAo4jGFaiyg/1gk97jEk40kU3PC9dbUJ4zg3imvWB86XykVD98ej TJMGuunMJd1r+mfKw9hcKbL4QH4thQYZX+2MdBj1aG6d7Dw73T80rDknuMkhodzqUXinmgn7Upr kwZHayUF4gZE2s/aO7aT0Eo21FB6oGk1ITKoUU0od X-Received: by 2002:a05:600c:81c5:b0:46e:4e6d:79f4 with SMTP id 5b1f17b1804b1-4803e7a529emr129160395e9.15.1769087551573; Thu, 22 Jan 2026 05:12:31 -0800 (PST) X-Received: by 2002:a05:600c:81c5:b0:46e:4e6d:79f4 with SMTP id 5b1f17b1804b1-4803e7a529emr129159995e9.15.1769087551151; Thu, 22 Jan 2026 05:12:31 -0800 (PST) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.129.40]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435a575c396sm8536913f8f.9.2026.01.22.05.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jan 2026 05:12:30 -0800 (PST) Date: Thu, 22 Jan 2026 14:12:28 +0100 From: Juri Lelli To: Peter Zijlstra Cc: tglx@linutronix.de, arnd@arndb.de, anna-maria@linutronix.de, frederic@kernel.org, luto@kernel.org, mingo@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 Message-ID: References: <20260121162010.647043073@infradead.org> <20260121162507.757183816@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: <20260121162507.757183816@infradead.org> Hello, On 21/01/26 17:20, Peter Zijlstra wrote: > Upon schedule() HRTICK will cancel the current timer, pick the next > task and reprogram the timer. When schedule() consistently triggers > due to blocking conditions instead of the timer, this leads to endless > reprogramming without ever firing. > > Mitigate this with a new hrtimer mode: fuzzy (not really happy with > that name); this mode does two things: Does the more common (lazier :) 'lazy' work better? > > - skip reprogramming the hardware on timer remove; > - skip reprogramming the hardware when the new timer > is after cpu_base->expires_next > > Both things are already possible; > > - removing a remote timer will leave the hardware programmed and > cause a spurious interrupt. > - this remote CPU adding a timer can skip the reprogramming > when the timer's expiration is after the (spurious) expiration. > > This new timer mode simply causes more of this 'fuzzy' behaviour; it > causes a few spurious interrupts, but similarly avoids endlessly > reprogramming the timer. > > This makes the HRTICK match the NO_HRTICK hackbench runs -- the case > where a task never runs until its slice is complete but always goes > sleep early. > > Signed-off-by: Peter Zijlstra (Intel) > --- ... > @@ -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. > + */ > + WARN_ON_ONCE(!(mode & HRTIMER_MODE_PINNED)); Not sure either, but since it's improving things for local already, maybe it's an acceptable first step? Reviewed-by: Juri Lelli Thanks, Juri