From nobody Mon Nov 25 09:31:40 2024 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 8D0BA191478 for ; Mon, 28 Oct 2024 07:36:06 +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=1730100968; cv=none; b=N6r6XckqNEJSdecKcCgu+KY/FWcjmqaqiwk+/o2xh5pT+A13LQKUCfp4ONTC8QgnLWl2PmVAP/ZdSfxksg2pkdtxRizkuiLlcyskqM3GiuN3k9zLuPOryiTb3CvCaPm0SBbFHaozCPFDJdTzFRmZW4R0J/Yu/zB/i7hYVdGWcNI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100968; c=relaxed/simple; bh=EU8Ie+iT6Fk2gRwcRiV/wdZUAioy6FnNy/roxslGrIw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e0USgItvczq6CHoEPmeJt8McPjVnsFflgD5ZCrPEi4G5qz1Ol2Zc/n1gQ3ymYHA0YZ1r2gwyj3yCBXXt+y0eCr11Rlxfrjk2dV9WveQ7N69eWmMpvsuMXBMzFW0jw2gmSrc9Y9tIWZThKBu1iE1m9RSLOd56mcopZMdDGN9hnO4= 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=yi09C2yQ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=jjFeP1Kp; 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="yi09C2yQ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jjFeP1Kp" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pjCSSJ0vW46ZiT80KY9Uct7w1SEE5WswuvQfmiuIeMo=; b=yi09C2yQivqtvxoJFS+h8cetE5T8Hlkw2YDVh/3LI0b7kBN9nOkxJkH7OWvf6OXwXr0Mrt oLBtr3dNSzBWSySw0QQ9QMm/Oq7OAX8Wv6gyGKBxIv2K9NKERgX9TxJP7fvtbpHD14EcNd Orc14KoVqpxrpVw100t7HvjxY7agJ0evOhd/YnwyAtV3crvUpzSEyuR+/4pdTF4Ofx3jjS ud6TI9CAKmZ5EwHP652CTsLQalZqz7jUK96tSB8r01SG/PIMMmnJ7WOBRqwKmxAZ3Teuzu 1aGNU0/plnT8QjvabafIu2ES7J8+jiu+KCIYySP4dVSeQD0fVi16eOyp4RZJgw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pjCSSJ0vW46ZiT80KY9Uct7w1SEE5WswuvQfmiuIeMo=; b=jjFeP1KpMzfXGaVfODOUsVXe+iVX9F+XURlteqzlwpTO3hFm9Ii09JlMmXRiI4q9hY03rb Jy15R6H8xbgHjrAQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH 01/12] hrtimers: Delete hrtimer_init() Date: Mon, 28 Oct 2024 08:35:45 +0100 Message-Id: <7bde2762d82d30dab184c7a747e76afc41208da0.1729865740.git.namcao@linutronix.de> In-Reply-To: References: 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" hrtimer_init() is unused. Delete it. Signed-off-by: Nam Cao --- include/linux/hrtimer.h | 2 -- include/linux/hrtimer_types.h | 2 +- kernel/time/hrtimer.c | 20 -------------------- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 7ef5f7ef31a9..47103a0f6691 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -226,8 +226,6 @@ static inline void hrtimer_cancel_wait_running(struct h= rtimer *timer) /* Exported timer functions: */ =20 /* Initialize timers: */ -extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock, - enum hrtimer_mode mode); extern void hrtimer_setup(struct hrtimer *timer, enum hrtimer_restart (*fu= nction)(struct hrtimer *), clockid_t clock_id, enum hrtimer_mode mode); extern void hrtimer_setup_on_stack(struct hrtimer *timer, diff --git a/include/linux/hrtimer_types.h b/include/linux/hrtimer_types.h index ad66a3081735..7c5b27daa89d 100644 --- a/include/linux/hrtimer_types.h +++ b/include/linux/hrtimer_types.h @@ -34,7 +34,7 @@ enum hrtimer_restart { * @is_hard: Set if hrtimer will be expired in hard interrupt context * even on RT. * - * The hrtimer structure must be initialized by hrtimer_init() + * The hrtimer structure must be initialized by hrtimer_setup() */ struct hrtimer { struct timerqueue_node node; diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 55e9ffbcd49a..60cb805a6b0b 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1588,26 +1588,6 @@ static void __hrtimer_setup(struct hrtimer *timer, timer->function =3D function; } =20 -/** - * hrtimer_init - initialize a timer to the given clock - * @timer: the timer to be initialized - * @clock_id: the clock to be used - * @mode: The modes which are relevant for initialization: - * HRTIMER_MODE_ABS, HRTIMER_MODE_REL, HRTIMER_MODE_ABS_SOFT, - * HRTIMER_MODE_REL_SOFT - * - * The PINNED variants of the above can be handed in, - * but the PINNED bit is ignored as pinning happens - * when the hrtimer is started - */ -void hrtimer_init(struct hrtimer *timer, clockid_t clock_id, - enum hrtimer_mode mode) -{ - debug_init(timer, clock_id, mode); - __hrtimer_init(timer, clock_id, mode); -} -EXPORT_SYMBOL_GPL(hrtimer_init); - /** * hrtimer_setup - initialize a timer to the given clock * @timer: the timer to be initialized --=20 2.39.5 From nobody Mon Nov 25 09:31:40 2024 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 98C22191F85 for ; Mon, 28 Oct 2024 07:36:06 +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=1730100968; cv=none; b=rTqea4upbdDSsMqRldyuQz8GbbewCsclIEYEaCMRF88eJpsQFNedqSqKla6pDT/QgytV4Sm+MYiM+DjZAbYIv/tHZvarqyjzEptP5pmBrIT0t15Tf6ecz1QP9fkb71GPV64XuonbOwe6Gda+KiJ/nMizb/csDTSFIRxwPPbJ0Ds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100968; c=relaxed/simple; bh=TpOh9ROK/VSlXafyqKtyrVdbtpvuGB2IkT5/hojl8Y0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dNsy/ErNCSUj7jvcHax6848kiq0aIhcoDaitJ+5+Pvk90hLiVJVgYyIs//4+uQBETRDPSvJQvmvVoE/XADwR1WA+M93/9YqihJZw5S9Bg0a0iAubmuSAvCIPf1+zk9Hwed/jooUpK/4Jd1tksB8zRsCSWQYYWHpW8dQBZnZFxAw= 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=cUi8TyMq; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=6jwxBGTZ; 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="cUi8TyMq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="6jwxBGTZ" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QydA6VPhoUGgQIOxZVkz7av1esb3qdpjPoxkLWDvXyw=; b=cUi8TyMqpQ241YQqy39nXjLnjI9k8v20oLOoPeevII+NnnZ1Poz0pTz+iQ6s1DpdmdnypV rwoDd1kzhXhVSLYivIQ5ieCFU/++eG8ignMPPgVfjDY7i3Bv56NLGrkdpssv4A7rFGv24X QtZyI04iacBGi8omuQ30jGr+jtX8jiZ5Q5K7W2NJWOKE4Sy6KyqeJugoyaApFXqEdN0ePP ZgISrTSWqiZ4ZY34N+Fuhun59zQzGpv0Ky26qfHRVYgiywzfLKYm0hmDVDOZigMvELpbeh h9XJ21115IyOrU7kFnUwZlbfpac9ePTbQX/kNnXZ/I/mbBi24fEwpyhUjTxOeg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QydA6VPhoUGgQIOxZVkz7av1esb3qdpjPoxkLWDvXyw=; b=6jwxBGTZO5Pojb8OciVgm7Y+5fpYlMHcQBc88hyqUhA8N3y/10B0lOLIYW2HOzf330MpAT lgvH6YQxL/qU/6AQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH 02/12] hrtimers: Switch to use __htimer_setup() Date: Mon, 28 Oct 2024 08:35:46 +0100 Message-Id: In-Reply-To: References: 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" __hrtimer_init_sleeper() calls __hrtimer_init() and also setups the callback function. But there is already __hrtimer_setup() which does both actions. Switch to use __hrtimer_setup() to simplify the code. Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 60cb805a6b0b..45225fdf7cd2 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -2009,8 +2009,7 @@ static void __hrtimer_init_sleeper(struct hrtimer_sle= eper *sl, mode |=3D HRTIMER_MODE_HARD; } =20 - __hrtimer_init(&sl->timer, clock_id, mode); - sl->timer.function =3D hrtimer_wakeup; + __hrtimer_setup(&sl->timer, hrtimer_wakeup, clock_id, mode); sl->task =3D current; } =20 --=20 2.39.5 From nobody Mon Nov 25 09:31:40 2024 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 4792D190660 for ; Mon, 28 Oct 2024 07:36:07 +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=1730100969; cv=none; b=dYQJ9sKiZZBTawoQKwLVy/QhjFK+7vIvYvIZO5aDf6GHyK0icCI36oVGAo5qHDZGr8MHFqkPTHtDD+CPRbZYX4yPx6BirmFvEPxYzX+3eQkyf7llAIhpQV8KOFVxDeWBo7RKb6a6iAvOJrW0jXWwedd65JUZ0zhT3N53slGoJt8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100969; c=relaxed/simple; bh=KikKFLZqaa9ycKVeV+0nyckQjJ6PXSzbyoR+NC//ZcA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WbX4zMaTv2oaKK3nENhTwFP1/Mm4rt0ZXmXfUbX666MS0w5mLDaQiltQ4UCbCGsPLJRLxg80wwWdq8l5Y0BUB+DlIKcFSm6lGMeoWoL5BRZZMwW1aHTg7o+GmarEF9xwWOfVRa0e9v3xDXd3s2RbZwKaSQgk2KXMMFQppnuA0S8= 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=34/XkFd+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=E8pJhW/U; 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="34/XkFd+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="E8pJhW/U" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=87KJS+Yd7dmWBG2TJWh52GT7rKaHpnvi/1NPPdJ2+sQ=; b=34/XkFd+BH4tScQhAkmEf89QYaQ5lWvQ3PPKfTj4EH361c05IPeiW9kOHtxxLCmxabPd8J sUWjjH2VxzVEWQw+ciPkRcYgDMJgBeBeaJSAXcFdpi7VAbpeXGVi1+w5djcsLYan7IpsuH ThXCdW3iRESbOb6/Z8MMVsnYeoo/zxeFbyzrsmAhBGqtOI2z9vnkU8JatixnSgyz38+tLR 7O1g1bGkLt4qtFX74CW1D3dDgmuRi9fYN+hcqj/ddmgRiNJAjAtfiIQNRbk8n2KW8qkrcn l7WgHst0kQz4guXSN/R2h05zz1xfz0zpKUuV9x5Eb3UFXsUTIUm5GpGwguU/XA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=87KJS+Yd7dmWBG2TJWh52GT7rKaHpnvi/1NPPdJ2+sQ=; b=E8pJhW/UzdYpXY1vwk17DZgCAcEv+b+uySvE1Qfy8wGAq149sYQEcUs0PD/VAOdQAFAjxc l4zenc9fRTlZuiAw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH 03/12] hrtimers: Merge __hrtimer_init() into __hrtimer_setup() Date: Mon, 28 Oct 2024 08:35:47 +0100 Message-Id: In-Reply-To: References: 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" __hrtimer_init() is only called by __hrtimer_setup(), therefore simplify by merging __hrtimer_init()'s code into __hrtimer_setup(). Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 45225fdf7cd2..cf362d93a323 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1540,8 +1540,9 @@ static enum hrtimer_restart hrtimer_dummy_timeout(str= uct hrtimer *unused) return HRTIMER_NORESTART; } =20 -static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id, - enum hrtimer_mode mode) +static void __hrtimer_setup(struct hrtimer *timer, + enum hrtimer_restart (*function)(struct hrtimer *), + clockid_t clock_id, enum hrtimer_mode mode) { bool softtimer =3D !!(mode & HRTIMER_MODE_SOFT); struct hrtimer_cpu_base *cpu_base; @@ -1574,13 +1575,6 @@ static void __hrtimer_init(struct hrtimer *timer, cl= ockid_t clock_id, timer->is_hard =3D !!(mode & HRTIMER_MODE_HARD); timer->base =3D &cpu_base->clock_base[base]; timerqueue_init(&timer->node); -} - -static void __hrtimer_setup(struct hrtimer *timer, - enum hrtimer_restart (*function)(struct hrtimer *), - clockid_t clock_id, enum hrtimer_mode mode) -{ - __hrtimer_init(timer, clock_id, mode); =20 if (WARN_ON_ONCE(!function)) timer->function =3D hrtimer_dummy_timeout; --=20 2.39.5 From nobody Mon Nov 25 09:31:40 2024 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 882B6191F94 for ; Mon, 28 Oct 2024 07:36:07 +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=1730100969; cv=none; b=Van6fwxJXhIF7uDxqIsJcCA1iBAsWUbBaQM0iNhsos4OzmSIYFUZibKB1pobHwr3GJj7pxgQqkO3hyJkr+6kyxge0LsHn3HwOsh2t2OIqUOKwikBb0MmdAY0t30XEIzgrRbFc7oLgvBBHfPEtkxhGd2NlK4p3HLAYhc8In83a6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100969; c=relaxed/simple; bh=OjHzWioM8hIrXm1v3A44UMPocRE/3JNbbpKfV+RGQns=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jA+8CdB/RCq0IzRMcO8Zzpq/cPBGJ32uCITcn0LE7/aEWTIkO4/uX5zogjnOqPYDwyWNDM5qm8s0UlbNRyygMn7J8fKDLJGjc8ocLlZXb06Oe42lBYFtSyyoLyWBebOZjXmw3YCESuMKGYp0sEKRqXWx8k/g2xy5wrn8BhXmZUc= 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=MUF6CDIs; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=eTVcrcct; 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="MUF6CDIs"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="eTVcrcct" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yki5e5oO4izSs6rd2/tDNyuThhIlQsX5cTWT4NrlmH8=; b=MUF6CDIsBsg4CWz9OLJXgAA77P7kVQxl2fugjwQW08t5r01+tZovuvZ6Kt7RCc/9HyzRls DG7a1LPqYfkzl2TyrRCNIUc6l2kScVC7p/TAVyYUd9tZw6FVokajsLNKOrnwKhLgb0ouBt N2nvgacymq6ZhCVWHyy0AUFNJNjOoSiY4+N7c6zZa/RPZu04B9PBkQXOlH6CcnJIJlMjSv 4h1uRoJBe3ylpInmsL65NSmXDU/wOq9rMkDL/qRj55RdO0ijLCO/Rqtbg8MeK5sgL2llH0 KG6PLJf2Ngw7JWpBZ53zmoO8x/bV4xvnSHjJoVHhQstRu8AnEU6rJNo3AskGRA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yki5e5oO4izSs6rd2/tDNyuThhIlQsX5cTWT4NrlmH8=; b=eTVcrcctnpn12jTcZJV7BVFSZ6qHeLrint9d3KbBoFbsTsD8y6AO2DjHNbgg6ArLxOJXIB Edd0QDUOj/BbE6Dg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao , Greg Kroah-Hartman Subject: [PATCH 04/12] serial: xilinx_uartps: Use helper function hrtimer_update_function() Date: Mon, 28 Oct 2024 08:35:48 +0100 Message-Id: <54e35633347affb842c064dcad8d4b654bb112c6.1729865740.git.namcao@linutronix.de> In-Reply-To: References: 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" There is a new helper function hrtimer_update_function() to change the hrtimer's callback function, which also performs additional runtime check that it is safe to change the callback. Use the helper function instead of accessing 'function' directly. Signed-off-by: Nam Cao --- Cc: Greg Kroah-Hartman --- drivers/tty/serial/xilinx_uartps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx= _uartps.c index 4e9a63590c82..680db4830ab5 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -454,7 +454,7 @@ static void cdns_uart_handle_tx(void *dev_id) =20 if (cdns_uart->port->rs485.flags & SER_RS485_ENABLED && (kfifo_is_empty(&tport->xmit_fifo) || uart_tx_stopped(port))) { - cdns_uart->tx_timer.function =3D &cdns_rs485_rx_callback; + hrtimer_update_function(&cdns_uart->tx_timer, cdns_rs485_rx_callback); hrtimer_start(&cdns_uart->tx_timer, ns_to_ktime(cdns_calc_after_tx_delay(cdns_uart)), HRTIMER_MODE_RE= L); } @@ -734,7 +734,7 @@ static void cdns_uart_start_tx(struct uart_port *port) =20 if (cdns_uart->port->rs485.flags & SER_RS485_ENABLED) { if (!cdns_uart->rs485_tx_started) { - cdns_uart->tx_timer.function =3D &cdns_rs485_tx_callback; + hrtimer_update_function(&cdns_uart->tx_timer, cdns_rs485_tx_callback); cdns_rs485_tx_setup(cdns_uart); return hrtimer_start(&cdns_uart->tx_timer, ms_to_ktime(port->rs485.delay_rts_before_send), --=20 2.39.5 From nobody Mon Nov 25 09:31:40 2024 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 5FC5D206072 for ; Mon, 28 Oct 2024 07:36:09 +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=1730100971; cv=none; b=g8RmX1doV5RH2p3tlR8vwKrS1C2djdamuZG/MLldEkQ5REutDuX1tJyM8NE/DDaew/2iCqHSTQGTC24p9Q9LZcLSsHr6pRp74QnbIlq32xok53g0wvWynP+RbqVyzGzcq3wJFmF9kZi8ix0uUKt9oTcpqRz9E7zrGaE8takY94Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100971; c=relaxed/simple; bh=2UDRB+DB72XW631dGsLP3idfcAnZcDJ9QRhr4KgfRuw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qstt2JXgA64E8MZ6ATDhGcUI92tSOrbQF5cN1/14kfkqmZmFxCVF+TikI12aS8B3xVCDyE7QMFGLzRJj5fHyqEeN7NqUCN/Oe3rQ0+1ZFFNgiUoR2oeW6byGlzv2xGfDYWnqDEooOaW3rUUUbEOp1hL/z7WJGzjCYGo1LnYP/jw= 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=z0gOLLNG; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=R3EULiDO; 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="z0gOLLNG"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="R3EULiDO" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=brGIOxwdxz5vA8K9AE1BJ5tkwgKwUCSeWC3lJ3ltj+I=; b=z0gOLLNG8Y/izECVEioQM8ciRDxFkcZGpXgnmGcnqjEI9TnDySk9Vzx7q969RdpzIzXDIn Dy11j+yry6T1jBmul+ahriWKKC5suwI7XElvar2WR1ZbVyX2kk3L37ehTywq+Vl4tJjpKx 0t/xSSqFKBQBdF2ZD9pitCJxhb2tGBI6seFLsrCg6gedOYTei8MzlIIT+EbyzVC1tzaYLq NHyNYNhTBwVdRD5Yj1lOUC6LuotzJ41M8uWw/QNxvFXMTZUN7JoykpJtSywRHov+FU1Iqi YdHLG/UVwNrmTZEdz/nfU0SJOWh+cmODarrGg4UHjyQ61DVGOwhkwjV9ie46nw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=brGIOxwdxz5vA8K9AE1BJ5tkwgKwUCSeWC3lJ3ltj+I=; b=R3EULiDO79A8I0AHQawIvGmecD9CpOS0BTjrIfxbNySHg5/1IsLCTCy7NhX8FbRLNgq70p G/S5HGZmraGVfOBw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao , Jens Axboe Subject: [PATCH 05/12] io_uring: Use helper function hrtimer_update_function() Date: Mon, 28 Oct 2024 08:35:49 +0100 Message-Id: In-Reply-To: References: 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" There is a new helper function hrtimer_update_function() to change the hrtimer's callback function, which also performs additional runtime check that it is safe to change the callback. Use the helper function instead of accessing 'function' directly. Signed-off-by: Nam Cao --- Cc: Jens Axboe --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 0842aa3f60e7..5a3c2d647467 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2423,7 +2423,7 @@ static enum hrtimer_restart io_cqring_min_timer_wakeu= p(struct hrtimer *timer) goto out_wake; } =20 - iowq->t.function =3D io_cqring_timer_wakeup; + hrtimer_update_function(&iowq->t, io_cqring_timer_wakeup); hrtimer_set_expires(timer, iowq->timeout); return HRTIMER_RESTART; out_wake: --=20 2.39.5 From nobody Mon Nov 25 09:31:40 2024 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 5DEF1206070 for ; Mon, 28 Oct 2024 07:36:09 +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=1730100971; cv=none; b=jiWAxPD4kB4LgQXfr44jeQPPs3bOvryFIK3umRx4Rgr37BxbuIAjVdGkuZYHQSkidUQv0cFo0zRyit/ELWC3SNG/7hqxx20Z9BhjJV3w5ZnYnpn9KiVuvJ38HBYycd4vBxsyR4RPRhJ0wybY2kwnzXiFLSe6fpN95HeBKR9S/z0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100971; c=relaxed/simple; bh=HjA99v1D7iWoKew86XFKmAvQUs9tcncD5FJUQn1bXkU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WIfaCuWizkJCDB8iA53h2DcmjtCL1IUMKYjuKE+5G9beBVK7TfSB44kCgTeejZzGhGZq6WwcdU5jGiTY1CvNo9xf0PulRQkB5VBGtTGw3lD8XC6S57xP0zJ5Z/yl+k7U5e4tfCd4pbtxXo/8BpMvrUqYCeB4asF+NSV8+ml3vCs= 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=s2HyZhgd; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=7r0Bouez; 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="s2HyZhgd"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7r0Bouez" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=71d+7ald+cjcmP7u1NI10JhUTRb/W3I8OffII+X4pAU=; b=s2HyZhgdw6GHqFOJQ+7IFGotV3328XI4gqeFWNr2Fi+IXBR5KM6DEzW+rb79wPGl6xKfo+ BWatmSvTipMz22X96FdQgKyNmLjRC/MAZW1mp0JXuAkv/wdv+AlIOfEPD7woSEi5GbpcUC mRB79QwNTncjugDft2U9CqKOuWxpz4vtnUadBA8NNSY8tUn6Q85U5nWzA+w271phoKI1aN U5N3f0ZNfVrkNMm6BRJSaFy9QRfujnafp+7X7a7kSFM50ryMqIIt+SBZApZWZYmZDdbedk 4W716e+GcotXrl3CKu0CbpnvzzbnHZmTAQpDeSSB9nRGO69o1gdk1AGTocoplA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=71d+7ald+cjcmP7u1NI10JhUTRb/W3I8OffII+X4pAU=; b=7r0BouezZVScrWutcMVhVP5A0wttZ4loesMi0fo/kubotR3w9dD/xzJzCNEuyNsFX6lJCw +81xRerFgHEHwSCg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao , Kalle Valo Subject: [PATCH 06/12] wifi: rt2x00: Switch to use hrtimer_update_function() Date: Mon, 28 Oct 2024 08:35:50 +0100 Message-Id: <3dc739e1317de4a63223dd89ce7734bc2bd1ed57.1729865740.git.namcao@linutronix.de> In-Reply-To: References: 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" There is a new helper function hrtimer_update_function() to change the hrtimer's callback function, which also performs additional runtime check that it is safe to change the callback. Use the helper function instead of accessing 'function' directly. Signed-off-by: Nam Cao --- Cc: Kalle Valo --- drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c b/drivers/net/= wireless/ralink/rt2x00/rt2800mmio.c index 5323acff962a..45775ecdf221 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c @@ -842,7 +842,7 @@ int rt2800mmio_probe_hw(struct rt2x00_dev *rt2x00dev) /* * Set txstatus timer function. */ - rt2x00dev->txstatus_timer.function =3D rt2800mmio_tx_sta_fifo_timeout; + hrtimer_update_function(&rt2x00dev->txstatus_timer, rt2800mmio_tx_sta_fif= o_timeout); =20 /* * Overwrite TX done handler diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c b/drivers/net/w= ireless/ralink/rt2x00/rt2800usb.c index 160bef79acdb..b51a23300ba2 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c @@ -618,7 +618,7 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00= dev) /* * Set txstatus timer function. */ - rt2x00dev->txstatus_timer.function =3D rt2800usb_tx_sta_fifo_timeout; + hrtimer_update_function(&rt2x00dev->txstatus_timer, rt2800usb_tx_sta_fifo= _timeout); =20 /* * Overwrite TX done handler --=20 2.39.5 From nobody Mon Nov 25 09:31:40 2024 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 B973C20607F for ; Mon, 28 Oct 2024 07:36:09 +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=1730100972; cv=none; b=kvZTKBicrnVcnWyx/N1XvRERK5EK44uDH9EqYGgPiLvByeXLztroLQK/nwSpYBU4aWUwLv6XbWFgDCilyQ/GxtmTjrDQ5wDfP5Se9ATYbJJiRH6KTrIHelzsb0Ir9t3wBUek6ZKcHV2LaWNO/AMIPvJhwFl6npSeJXKeszDvUEo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100972; c=relaxed/simple; bh=qgjhrQFGyujCPiQZ0OXqoKSFTsi7AT39xDf2eeX+7Ok=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ntVNVXUVZ8cYKVyuSXUcixixi4KHTeXJqbKSNGMPtfTKx7mhCzqsAnv7JeWpE5bPYl6N703mzVIXYDFtRmoQUrssKG8Dzt4JXo6ruaThOpT0Hg+REOKlbNW+q51O7Q7YaoxKslPlmZS3dbGnDMliUY2ObPXaDx7Nhkn/HN+Jhlw= 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=VSLg3EbU; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=4t3uLEXo; 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="VSLg3EbU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4t3uLEXo" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kOhHjfDyZHiacjP/QNpCtVG3O7BwOGaKuYJ+lfkMK/8=; b=VSLg3EbUDiCfAIX6+s4IjRlGrYbGK4OGSq2v7xUbVapV+E3YdZ+uXudvqcDxaxJLzQwTYQ NObRMBpbZpQRcNyWmvZ758fjzTbohH71K08FKxB0rvjkfkugpHiKQUoibpw44dLVE9ivYP 5/a6FnKb/bVJpImkBLPRSckSNyxVLIyQxYIg0kHWqX1/zQV2gcalf0HO7pTw4Sn7hUrQ7v uu/Uu2MXDKYfgSQdygauknsfz0rOv4jsli6YC0kblGbS3wU4WWzfiM0+W1q8yXDyQmhALT MVMobrLebZCSo7TwAGwKeLL5+h783il2nJ+lQ0G4CLmJlRj/w+PW9iBKnQ1ODA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kOhHjfDyZHiacjP/QNpCtVG3O7BwOGaKuYJ+lfkMK/8=; b=4t3uLEXor7FG+a8TOFhf1O6BfCRnysO9EKJ0w5U18Y+5/tzu0sA9XPOwRB1liRHlUNDt0x jYY7/TWwHg5i0yCA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao , Steven Rostedt Subject: [PATCH 07/12] hrtimers: Make callback function pointer private Date: Mon, 28 Oct 2024 08:35:51 +0100 Message-Id: In-Reply-To: References: 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" Make the field 'function' of struct hrtimer private, to prevent users from changing this field in an unsafe way. hrtimer_update_function() should be used if the callback function needs to be changed. Signed-off-by: Nam Cao --- Cc: Steven Rostedt --- include/linux/hrtimer.h | 2 +- include/linux/hrtimer_types.h | 2 +- include/trace/events/timer.h | 4 ++-- kernel/time/hrtimer.c | 8 ++++---- kernel/time/timer_list.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 47103a0f6691..38983c2e1dd4 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -339,7 +339,7 @@ static inline void hrtimer_update_function(struct hrtim= er *timer, if (WARN_ON_ONCE(!function)) return; =20 - timer->function =3D function; + ACCESS_PRIVATE(timer, function) =3D function; } =20 /* Forward a hrtimer so it expires after now: */ diff --git a/include/linux/hrtimer_types.h b/include/linux/hrtimer_types.h index 7c5b27daa89d..8fbbb6bdf7a1 100644 --- a/include/linux/hrtimer_types.h +++ b/include/linux/hrtimer_types.h @@ -39,7 +39,7 @@ enum hrtimer_restart { struct hrtimer { struct timerqueue_node node; ktime_t _softexpires; - enum hrtimer_restart (*function)(struct hrtimer *); + enum hrtimer_restart (*__private function)(struct hrtimer *); struct hrtimer_clock_base *base; u8 state; u8 is_rel; diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h index 1ef58a04fc57..f8c906be4cd0 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h @@ -235,7 +235,7 @@ TRACE_EVENT(hrtimer_start, =20 TP_fast_assign( __entry->hrtimer =3D hrtimer; - __entry->function =3D hrtimer->function; + __entry->function =3D ACCESS_PRIVATE(hrtimer, function); __entry->expires =3D hrtimer_get_expires(hrtimer); __entry->softexpires =3D hrtimer_get_softexpires(hrtimer); __entry->mode =3D mode; @@ -271,7 +271,7 @@ TRACE_EVENT(hrtimer_expire_entry, TP_fast_assign( __entry->hrtimer =3D hrtimer; __entry->now =3D *now; - __entry->function =3D hrtimer->function; + __entry->function =3D ACCESS_PRIVATE(hrtimer, function); ), =20 TP_printk("hrtimer=3D%p function=3D%ps now=3D%llu", diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index cf362d93a323..d11697492bdb 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1276,7 +1276,7 @@ void hrtimer_start_range_ns(struct hrtimer *timer, kt= ime_t tim, struct hrtimer_clock_base *base; unsigned long flags; =20 - if (WARN_ON_ONCE(!timer->function)) + if (WARN_ON_ONCE(!ACCESS_PRIVATE(timer, function))) return; /* * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft @@ -1577,9 +1577,9 @@ static void __hrtimer_setup(struct hrtimer *timer, timerqueue_init(&timer->node); =20 if (WARN_ON_ONCE(!function)) - timer->function =3D hrtimer_dummy_timeout; + ACCESS_PRIVATE(timer, function) =3D hrtimer_dummy_timeout; else - timer->function =3D function; + ACCESS_PRIVATE(timer, function) =3D function; } =20 /** @@ -1691,7 +1691,7 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cp= u_base, raw_write_seqcount_barrier(&base->seq); =20 __remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, 0); - fn =3D timer->function; + fn =3D ACCESS_PRIVATE(timer, function); =20 /* * Clear the 'is relative' flag for the TIME_LOW_RES case. If the diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index 1c311c46da50..958dd4194684 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c @@ -46,7 +46,7 @@ static void print_timer(struct seq_file *m, struct hrtimer *taddr, struct hrtimer *tim= er, int idx, u64 now) { - SEQ_printf(m, " #%d: <%pK>, %ps", idx, taddr, timer->function); + SEQ_printf(m, " #%d: <%pK>, %ps", idx, taddr, ACCESS_PRIVATE(timer, funct= ion)); SEQ_printf(m, ", S:%02x", timer->state); SEQ_printf(m, "\n"); SEQ_printf(m, " # expires at %Lu-%Lu nsecs [in %Ld to %Ld nsecs]\n", --=20 2.39.5 From nobody Mon Nov 25 09:31:40 2024 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 CA0262064E9 for ; Mon, 28 Oct 2024 07:36:09 +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=1730100972; cv=none; b=EzrBY7mkx+8tWtr6RgUoKV62JlEvh8Gct7Wypd0Ck4F3UG6viB+VUWkymJj9K5izAklRHTv3BRfi8hHd7IxfixuV+M3mYNVfOF5wF65rcdHvy0jUtbidyQISIkaBzuGl7yPlvIhtUDU2q7HS1WnjaiylCC4HuoxP7QpA+DxN4Tg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100972; c=relaxed/simple; bh=dHCtJjOVtAag+Bg/wK60QRuUqnfGU3A3wK1zm9IkNs4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OqhfCmULfLOeDhVgYGIhxH4wMfaPKY5eC9zIiAdjRb9D8DU2gzv5IQGR7cVVSyzZ/OPL0ygR8X6N9dR0OEEywHI8IBdW0yGEByRW3CtvwM69nxy3lafUg2sLtlIOPlTW5zP2EXnRc9L73193jalcllv6JxZkjXWSIHNXCyE+UTM= 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=TNvdOrkY; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YFv5AFKi; 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="TNvdOrkY"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YFv5AFKi" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DRz7QtyGXezmKWopxXfmDRDYnTNSdp4skn3MHlnNYb4=; b=TNvdOrkYLIEFvxBu2f0blMtbeKz1csEfgdwmfKa6bYkva8NjFWoiXZi5o1ES9/4UOgE9II HvJNINO6bwNR0ko/0ULnsdQWo723iy9e0XZm3so36u83I0yq2TaNHvm8NUr648Hs1qx8dV 6R1ZPhaStQh98QrXBoXkkibu2JGLdywmnwvYre5Hff35geuPaW+zUkbvbKruQQTAaUHORS ainaBJ8vr5HB0p7mlt8oj+Ftg6hwjalT+T9MJAX9Fe5jQmj8bbmDM0qAMIyM0a/o6phoIc Aa6md8SjGPr1BToSXuKIhy4daU2K/gBojshFYhfdUrF3eCwhdbhZFiz6FXyJRQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DRz7QtyGXezmKWopxXfmDRDYnTNSdp4skn3MHlnNYb4=; b=YFv5AFKiEEHijIEVby9ycqDMMvncC/sBwUHN38Gq1s6bHn2oPouatgtMzvO6mCXR3oTQvR /7EFhJgyjL5yV2DA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH 08/12] hrtimers: Remove unnecessary NULL check in hrtimer_start_range_ns() Date: Mon, 28 Oct 2024 08:35:52 +0100 Message-Id: <47dcebb90753f8647a946442df4d8cb9bb9621b8.1729865740.git.namcao@linutronix.de> In-Reply-To: References: 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" The 'function' field of struct hrtimer can only be changed using hrtimer_setup*() or hrtimer_update_function(), and both already null-check 'function'. Therefore, null-checking 'function' in hrtimer_start_range_ns() is not necessary. Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index d11697492bdb..2e03b07cbdac 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1276,8 +1276,6 @@ void hrtimer_start_range_ns(struct hrtimer *timer, kt= ime_t tim, struct hrtimer_clock_base *base; unsigned long flags; =20 - if (WARN_ON_ONCE(!ACCESS_PRIVATE(timer, function))) - return; /* * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft * match on CONFIG_PREEMPT_RT =3D n. With PREEMPT_RT check the hard --=20 2.39.5 From nobody Mon Nov 25 09:31:40 2024 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 1D9E7206502 for ; Mon, 28 Oct 2024 07:36:09 +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=1730100972; cv=none; b=mNd8CS2jHUuXCZgwPw0k5Lv/pDwW8rcb+YaXNBOHaPW+DlsGOgq0JQOJII8HI67Kuu+8QIpCpa8wdkRn22l+xGIQEwdmnewNazJWemmRZZoxLZXfwEOfgU3GEkFISixX/IrTckjdYMdkdx0Yw3YGLYP2nL0mADEBj1SaxagxO78= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100972; c=relaxed/simple; bh=9PdsUuYpTN2C6qHSqx434uFs5AXyTwcb5RovbxcyLis=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cbWP/DKrFaMySiyOJzUph2Id4Np0bTluH8bDqf3RBqp8+c08LOnQgqynfhjza9BlpzqimsLdloORVMfgYLGtAOdzT76noRRgKwN2JRLvi11oEQ3J27LUN8idYojhndqImwlM8ZmH3XJYgC3ivwsy3tpUD0gCq9pWQxkvbX0GaD8= 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=J00wLZeX; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=6BCttQ/1; 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="J00wLZeX"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="6BCttQ/1" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n8+eIAnZAWa5IhIML+AEY4ZBvVRGHV38HNKn8muuaoo=; b=J00wLZeXuCTuZuAAgfmDWeAArN8Vd1TiMGjRy4UzwOdNArCh+8+Eaw1xgdOLhQZIiwoALp D5qSZlGQSZUGo2qx19eVR69KLdGnsZu1DH/3xkkMGy3Ri5BTS1x7sHZrlCcjk/xnAEqgf4 Sb0qjNrtR57Nt4IzGMiyMhJoeftuhCq+yPNpv/3X+D1n6e+Kc4eNNTbqtnzbPg9xhCKljw BhpgtdTvS5an/VcEXzTp3m5Flu+wlweyY/9LNAyW3NIWomvG1UYAYadtq3dK1zu6f7hnaA iJbjUoxLSx52OqRfXWjkjkPLlaJOgppjvHihYdohlau2c72FyFf5LpMTH7H5Vg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n8+eIAnZAWa5IhIML+AEY4ZBvVRGHV38HNKn8muuaoo=; b=6BCttQ/1jNLgSr+FwW3p5llQZd1nRard7bg/EqjNARK6YZG+TVsOIjmB3Qpgvu/CQrhaXp uTZW5AQMXI/nF8Ag== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH 09/12] hrtimers: Rename __hrtimer_init_sleeper() to __hrtimer_setup_sleeper() Date: Mon, 28 Oct 2024 08:35:53 +0100 Message-Id: In-Reply-To: References: 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" All the hrtimer_init*() functions have been renamed to hrtimer_setup*(). Rename __hrtimer_init_sleeper() to __hrtimer_setup_sleeper() as well, to keep the names consistent. Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 2e03b07cbdac..36d55ce57810 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1964,7 +1964,7 @@ void hrtimer_sleeper_start_expires(struct hrtimer_sle= eper *sl, * Make the enqueue delivery mode check work on RT. If the sleeper * was initialized for hard interrupt delivery, force the mode bit. * This is a special case for hrtimer_sleepers because - * __hrtimer_init_sleeper() determines the delivery mode on RT so the + * __hrtimer_setup_sleeper() determines the delivery mode on RT so the * fiddling with this decision is avoided at the call sites. */ if (IS_ENABLED(CONFIG_PREEMPT_RT) && sl->timer.is_hard) @@ -1974,8 +1974,8 @@ void hrtimer_sleeper_start_expires(struct hrtimer_sle= eper *sl, } EXPORT_SYMBOL_GPL(hrtimer_sleeper_start_expires); =20 -static void __hrtimer_init_sleeper(struct hrtimer_sleeper *sl, - clockid_t clock_id, enum hrtimer_mode mode) +static void __hrtimer_setup_sleeper(struct hrtimer_sleeper *sl, + clockid_t clock_id, enum hrtimer_mode mode) { /* * On PREEMPT_RT enabled kernels hrtimers which are not explicitly @@ -2015,7 +2015,7 @@ void hrtimer_setup_sleeper_on_stack(struct hrtimer_sl= eeper *sl, clockid_t clock_id, enum hrtimer_mode mode) { debug_init_on_stack(&sl->timer, clock_id, mode); - __hrtimer_init_sleeper(sl, clock_id, mode); + __hrtimer_setup_sleeper(sl, clock_id, mode); } EXPORT_SYMBOL_GPL(hrtimer_setup_sleeper_on_stack); =20 --=20 2.39.5 From nobody Mon Nov 25 09:31:40 2024 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 D7425206073 for ; Mon, 28 Oct 2024 07:36:09 +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=1730100971; cv=none; b=Tgb00w6X9SCbH5zbBUjGTsTe7CVzZqzmND7kiuMD7p4moOp3fjWU8fSCfdfmXVY90HOI/BjkB9gtsmJXOEqQbmbhk35yLxdsZFzEuawyvtsHvnvOopQntF+JOwd9kvhZGmuk64VMhKTq8DuiwdKig2sa1JbR+1jXMzyv16xVudU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100971; c=relaxed/simple; bh=qf+PMEL1sWXuMKrQ1DoIrqLvNC8MNyx3gXNn7VkDheI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Rx1m5Tyxh7r3aF4fYQuO3jTjEbm8Ukzqd7MEhB0q4OMg5ts6GHvw9ZG3wro+69BrNlt2NBlovZW0cLe/+lFt4kf8hriCw3HPrvU6rIpnIt+iAVHJvITlFLRrIKy8SJuEMqkzrrbj110eSzYfyPYWxMIhl4cLFOM306AtIW/WxQ0= 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=B5I6+OPW; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YUkT9GmL; 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="B5I6+OPW"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YUkT9GmL" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ravrCfgcfWkk1ZfX6tkHa/OzKLCsADxyfO8FJoHeiHc=; b=B5I6+OPW7vgxDwOldejHr3CKuPU77QkJZtzr3MofbdJP+vtf7aYqRBzKlWRhZr3hpHs6va Y0TWE2eW/JUjFEGAfT5M8O2RCC2P45xb/n5yiofW6cEkNCINejt/se5mfPjkTRuy8q2GL9 gtNJFCPbTd5h8MjO3PzDsXfK3e7d3sCb2pJRzAn4PC8LTcNOnXDKrARxPrDxqnvSVvuEu2 5+pynGspJPsAU+6xWz2JIBSY7ClNcj6aURxC6SsWfLoWj3IQhdY8yGQX59MGm9+hhbtgEm 8IZt0lSlgMdvEq/aKt4eUfGIbidQ6lwcYUiiNkxOio5ihQD29rGFdBJekRg/uQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ravrCfgcfWkk1ZfX6tkHa/OzKLCsADxyfO8FJoHeiHc=; b=YUkT9GmL0rvf7RxwNWUON6Bu/rMCrVfIC9BisAbObhtLjdb88d1geCO27lHZeaDDVmvV3L 2eKvEWHp4yG8/CAg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH 10/12] hrtimers: Rename debug_init() to debug_setup() Date: Mon, 28 Oct 2024 08:35:54 +0100 Message-Id: In-Reply-To: References: 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" All the hrtimer_init*() functions have been renamed to hrtimer_setup*(). Rename debug_init() to debug_setup() as well, to keep the names consistent. Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 36d55ce57810..6c29d988e145 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -448,9 +448,7 @@ static inline void debug_hrtimer_activate(struct hrtime= r *timer, static inline void debug_hrtimer_deactivate(struct hrtimer *timer) { } #endif =20 -static inline void -debug_init(struct hrtimer *timer, clockid_t clockid, - enum hrtimer_mode mode) +static inline void debug_setup(struct hrtimer *timer, clockid_t clockid, e= num hrtimer_mode mode) { debug_hrtimer_init(timer); trace_hrtimer_init(timer, clockid, mode); @@ -1596,7 +1594,7 @@ static void __hrtimer_setup(struct hrtimer *timer, void hrtimer_setup(struct hrtimer *timer, enum hrtimer_restart (*function)= (struct hrtimer *), clockid_t clock_id, enum hrtimer_mode mode) { - debug_init(timer, clock_id, mode); + debug_setup(timer, clock_id, mode); __hrtimer_setup(timer, function, clock_id, mode); } EXPORT_SYMBOL_GPL(hrtimer_setup); --=20 2.39.5 From nobody Mon Nov 25 09:31:40 2024 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 85AFB191F86 for ; Mon, 28 Oct 2024 07:36:10 +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=1730100972; cv=none; b=VFaN8PY3Fx9ltDL3pQkQYAjAVewtJXpwVaaS1VvgxIdpTH2sHPmrgWBQW1xgZyGjKHrfwpFow0gGLnesYwAH7YzlK+hz/XXl9jzn6Yvk4NeCdEznCICEb/Au/GwCvQuviEk7gjmsGtXxf+fMt8Tr+OXhSd98jFrzEH8C+8zZ0JA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100972; c=relaxed/simple; bh=BKk3S0BW1jAtRhA7kOuL04ZUycoUFVfVgV866DvXyYU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DrBKXT3dE3FiGE+Vwxn+JaO1BlzXrZjhNuOE3FQuA6emxlN2EU3zHmGnoiZb5ooFNvxvSR/spJZ6vXQNK2CRpQIhlilH+ESUR8e5yzb/pviSQtAOcweaTmCC7JPgnG83D6TNmR3ExVpS5tL6aRos6xifXvPwDWUC7BWOKm03Xk8= 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=4Lw5CcYb; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=6bV3btNu; 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="4Lw5CcYb"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="6bV3btNu" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JaIiVRm/wcamEKjgFEQqGudvkLaUOjAsfxLAZPwyDlQ=; b=4Lw5CcYb2rsDfu9XHWnN2vK4/BWGGRYiudtkR4beOiZrqIHXZiERf2MpgFmZchnVPHVIDp NB9NVHyYBwzvHV0gy2Gpx7IJpDzI7f+AotayTOm11upc7AAv0aLHEQLYByMqgJQxvYIMsQ wDx5F1i9dR31fM1774NzYwo+RE9VwlXo8riwjEoJfifCvdtGzg+Nt0WfXJtXVq4+dSqy57 uNX/ionij/E3nNivUjyQJEnFqiqmSYuXOuFA+4OFBkzwnHNFCF0NXit6HdOc/RrRRKIYgF F+pJxPvlRWa+re5YEr0EhSrd9bilK49lMDghsxRjF0YwzCdtQKECmckQSZxGBg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JaIiVRm/wcamEKjgFEQqGudvkLaUOjAsfxLAZPwyDlQ=; b=6bV3btNuNIxOFMxaxV8LEIywEsoAntuHTf89/dAKwDdF/Bb6Z1i+6jkzqICAGRKwDZMZ4L ABMOf1yx+N6AwvAA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH 11/12] hrtimers: Rename debug_init_on_stack() to debug_setup_on_stack() Date: Mon, 28 Oct 2024 08:35:55 +0100 Message-Id: In-Reply-To: References: 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" All the hrtimer_init*() functions have been renamed to hrtimer_setup*(). Rename debug_init_on_stack() to debug_setup_on_stack() as well, to keep the names consistent. Signed-off-by: Nam Cao --- kernel/time/hrtimer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 6c29d988e145..48bd61ee9d50 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -454,8 +454,8 @@ static inline void debug_setup(struct hrtimer *timer, c= lockid_t clockid, enum hr trace_hrtimer_init(timer, clockid, mode); } =20 -static inline void debug_init_on_stack(struct hrtimer *timer, clockid_t cl= ockid, - enum hrtimer_mode mode) +static inline void debug_setup_on_stack(struct hrtimer *timer, clockid_t c= lockid, + enum hrtimer_mode mode) { debug_hrtimer_init_on_stack(timer); trace_hrtimer_init(timer, clockid, mode); @@ -1613,7 +1613,7 @@ void hrtimer_setup_on_stack(struct hrtimer *timer, enum hrtimer_restart (*function)(struct hrtimer *), clockid_t clock_id, enum hrtimer_mode mode) { - debug_init_on_stack(timer, clock_id, mode); + debug_setup_on_stack(timer, clock_id, mode); __hrtimer_setup(timer, function, clock_id, mode); } EXPORT_SYMBOL_GPL(hrtimer_setup_on_stack); @@ -2012,7 +2012,7 @@ static void __hrtimer_setup_sleeper(struct hrtimer_sl= eeper *sl, void hrtimer_setup_sleeper_on_stack(struct hrtimer_sleeper *sl, clockid_t clock_id, enum hrtimer_mode mode) { - debug_init_on_stack(&sl->timer, clock_id, mode); + debug_setup_on_stack(&sl->timer, clock_id, mode); __hrtimer_setup_sleeper(sl, clock_id, mode); } EXPORT_SYMBOL_GPL(hrtimer_setup_sleeper_on_stack); --=20 2.39.5 From nobody Mon Nov 25 09:31:40 2024 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 C7BFB20697B for ; Mon, 28 Oct 2024 07:36:11 +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=1730100974; cv=none; b=vDCPvEP8S8wNGFBAiATJjrh9XlRIATB+0kBbnxIh6Kf7/ghBDptTvJt5qClZTnW3q4ZbW9FnLMYBCpZMs7lnrfUDaejMA4eXQEUf/kqvRXQmX4Y61ph72/kdVCmTlajkspcr5oEpdJWp2x6QjvUgfGbBcjf/z7LU+KqAekyVrwc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100974; c=relaxed/simple; bh=DCwO148OTmr2+9qrHSHo8hg2kwZqYYBZLcRGJN+PRaM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=df6FWcnzEiw0shwoRw2IpW+EnFDdpE6GzSVuNWi7KB0nfHQFmkauEBDkquPDZewJlMjq2EQ2KGLBFrOUMrmnuoFytu4zKWsxaLYggD3RmK9lgYD5Hpa6rZ7rAd4+gR+mDFg2dgExdzT8N4FjuUbQZTqICzdU7BlD44np1t42FWI= 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=IJfwxCq0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=PXFEppkH; 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="IJfwxCq0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PXFEppkH" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ukinf5Kr8oj6nMWExEjL5xi5Kgc0krc384YnlLcY+Wk=; b=IJfwxCq0xvbM8mvZ9vcz45NU/kO/71QanZ0j2LW2qDrYTqAAgp1fp4kHM7YKZCiWuB9+SA VGNdOJUJECRI9FRyj3mFW5lXYRGJh+WV1QLLfbcSJdedDvXpSUvU2ZJLtYyrj4UfyCeA+w gvW4rgo0ISEWTwkc/K8shMoz8HSXdLWyh6zu4cp5sXl3TQ4HDiZrb4ypdo9xsBucPEPESc 43X3M5FShzP9eBlAucPQnHM0l21S2D8UvLpsL4WhHEHpmJhqNRZ29jWjWaqrS1uzQHBx9r a8JjgodkXj2yRaWBOt2xFPCmp12d2+7OSStlkm4ZrRAothMzTMe/AYi33RemMg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ukinf5Kr8oj6nMWExEjL5xi5Kgc0krc384YnlLcY+Wk=; b=PXFEppkHktgqFggPgOn4rgOU8lnTQ52bCCmHvB0gjQVjNkEzd5wfOe2AvjZ5QjQYLCIQDY vrHveWJGYOZ4bqAg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao , Steven Rostedt Subject: [PATCH 12/12] tracing/timers: Rename hrtimer_init event to hrtimer_setup Date: Mon, 28 Oct 2024 08:35:56 +0100 Message-Id: In-Reply-To: References: 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" The function hrtimer_init() doesn't exist anymore. It was replaced by hrtimer_setup(). Thus, rename the hrtimer_init trace event to hrtimer_setup to keep it consistent. Signed-off-by: Nam Cao --- Cc: Steven Rostedt --- Documentation/trace/ftrace.rst | 4 ++-- include/trace/events/timer.h | 4 ++-- kernel/time/hrtimer.c | 4 ++-- tools/perf/tests/shell/trace_btf_enum.sh | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst index 4073ca48af4a..502783e7a9b5 100644 --- a/Documentation/trace/ftrace.rst +++ b/Documentation/trace/ftrace.rst @@ -3070,7 +3070,7 @@ Notice that we lost the sys_nanosleep. # cat set_ftrace_filter hrtimer_run_queues hrtimer_run_pending - hrtimer_init + hrtimer_setup hrtimer_cancel hrtimer_try_to_cancel hrtimer_forward @@ -3108,7 +3108,7 @@ Again, now we want to append. # cat set_ftrace_filter hrtimer_run_queues hrtimer_run_pending - hrtimer_init + hrtimer_setup hrtimer_cancel hrtimer_try_to_cancel hrtimer_forward diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h index f8c906be4cd0..1641ae3e6ca0 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h @@ -185,12 +185,12 @@ TRACE_EVENT(timer_base_idle, { HRTIMER_MODE_REL_PINNED_HARD, "REL|PINNED|HARD" }) =20 /** - * hrtimer_init - called when the hrtimer is initialized + * hrtimer_setup - called when the hrtimer is initialized * @hrtimer: pointer to struct hrtimer * @clockid: the hrtimers clock * @mode: the hrtimers mode */ -TRACE_EVENT(hrtimer_init, +TRACE_EVENT(hrtimer_setup, =20 TP_PROTO(struct hrtimer *hrtimer, clockid_t clockid, enum hrtimer_mode mode), diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 48bd61ee9d50..58118b46f62c 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -451,14 +451,14 @@ static inline void debug_hrtimer_deactivate(struct hr= timer *timer) { } static inline void debug_setup(struct hrtimer *timer, clockid_t clockid, e= num hrtimer_mode mode) { debug_hrtimer_init(timer); - trace_hrtimer_init(timer, clockid, mode); + trace_hrtimer_setup(timer, clockid, mode); } =20 static inline void debug_setup_on_stack(struct hrtimer *timer, clockid_t c= lockid, enum hrtimer_mode mode) { debug_hrtimer_init_on_stack(timer); - trace_hrtimer_init(timer, clockid, mode); + trace_hrtimer_setup(timer, clockid, mode); } =20 static inline void debug_activate(struct hrtimer *timer, diff --git a/tools/perf/tests/shell/trace_btf_enum.sh b/tools/perf/tests/sh= ell/trace_btf_enum.sh index 5a3b8a5a9b5c..6ac6887d057d 100755 --- a/tools/perf/tests/shell/trace_btf_enum.sh +++ b/tools/perf/tests/shell/trace_btf_enum.sh @@ -6,7 +6,7 @@ err=3D0 set -e =20 syscall=3D"landlock_add_rule" -non_syscall=3D"timer:hrtimer_init,timer:hrtimer_start" +non_syscall=3D"timer:hrtimer_setup,timer:hrtimer_start" =20 TESTPROG=3D"perf test -w landlock" =20 --=20 2.39.5