From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85ACCC433FE for ; Tue, 19 Apr 2022 14:07:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352993AbiDSOKf (ORCPT ); Tue, 19 Apr 2022 10:10:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352994AbiDSOKc (ORCPT ); Tue, 19 Apr 2022 10:10:32 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88513393F5 for ; Tue, 19 Apr 2022 07:07:49 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KjQcG1MX8zhXXP; Tue, 19 Apr 2022 22:07:42 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 19 Apr 2022 22:07:47 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 19 Apr 2022 22:07:46 +0800 Message-ID: <4734132d-bae3-d3ab-33b3-a4c3282ad5cd@huawei.com> Date: Tue, 19 Apr 2022 22:07:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v4] hugetlb: Fix wrong use of nr_online_nodes Content-Language: en-US To: Andrew Morton , Peng Liu CC: , , , , , , , , References: <20220413032915.251254-2-liupeng256@huawei.com> <20220416103526.3287348-1-liupeng256@huawei.com> <20220418210352.1d1d90aeba477d598bd6f0be@linux-foundation.org> From: Kefeng Wang In-Reply-To: <20220418210352.1d1d90aeba477d598bd6f0be@linux-foundation.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/4/19 12:03, Andrew Morton wrote: > On Sat, 16 Apr 2022 10:35:26 +0000 Peng Liu wrote: > >> Certain systems are designed to have sparse/discontiguous nodes. In >> this case, nr_online_nodes can not be used to walk through numa node. >> Also, a valid node may be greater than nr_online_nodes. >> >> However, in hugetlb, it is assumed that nodes are contiguous. Recheck >> all the places that use nr_online_nodes, and repair them one by one. > oops. > > What are the user-visible runtime effects of this flaw? For example, there are four node=0,1,2,3, and nid = 1 is offline node,nr_online_nodes = 3 1) per-node alloc (hugepages=1:2) fails, 2) per-node alloc (hugepages=3:2) fails, but it could succeed. I assume that there is no user-visible runtime effects. > .