From nobody Sun Oct 5 09:09:59 2025 Received: from baidu.com (mx22.baidu.com [220.181.50.185]) (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 6FC581B040B for ; Wed, 6 Aug 2025 15:57:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.181.50.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754495839; cv=none; b=Q3cKfi/eo19nrRJncGoNFvCb1KGK/O8/8o+npKnyoOyOHrlwUv93/WvxA3KlFf753I2RkhN0lecau9fU0DDKoxUyDifOVu2a3vC6BWLwlG5bkOC9MCbp7VnneZo0gQiQ4chy2YMorxQUfOsmeZ4xAmNHtPVgUEXjGcoIAejkKtg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754495839; c=relaxed/simple; bh=2nVU5PwuIL29+F1jgg3rp77asR55/ez/tKz1J7VjRr8=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=aS+fMJ/owXBiI/1Ca1UBsOFXHrano8Uw6rzy0lBC1YA23Uq5CgTSyxUX1CaTSxc+hcXVHb3WdQsFgNKZxGhWHEtU2MTnf136XtAzCQwefkg+RFWB1iOunfAG3Dcl1mXO2/6tNwYHjTUtAHeZ7W9Rs9GtECYRI0qH3HGY/fQ8Mt4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com; spf=pass smtp.mailfrom=baidu.com; arc=none smtp.client-ip=220.181.50.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baidu.com From: Fushuai Wang To: CC: , , , , , , , , Fushuai Wang Subject: [PATCH] x86/tsc: Use cpumask_next_wrap() in tsc_sync_check_timer_fn() Date: Wed, 6 Aug 2025 23:55:35 +0800 Message-ID: <20250806155535.34338-1-wangfushuai@baidu.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) 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 X-ClientProxiedBy: bjhj-exc3.internal.baidu.com (172.31.3.13) To bjhj-exc17.internal.baidu.com (172.31.4.15) X-FEAS-Client-IP: 172.31.4.15 X-FE-Policy-ID: 52:10:53:SYSTEM Content-Type: text/plain; charset="utf-8" Replace the manual sequence of cpumask_next() and cpumask_first() with a single call to cpumask_next_wrap() in tsc_sync_check_timer_fn(). Signed-off-by: Fushuai Wang --- arch/x86/kernel/tsc_sync.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c index ec3aa340d351..ef6ebf2bf7aa 100644 --- a/arch/x86/kernel/tsc_sync.c +++ b/arch/x86/kernel/tsc_sync.c @@ -99,9 +99,7 @@ static void tsc_sync_check_timer_fn(struct timer_list *un= used) tsc_verify_tsc_adjust(false); =20 /* Run the check for all onlined CPUs in turn */ - next_cpu =3D cpumask_next(raw_smp_processor_id(), cpu_online_mask); - if (next_cpu >=3D nr_cpu_ids) - next_cpu =3D cpumask_first(cpu_online_mask); + next_cpu =3D cpumask_next_wrap(raw_smp_processor_id(), cpu_online_mask); =20 tsc_sync_check_timer.expires +=3D SYNC_CHECK_INTERVAL; add_timer_on(&tsc_sync_check_timer, next_cpu); --=20 2.36.1