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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C567BC10F29 for ; Tue, 17 Mar 2020 13:20:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 89F6820752 for ; Tue, 17 Mar 2020 13:20:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89F6820752 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 398C46B0008; Tue, 17 Mar 2020 09:20:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 322786B000A; Tue, 17 Mar 2020 09:20:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 210636B000C; Tue, 17 Mar 2020 09:20:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0027.hostedemail.com [216.40.44.27]) by kanga.kvack.org (Postfix) with ESMTP id 096946B0008 for ; Tue, 17 Mar 2020 09:20:55 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D1CF4181AC9B6 for ; Tue, 17 Mar 2020 13:20:54 +0000 (UTC) X-FDA: 76604914428.05.ducks79_2503f226bb628 X-HE-Tag: ducks79_2503f226bb628 X-Filterd-Recvd-Size: 5952 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Mar 2020 13:20:54 +0000 (UTC) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02HD4FqD148238 for ; Tue, 17 Mar 2020 09:20:53 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yrt352uyp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 17 Mar 2020 09:20:52 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Mar 2020 13:20:50 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 17 Mar 2020 13:20:47 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02HDKkMk55050322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Mar 2020 13:20:46 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4DB5DA4060; Tue, 17 Mar 2020 13:20:46 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1331CA4054; Tue, 17 Mar 2020 13:20:43 +0000 (GMT) Received: from srikart450.in.ibm.com (unknown [9.85.71.34]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 17 Mar 2020 13:20:42 +0000 (GMT) From: Srikar Dronamraju To: Andrew Morton Cc: Srikar Dronamraju , linux-mm@kvack.org, Mel Gorman , Michael Ellerman , Sachin Sant , Michal Hocko , Christopher Lameter , linuxppc-dev@lists.ozlabs.org, Joonsoo Kim , Kirill Tkhai , Vlastimil Babka , Bharata B Rao Subject: [PATCH 3/4] mm: Implement reset_numa_mem Date: Tue, 17 Mar 2020 18:47:52 +0530 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200317131753.4074-1-srikar@linux.vnet.ibm.com> References: <3381CD91-AB3D-4773-BA04-E7A072A63968@linux.vnet.ibm.com> <20200317131753.4074-1-srikar@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 20031713-0016-0000-0000-000002F2929B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20031713-0017-0000-0000-00003356131A Message-Id: <20200317131753.4074-4-srikar@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.645 definitions=2020-03-17_04:2020-03-17,2020-03-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=974 mlxscore=0 spamscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003170056 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: For a memoryless or offline nodes, node_numa_mem refers to a N_MEMORY fallback node. Currently kernel has an API set_numa_mem that sets node_numa_mem for memoryless node. However this API cannot be used for offline nodes. Hence all offline nodes will have their node_numa_mem set to 0. However systems can themselves have node 0 as offline i.e memoryless and cpuless at this time. In such cases, node_to_mem_node() fails to provide a N_MEMORY fallback node. Mitigate this by having a new API that sets the default node_numa_mem for offline nodes to be first_memory_node. Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: Mel Gorman Cc: Michael Ellerman Cc: Sachin Sant Cc: Michal Hocko Cc: Christopher Lameter Cc: linuxppc-dev@lists.ozlabs.org Cc: Joonsoo Kim Cc: Kirill Tkhai Cc: Vlastimil Babka Cc: Srikar Dronamraju Cc: Bharata B Rao Reported-by: Sachin Sant Tested-by: Sachin Sant Signed-off-by: Srikar Dronamraju --- include/asm-generic/topology.h | 3 +++ include/linux/topology.h | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index 238873739550..e803ee7850e6 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h @@ -68,6 +68,9 @@ #ifndef set_numa_mem #define set_numa_mem(node) #endif +#ifndef reset_numa_mem +#define reset_numa_mem(node) +#endif #ifndef set_cpu_numa_mem #define set_cpu_numa_mem(cpu, node) #endif diff --git a/include/linux/topology.h b/include/linux/topology.h index eb2fe6edd73c..bebda80038bf 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -147,6 +147,13 @@ static inline int node_to_mem_node(int node) } #endif +#ifndef reset_numa_mem +static inline void reset_numa_mem(int node) +{ + _node_numa_mem_[node] = first_memory_node; +} +#endif + #ifndef numa_mem_id /* Returns the number of the nearest Node with memory */ static inline int numa_mem_id(void) -- 2.18.1 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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 919C2C10F29 for ; Tue, 17 Mar 2020 14:21:58 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4AC0D20663 for ; Tue, 17 Mar 2020 14:21:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AC0D20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48hb2q06k5zDqfW for ; Wed, 18 Mar 2020 01:21:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=srikar@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48hYhS5GNDzDqdb for ; Wed, 18 Mar 2020 00:20:56 +1100 (AEDT) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02HDB5X4141111 for ; Tue, 17 Mar 2020 09:20:54 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ytgkv9pgp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 17 Mar 2020 09:20:53 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Mar 2020 13:20:50 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 17 Mar 2020 13:20:47 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02HDKkMk55050322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Mar 2020 13:20:46 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4DB5DA4060; Tue, 17 Mar 2020 13:20:46 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1331CA4054; Tue, 17 Mar 2020 13:20:43 +0000 (GMT) Received: from srikart450.in.ibm.com (unknown [9.85.71.34]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 17 Mar 2020 13:20:42 +0000 (GMT) From: Srikar Dronamraju To: Andrew Morton Subject: [PATCH 3/4] mm: Implement reset_numa_mem Date: Tue, 17 Mar 2020 18:47:52 +0530 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200317131753.4074-1-srikar@linux.vnet.ibm.com> References: <3381CD91-AB3D-4773-BA04-E7A072A63968@linux.vnet.ibm.com> <20200317131753.4074-1-srikar@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 20031713-0016-0000-0000-000002F2929B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20031713-0017-0000-0000-00003356131A Message-Id: <20200317131753.4074-4-srikar@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-17_04:2020-03-17, 2020-03-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=975 priorityscore=1501 malwarescore=0 phishscore=0 adultscore=0 impostorscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003170058 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sachin Sant , Srikar Dronamraju , Michal Hocko , linux-mm@kvack.org, Kirill Tkhai , Mel Gorman , Christopher Lameter , Bharata B Rao , linuxppc-dev@lists.ozlabs.org, Joonsoo Kim , Vlastimil Babka Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" For a memoryless or offline nodes, node_numa_mem refers to a N_MEMORY fallback node. Currently kernel has an API set_numa_mem that sets node_numa_mem for memoryless node. However this API cannot be used for offline nodes. Hence all offline nodes will have their node_numa_mem set to 0. However systems can themselves have node 0 as offline i.e memoryless and cpuless at this time. In such cases, node_to_mem_node() fails to provide a N_MEMORY fallback node. Mitigate this by having a new API that sets the default node_numa_mem for offline nodes to be first_memory_node. Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: Mel Gorman Cc: Michael Ellerman Cc: Sachin Sant Cc: Michal Hocko Cc: Christopher Lameter Cc: linuxppc-dev@lists.ozlabs.org Cc: Joonsoo Kim Cc: Kirill Tkhai Cc: Vlastimil Babka Cc: Srikar Dronamraju Cc: Bharata B Rao Reported-by: Sachin Sant Tested-by: Sachin Sant Signed-off-by: Srikar Dronamraju --- include/asm-generic/topology.h | 3 +++ include/linux/topology.h | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index 238873739550..e803ee7850e6 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h @@ -68,6 +68,9 @@ #ifndef set_numa_mem #define set_numa_mem(node) #endif +#ifndef reset_numa_mem +#define reset_numa_mem(node) +#endif #ifndef set_cpu_numa_mem #define set_cpu_numa_mem(cpu, node) #endif diff --git a/include/linux/topology.h b/include/linux/topology.h index eb2fe6edd73c..bebda80038bf 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -147,6 +147,13 @@ static inline int node_to_mem_node(int node) } #endif +#ifndef reset_numa_mem +static inline void reset_numa_mem(int node) +{ + _node_numa_mem_[node] = first_memory_node; +} +#endif + #ifndef numa_mem_id /* Returns the number of the nearest Node with memory */ static inline int numa_mem_id(void) -- 2.18.1