Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3513126pxu; Sun, 11 Oct 2020 12:35:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUSSI5orWHnTbwBo0UnvocGbS5gaEaTbNkFqL6sQ9ZE0PWKBh1w6xc5ks19W0O38AUu/x8 X-Received: by 2002:a05:6402:651:: with SMTP id u17mr10219638edx.206.1602444950020; Sun, 11 Oct 2020 12:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602444950; cv=none; d=google.com; s=arc-20160816; b=ViP213q0pKkcDdNe4qwbzH/uLvhauHPFkeFdSt0YaOzUIZ0X1m4NK1gzkhLJ/w57xv MjTNMzv109yhi13p/fFlql7PIplZd4s81aZrAQoYZgdVg7CrZFed6FuXK2H5qidVqgAf a2gCDxX44tbWuSZlbvNLpSx0ygQovnGE7tWUnIhCcjLx8wfx1b0tqf+NY6Hpl9B3l6np UB/WerCV+RAXQXCetRc1ni5XKW4CF9l+szqfcsn0v2nHX0Khjr5VYUz86CC3D5Kxwk8X Rrf11dvi0c5Oy3ta6fzhlOZ7B5lR1qAck5GPEq2rIZ51D4PV3CQYoAJT4yCFWVEFE5KQ TLmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=IuoY7kuNsQYO/ApSku7NXwau2nqNnagkO3WgZod4uxg=; b=KVYcmraOfJRevvMqq/ZCsaISKaUrwzhV3qYo358gSQGJWI2WCFUDp8dlXEq/idiDhn E5s+Uph6g4eTGg4wkwHM0w/Bi6vxOJPlU0OuohOJn/nXpnHCgKmYu8YQqrmaOCdkxcCC ohJnMybEjg7mCfMOpb1ctsUamupL9E/olset13QTHS0ZYRylqB2rGMB+xt0DM46Hn+fW OcnS+A/m97pbTwOpz8UazF54bVibHzjD+4EgXPA9jNr9qOeLJIMc3Y/HyyKJ0oPmRGZf SDiFNZntypHXGhorhU84lme+LJv6iUG6luCsrs5r3PsmWOTtLwrV21S3rTBxV5CVbXNy aN5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si10399054ejn.61.2020.10.11.12.35.12; Sun, 11 Oct 2020 12:35:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726068AbgJKEVu (ORCPT + 99 others); Sun, 11 Oct 2020 00:21:50 -0400 Received: from smtp.h3c.com ([60.191.123.56]:24772 "EHLO h3cspam01-ex.h3c.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbgJKEVt (ORCPT ); Sun, 11 Oct 2020 00:21:49 -0400 Received: from DAG2EX03-BASE.srv.huawei-3com.com ([10.8.0.66]) by h3cspam01-ex.h3c.com with ESMTPS id 09B4LGgD040947 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 11 Oct 2020 12:21:16 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from localhost.localdomain (10.99.212.201) by DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 11 Oct 2020 12:21:18 +0800 From: Xianting Tian To: , CC: , , Xianting Tian Subject: [PATCH] net: Avoid allocing memory on memoryless numa node Date: Sun, 11 Oct 2020 12:11:40 +0800 Message-ID: <20201011041140.8945-1-tian.xianting@h3c.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.99.212.201] X-ClientProxiedBy: BJSMTP02-EX.srv.huawei-3com.com (10.63.20.133) To DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) X-DNSRBL: X-MAIL: h3cspam01-ex.h3c.com 09B4LGgD040947 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In architecture like powerpc, we can have cpus without any local memory attached to it. In such cases the node does not have real memory. Use local_memory_node(), which is guaranteed to have memory. local_memory_node is a noop in other architectures that does not support memoryless nodes. Signed-off-by: Xianting Tian --- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index 266073e30..dcb4533ef 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2590,7 +2590,7 @@ static struct xps_map *expand_xps_map(struct xps_map *map, int attr_index, new_map = kzalloc(XPS_MAP_SIZE(alloc_len), GFP_KERNEL); else new_map = kzalloc_node(XPS_MAP_SIZE(alloc_len), GFP_KERNEL, - cpu_to_node(attr_index)); + local_memory_node(cpu_to_node(attr_index))); if (!new_map) return NULL; -- 2.17.1