From nobody Sat Feb 7 17:55:41 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7F2A33F8B1 for ; Tue, 6 Jan 2026 15:37:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767713862; cv=none; b=s39k2/uY5uYYjUVmcmkZdFWKV4k84vWIDTs9ckuyKAfJXopvoHvjyqe/v4HmcnkJKZ8XiUB4FFNbWRJ0YxT8YC58NhD3kXWVWLdIleclSv5vTwwf55pUSqIPMmN0i8RrGAbUGpfNgfIIu5qDxY3otJh+PqNISSy98BnpNdTK51w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767713862; c=relaxed/simple; bh=YzBx84MudW0UppK4KqKxrbWRhK+huRB8eF4EMfexy64=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sCPJDh8is+hL+HW8EGQji2Pknmcb+Fp7152H4bIV2/xixAiF4j9odnG+dtL5G4FDq4rtbL2OCmHsBFiPXOVXb1BL5o3eutPpmpRrjGvZX8bk3rpIRVb6Uo7l0/KPm+jZNO+hRxgJrMFrFqsT3YMO+xnNIJkwFw2E67p88hzABZo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZnonoK7/; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZnonoK7/" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-47d1d8a49f5so7498235e9.3 for ; Tue, 06 Jan 2026 07:37:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767713859; x=1768318659; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KNWi9pIQ/Ormg0lgFyTWO5tH/iwQOVBGTwX3NUn8zJI=; b=ZnonoK7/3E4EDeZwea79UuB/ptZvYVkZAUR6KCds7Gtha6C0DhVG/guGLuqrw06DTi HbRQg//gCDnkh0jrw7CTvi1dmAo9l101SFTEXxPpURzdDJPMTQJohr9X1km7LpT7STQv NbVxptY6W0MFItx0JQKMtd+UddP6wCXRRJEp7nMG7+iRR9Zfbq7ZIAytEouGG/aUzFdc jub/UEHFFgIkNs+eCQXA36qioIvMA5S83TVrgik2Yd+cMbrGjcNzPNeyUpK35JGYnZ+O qgmUEcdPRPdxJt85C55tHLn39+CL16dYIBEF0TH5/kWLc5cAofKjI0fJcljnnOYTcPAG G8Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767713859; x=1768318659; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KNWi9pIQ/Ormg0lgFyTWO5tH/iwQOVBGTwX3NUn8zJI=; b=vVc0Ae7sHGuh4LLQ+5Le27Si5ejDflLg4eWMj973RUCdGmwfZleYLgxa5PeunmFbrj BpOrOlP2dkno8Fxg/oozO968LZFPkCLDz+BR3vi1RHW3m9yzYgYCzcXepaLjjdW323XZ z56w1Hf+2icl2IDZE4PZJOzCpzMLs7rqledkLqsTKKqombJz92wK/x6gcSMNaid/LRjz +OuCzzjL7G457lORef5Lbp9PrNMa7LSXxxheoEi88Y1RrvupFFcXhPN4VTTNDYnNFCwA 5LD72poX5iwpAXSj6enR4eer8XzGlLdz7ggk98B3m9pbx1RvL4d0HcIRsWVRCLZ87F58 SDlw== X-Gm-Message-State: AOJu0YwAuMf4H56RXFDGJLYrCp5ZBWgmKqk/8Mpl5kpUjQFPIP7PvoSk nQcL62K0OS59HRpYTeLpqQdtTi4Elbbs80lql6A2YhB2JwBFw6LswflP X-Gm-Gg: AY/fxX42b2feYmK4WLI/kF2Nmj9loKJATc2tD+Ngbdtb4ipeaI9ORWpeQqKsAqXwFp+ ON/BMEgaAgihcl2Gt83hEj95vxyoLiUotQLPVxO3SAmc9uxXmWOXPXYlquhIaNOKGi5JNe3EL8K AWbHu9Cmw9FxbUs2oj3A/iWjSerH5n7iQqlZtTcE7xbdKS/GooVHrZMsAf3FR9EfVZvEU00NBgj 34Zd0S8d6o/9Eis6JNv6gGiG83Qhd6jbr6whEzFRf4P2+5XCfOKxXJq6gGUhZ1G35r1jAUHi/t9 BQpYxB/ht+IYqb+Z8hrdRKQZNFvaQ9JJLEJUR4MNlgJx4/fzdV/hEA58CIaeNx1gYM4CUcmK+fc XiIMIKtn/roDuGLq+CGOYbTSCSTCjSNzVSszmXGSvZjs5O/KRKFaHradLxJcKO9Icrw1Mj3oxi+ pJagza65QoNHuClpHqTvSeJ4B6lZQVysss+ejoFd0= X-Google-Smtp-Source: AGHT+IGci2oNkF2CBuJkz3GIeg0suseJa9kIU0te+hfohcFzHAtTBTtmf8ng3GGji6ZSTfSdS4Koyw== X-Received: by 2002:a05:600c:8485:b0:477:a9e:859a with SMTP id 5b1f17b1804b1-47d7f090008mr39204315e9.22.1767713858968; Tue, 06 Jan 2026 07:37:38 -0800 (PST) Received: from ionutnechita-arz2022.local ([2a02:2f0e:ca09:7000:33fc:5cce:3767:6b22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f653c61sm48097395e9.10.2026.01.06.07.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 07:37:38 -0800 (PST) From: "Ionut Nechita (Sunlight Linux)" To: Thomas Gleixner , Frederic Weisbecker , Ingo Molnar , Anna-Maria Behnsen , Ionut Nechita Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/1] tick/nohz: Add fast-path tick stopping for idle isolated cores Date: Tue, 6 Jan 2026 17:36:48 +0200 Message-ID: <20260106153646.23280-4-sunlightlinux@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260106153646.23280-2-sunlightlinux@gmail.com> References: <20260106153646.23280-2-sunlightlinux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ionut Nechita When a CPU is configured as nohz_full and is running the idle task with no tick dependencies, we can skip expensive dependency checks and immediately allow the tick to stop. This significantly reduces timer interrupts on properly isolated cores. The patch adds: 1. Prefetching of dependency structures for better cache locality 2. Fast-path optimization for idle isolated cores with no dependencies This benefits real-time workloads and latency-sensitive applications by minimizing timer interrupt overhead on isolated CPUs. Benchmark results show isolated CPUs can achieve <500 LOC (Local timer) interrupts with this optimization, compared to ~8K without it, with best-case scenarios achieving <125 LOC interrupts on well-configured systems. Signed-off-by: Ionut Nechita --- kernel/time/tick-sched.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index b344fff613546..98391da485e2a 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -384,6 +384,29 @@ static bool can_stop_full_tick(int cpu, struct tick_sc= hed *ts) { lockdep_assert_irqs_disabled(); =20 + /* + * Prefetch dependency structures for better cache locality + */ + prefetch(&tick_dep_mask); + prefetch(&ts->tick_dep_mask); + prefetch(¤t->tick_dep_mask); + prefetch(¤t->signal->tick_dep_mask); + + /* + * Fast path for idle isolated cores: if this is an isolated CPU + * running the idle task with no dependencies, we can skip expensive + * checks and immediately allow tick to stop. This significantly + * reduces timer interrupts on properly isolated cores. + */ + if (tick_nohz_full_cpu(cpu) && + is_idle_task(current) && + !atomic_read(&tick_dep_mask) && + !atomic_read(&ts->tick_dep_mask) && + !atomic_read(¤t->tick_dep_mask) && + !atomic_read(¤t->signal->tick_dep_mask)) { + return true; + } + if (unlikely(!cpu_online(cpu))) return false; =20 --=20 2.52.0