Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1584670rbb; Mon, 26 Feb 2024 14:29:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX0DIyf2liKGL4qDWjCKb08+HEHE/PYf9euFkTfC9KMtW5wGZygEi5oDvUQtlgPQ2lqZKCxFTQcFxyWdi2q115FGx1MZKpW6KfT9nEqTg== X-Google-Smtp-Source: AGHT+IEkTWUa9Xg/+3V2ouzUYzZca++7Cj6hPH11wONtkN6T+FZR0+cUFqkem1jqikuw0m02o9Bh X-Received: by 2002:a17:902:e752:b0:1dc:3e49:677d with SMTP id p18-20020a170902e75200b001dc3e49677dmr11003120plf.26.1708986576879; Mon, 26 Feb 2024 14:29:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708986576; cv=pass; d=google.com; s=arc-20160816; b=l5ilWdHx1nJ9+Vmo2gGFX2mR5mJKZTAgQ/xAeUWDZ7BMaD9ae5UZBL4ow1rpz95rf4 Zpyg2qhae4wk0tVEYUYeoXLLcMpaB0nD15xlU+qQu4CkoYQiL8C12qWmLB+6l2tG8u5E GdfrQ6dPSFQ9Y+Wh3+DdV5/C01skvtNWCcaK7fqEvSyt1q58Ie2Y+uIYVghkECmX4XLz S5MqOP9cBub3pLKRjgJF3RQwJehlGfAybKecMVP+B0plxryMz7Enx6aPAJi9pHMbIzgf yN28ngLGrjV0EtzUhIRa9TD6MUCW89SjHUaf1d4yXS9JJDK/vA0YCCruempIXC3okgnO k/Pg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=N/vcZ6pcdKVZi5Z+UKncqylpibfLy4U/GGaLZVaCKeQ=; fh=9Ax9dUTktkw7GUAcxhp/hScrn1H6VeDItxi6qdujZxg=; b=WGxl5Rw7YjrPmWlwwRBhOJkBkzu/QCYEfkSzQhnA6wii8DduBN4zua/IFGfnP73xhB EjZLpZMZO6L6/C8In62VWcIQ8ofkNlPWneZlBBkKTZzGqcZyUVtUA74B6eACgY5P3iBY aLgdaWMKhZRV8i8leZ3OBTV+jiqzwuve0Y4lO4is0fJnWM36kEfE59S/wK4Dfk9SGiAC R/q5idsYWe22g27dhBdBo0nWZifq61SEwY5+ysKjvHmmTHKlmVNOnnRTurqrIibRu3SQ FvxooJhTGvjEo6GI+g/iIvorQjuGfPg/RUvFxDxTYpWpZ6tOVuR1Li+sFI2MEXNoBXeh xxjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dRe72MT4; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-82391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h7-20020a170902f7c700b001dc8fff9114si257355plw.331.2024.02.26.14.29.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 14:29:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dRe72MT4; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-82391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2E82AB22B12 for ; Mon, 26 Feb 2024 22:25:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86BB413399A; Mon, 26 Feb 2024 22:24:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dRe72MT4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tnh3pNDH" 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 D1A111332A3; Mon, 26 Feb 2024 22:24:34 +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=1708986276; cv=none; b=D/YSGW3g3r8YLxf88RpfKvZF74OE6D6a1oviGswf2TQtoivMRKcn8VMm2ZnGLLGY7/v1P3qzuZCxFfbPCzyRcGRiChxbTirrTym8Pd+UEDIGDhB4GQ3kNh08Kst7lCRP3ucYKNtLU6uHo55dorF0PZT89tj5RTqsIlUo44tzDQE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708986276; c=relaxed/simple; bh=MXYuqddvAgScwlDuDC2mLdCth928Zms9L8JCQc6Bm48=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=WKZm4ta7Ykpbx+eL5D6lS5qjVRttaog3bE8m1ACKEYx9ltnpPxQLhnLuJ3eSsIwR1e8r2RoXPqYD4EfyjC9RktdVHHrGv6AEY8qu45s1F2Pd9D0W2t+q1ab2UNE8+eviT1zcd5tOq1fCkXykqGpj9dwigkLx7b4axx9gIhiVOXs= 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=dRe72MT4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=tnh3pNDH; 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 Date: Mon, 26 Feb 2024 22:24:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708986272; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N/vcZ6pcdKVZi5Z+UKncqylpibfLy4U/GGaLZVaCKeQ=; b=dRe72MT4TbthnpZsT4LbqXhC0oFy7foVTfRIcPUR/Ivqg0jF4yRn9rC0PDqJeVeGGm8OTl NeuMxbTsO6YbOhg8+zcpAvhK2hYI5l3fKHPIO/F8EWGoqUVle6j4NQYwIO9wUBE5LBpB2/ q++4SaeI6yN8bR0+zT8fHrsctonBP88puXHSDvl3J/raxPFx6PACb0LAGt2weyyA4qBi/w f9ts3g699NvRrblbC1bA6O0hZwBlH3P94ohwwL9guxmA4u2x1cuCkO4Kd5Pe5bM0llkOCg hRnfXREPgv5W97uL07CDZLAnkvckJy6l3JpvQ/frLY8Zkw5sz6tPr+gquPDlSQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708986272; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N/vcZ6pcdKVZi5Z+UKncqylpibfLy4U/GGaLZVaCKeQ=; b=tnh3pNDHCsiVpauYcDQDFZwBE3pwkRof34M0nZWHoZfrxnwM1Xe6nHYXWigqz3ZEEauDVP GiNh4cwyyFv114Dw== From: "tip-bot2 for Frederic Weisbecker" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] tick: Move got_idle_tick away from common flags Cc: Frederic Weisbecker , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240225225508.11587-12-frederic@kernel.org> References: <20240225225508.11587-12-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170898627211.398.9037031004873986695.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the timers/core branch of tip: Commit-ID: 3ce74f1a8566dbbc9774f85fb0ce781fe290fd32 Gitweb: https://git.kernel.org/tip/3ce74f1a8566dbbc9774f85fb0ce781fe290fd32 Author: Frederic Weisbecker AuthorDate: Sun, 25 Feb 2024 23:55:03 +01:00 Committer: Thomas Gleixner CommitterDate: Mon, 26 Feb 2024 11:37:32 +01:00 tick: Move got_idle_tick away from common flags tick_nohz_idle_got_tick() is called by cpuidle_reflect() within the idle loop with interrupts enabled. This function modifies the struct tick_sched's bitfield "got_idle_tick". However this bitfield is stored within the same mask as other bitfields that can be modified from interrupts. Fortunately so far it looks like the only race that can happen is while writing ->got_idle_tick to 0, an interrupt fires and writes the ->idle_active field to 0. It's then possible that the interrupted write to ->got_idle_tick writes back the old value of ->idle_active back to 1. However if that happens, the worst possible outcome is that the time spent between that interrupt and the upcoming call to tick_nohz_idle_exit() is accounted as idle, which is negligible quantity. Still all the bitfield writes within this struct tick_sched's shadow mask should be IRQ-safe. Therefore move this bitfield out to its own storage to avoid further suprises. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20240225225508.11587-12-frederic@kernel.org --- kernel/time/tick-sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/tick-sched.h b/kernel/time/tick-sched.h index 35808bb..3b555e0 100644 --- a/kernel/time/tick-sched.h +++ b/kernel/time/tick-sched.h @@ -61,7 +61,6 @@ struct tick_sched { unsigned int tick_stopped : 1; unsigned int idle_active : 1; unsigned int do_timer_last : 1; - unsigned int got_idle_tick : 1; /* Tick handling: jiffies stall check */ unsigned int stalled_jiffies; @@ -73,6 +72,7 @@ struct tick_sched { ktime_t next_tick; unsigned long idle_jiffies; ktime_t idle_waketime; + unsigned int got_idle_tick; /* Idle entry */ seqcount_t idle_sleeptime_seq;