From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752145AbdA3DkD (ORCPT ); Sun, 29 Jan 2017 22:40:03 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34818 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751271AbdA3Dj5 (ORCPT ); Sun, 29 Jan 2017 22:39:57 -0500 From: Anshuman Khandual To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: mhocko@suse.com, vbabka@suse.cz, mgorman@suse.de, minchan@kernel.org, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, srikar@linux.vnet.ibm.com, haren@linux.vnet.ibm.com, jglisse@redhat.com, dave.hansen@intel.com, dan.j.williams@intel.com Subject: [DEBUG 13/21] powerpc/mm: Identify coherent device memory nodes during platform init Date: Mon, 30 Jan 2017 09:05:54 +0530 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170130033602.12275-1-khandual@linux.vnet.ibm.com> References: <20170130033602.12275-1-khandual@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17013003-1617-0000-0000-000001A22345 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17013003-1618-0000-0000-000047A423A4 Message-Id: <20170130033602.12275-14-khandual@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-30_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701300038 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Coherent device memory nodes will have "ibm,hotplug-aperture" as one of the compatible properties in their respective device nodes in the device tree. Detect them early during NUMA platform initialization and mark them as such in the node_to_phys_device_map[] array which in turn is used to support the arch_check_cdm_node() function for the core VM. Signed-off-by: Anshuman Khandual --- arch/powerpc/mm/numa.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 9c73fbe..6def078 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -41,10 +41,12 @@ #include #include +static int node_to_phys_device_map[MAX_NUMNODES]; + #ifdef CONFIG_COHERENT_DEVICE int arch_check_node_cdm(int nid) { - return 0; + return node_to_phys_device_map[nid]; } #endif @@ -790,6 +792,9 @@ static int __init parse_numa_properties(void) if (nid < 0) nid = default_nid; + if (of_device_is_compatible(memory, "ibm,hotplug-aperture")) + node_to_phys_device_map[nid] = 1; + fake_numa_create_new_node(((start + size) >> PAGE_SHIFT), &nid); node_set_online(nid); -- 2.9.3