From patchwork Tue Jan 7 01:18:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 13927941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C4E2E77188 for ; Tue, 7 Jan 2025 01:19:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F02E26B00D0; Mon, 6 Jan 2025 20:19:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E8C366B00D1; Mon, 6 Jan 2025 20:19:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D2D5B6B00D2; Mon, 6 Jan 2025 20:19:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B0C7C6B00D0 for ; Mon, 6 Jan 2025 20:19:28 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6A4F4C05B0 for ; Tue, 7 Jan 2025 01:19:28 +0000 (UTC) X-FDA: 82978898016.12.1FCE063 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by imf16.hostedemail.com (Postfix) with ESMTP id 5C5DC180008 for ; Tue, 7 Jan 2025 01:19:25 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf16.hostedemail.com: domain of chenhuacai@loongson.cn designates 114.242.206.163 as permitted sender) smtp.mailfrom=chenhuacai@loongson.cn ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736212766; a=rsa-sha256; cv=none; b=GYpjbHTlSPYhTf9O+KbUAua8PrW9Ruu4HC8qSLX/mrkW24EoqyrO9kVGHy21jYkp2vbtCn o6TQyI6toYXumw5+WVB56uzWExTQxAkeOc/tfpu/AbCtBUByDV5dQtzYKBwEnc4+wFmRO2 6DDdmXcgQeO3RV8cnXWlWcAKKZVExw0= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf16.hostedemail.com: domain of chenhuacai@loongson.cn designates 114.242.206.163 as permitted sender) smtp.mailfrom=chenhuacai@loongson.cn ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736212766; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LsZgY8LiIz/ju7EJhSgV7xQEL0mKH06CSYMRpBjsNuk=; b=Dt/8efjXKdgSzCCvChu6gnetx9lI0hGhHM/Anjp6jSgr7/HZow5+GAzPQzEzlZZlBYVbYJ 7B2Rp7RJ+DGEQ+5VGdvUDm5i1KGlQneWapnf/ppCLFpy/n/GkmAnmynGgWhCVEW9QM30PV aNLmW0uEjQy07kcvFul2KYsQ5kfgkFY= Received: from loongson.cn (unknown [223.64.68.63]) by gateway (Coremail) with SMTP id _____8Axjq8TgXxnhO9eAA--.31943S3; Tue, 07 Jan 2025 09:19:15 +0800 (CST) Received: from localhost.localdomain (unknown [223.64.68.63]) by front1 (Coremail) with SMTP id qMiowMCxG8UMgXxnRUoXAA--.5838S2; Tue, 07 Jan 2025 09:19:13 +0800 (CST) From: Huacai Chen To: Huacai Chen Cc: Andrew Morton , linux-mm@kvack.org, Koichiro Den , Sebastian Andrzej Siewior , Lorenzo Stoakes , Mark Rutland , Charalampos Mitrodimas , Huacai Chen Subject: [PATCH] Simple fix Date: Tue, 7 Jan 2025 09:18:48 +0800 Message-ID: <20250107011848.689556-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.43.5 In-Reply-To: <7gd4skn6l4i3liu6cvzmgqlrwxc3rukrnau7lnpyhmfyjuvqwl@gdwgybedp5gs> References: <7gd4skn6l4i3liu6cvzmgqlrwxc3rukrnau7lnpyhmfyjuvqwl@gdwgybedp5gs> MIME-Version: 1.0 X-CM-TRANSID: qMiowMCxG8UMgXxnRUoXAA--.5838S2 X-CM-SenderInfo: hfkh0x5xdftxo6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBj9xXoW7GF4ruFWftF1DGrWDJFy3KFX_yoW3Crg_WF WvgF1qgry5Xa4I9Fyjvr1akFy8K3W0vF1v9rW8Ga4ayF97Xr48C3y2qFWkCw15W3y3XF9x GwsxZF4Ykw1agosvyTuYvTs0mTUanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb78YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8 JVW8Jr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jrv_JF1lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r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QedTLMw/bwHbKEdMNH3iIKzdkatZmOOhswtMyjpE6U3gvl7t31dQ2RLc/bbkMcWPwlDmZmDljk34vXAr92ivLsva/semH8S6tTjzTlWdsaLlWy0By15mZKg/sHtZF55VIt0HhyKum6Bj56hAhAyzG4O7Y44RHMlb6Eqm56hjTyeWX4T2S/SVuw+4MBu983dAnSNth5wEVM9kuNkQpC7q8A3h64nEXRZDpPvf7vFpuW7U/VfRzXDumyGJu6OAQ1rPecVVCSKJw QxQukFNf T1yh1AZdZlrRl1vyZbwrut1QgCR8jso/7dKS9 X-Bogosity: Ham, tests=bogofilter, spamicity=0.160760, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi, all, I like simple fixes, so is this acceptable (based on an early version from Koichiro Den)? --- mm/vmstat.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/vmstat.c b/mm/vmstat.c index 0889b75cef14..1badc24a21ff 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -2122,10 +2122,15 @@ static void __init start_shepherd_timer(void) { int cpu; - for_each_possible_cpu(cpu) + for_each_possible_cpu(cpu) { INIT_DEFERRABLE_WORK(per_cpu_ptr(&vmstat_work, cpu), vmstat_update); + /* Will be enabled on vmstat_cpu_online() */ + if (!cpu_online(cpu)) + disable_delayed_work_sync(&per_cpu(vmstat_work, cpu)); + } + schedule_delayed_work(&shepherd, round_jiffies_relative(sysctl_stat_interval)); }