From patchwork Wed Jun 21 03:58:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 110760 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4114233vqr; Tue, 20 Jun 2023 21:26:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5isph7X0ucwZDBcnsgePyGT4/0IPghG7/YbREjOMxvyQ3Wz22KzLMzOjJ9OIWijv1oAJsz X-Received: by 2002:a17:903:1103:b0:1b5:91:4693 with SMTP id n3-20020a170903110300b001b500914693mr18518356plh.1.1687321567323; Tue, 20 Jun 2023 21:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687321567; cv=none; d=google.com; s=arc-20160816; b=j2PTpFuaoOD86XCfSQnr9VLdPTQCLA4Wx2Yme2lE+cih+t6tqkK/Pj1eyFyBiPGR+x KpEbB5i9UMAnGDyHvYUqPKate/VH78IyIVTT5zZe5B5hGImWUPWh7OxPrWwPSuQ/mZ8x UVE45UmzfAGrlqLCBEePfMZrORPMJFIKhJ0lCu17kHVASxirnTFFbn7VA/ab+gxKo05r 7C4GyrYr+OiZlFJ2yvyqpd94cSF0z72NcAexvYHZNRMee0RmBHXuGwxUKxdzAHWL1gmF e/pYE/jV4UcBBGat/niQBdQprNOjXfdQI7zX193bPoY84q0m6SArB9YgznqZ5JI5E3yI U5Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=HNfFUFXjCC44gPcGgQTgQEHFxy4sm1svubEhNpTEn2Q=; b=MFIL1Njuz20ygfp91DNUe3121i0WEMIxfn4LR8d1XtLldfIpCGH26l1E78/O6l37Zx DAn0UOibaRJ36mKVw8DXxBO3zL9QryDS9Z3SqUw8CTgosJp4b0ouOsrzIx6RCmLs3aVF 0EgDYlVLt8Vcc7dpL+AHlZPEcSShVDdBzfJnia0hSTqmTUPkS6fuVOA/K590CrICHC6f WOZL+ds1zcr20VmaKTYoHBVbt4dE00Mlcfg0lLOxELkvLdanUMmeDVze54mpc39Jn9v9 bjJKk15vN8gq8G0G8mV4J2ATQqMLII/etEKYj4v18pi/ZxXY7NtA4bBbxTicHY0lvx4n QfKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q9-20020a170902dac900b001b3cd3e0533si3659813plx.607.2023.06.20.21.25.54; Tue, 20 Jun 2023 21:26:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229821AbjFUD71 (ORCPT + 99 others); Tue, 20 Jun 2023 23:59:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229709AbjFUD70 (ORCPT ); Tue, 20 Jun 2023 23:59:26 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57CE0F1 for ; Tue, 20 Jun 2023 20:59:24 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Qm8rg3Gg2z1FDhw; Wed, 21 Jun 2023 11:59:15 +0800 (CST) Received: from huawei.com (10.175.104.170) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 21 Jun 2023 11:59:21 +0800 From: Miaohe Lin To: , , , CC: , , , , , , , Subject: [PATCH] sched/numa: fix possible uncapped numa_scan_period Date: Wed, 21 Jun 2023 11:58:47 +0800 Message-ID: <20230621035847.3349899-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.104.170] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769284899846652903?= X-GMAIL-MSGID: =?utf-8?q?1769284899846652903?= The unit of task_scan_max() is ms while ns is expected. This will lead to task_scan_max() being ineffective. Fixes: 137844759843 ("sched/numa: Stagger NUMA balancing scan periods for new threads") Signed-off-by: Miaohe Lin --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3cc06cfca350..5e90e9658528 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3175,7 +3175,7 @@ void init_numa_balancing(unsigned long clone_flags, struct task_struct *p) if (mm) { unsigned int delay; - delay = min_t(unsigned int, task_scan_max(current), + delay = min_t(unsigned int, task_scan_max(current) * NSEC_PER_MSEC, current->numa_scan_period * mm_users * NSEC_PER_MSEC); delay += 2 * TICK_NSEC; p->node_stamp = delay;