From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756013AbcKVOUV (ORCPT ); Tue, 22 Nov 2016 09:20:21 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47070 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755592AbcKVOUS (ORCPT ); Tue, 22 Nov 2016 09:20:18 -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 Subject: [DEBUG 05/12] powerpc/mm: Identify coherent device memory nodes during platform init Date: Tue, 22 Nov 2016 19:49:41 +0530 X-Mailer: git-send-email 2.1.0 In-Reply-To: <1479824388-30446-1-git-send-email-khandual@linux.vnet.ibm.com> References: <1479824388-30446-1-git-send-email-khandual@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16112214-0052-0000-0000-000001F06BA0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16112214-0053-0000-0000-000007458A7B Message-Id: <1479824388-30446-6-git-send-email-khandual@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-22_07:,, 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-1609300000 definitions=main-1611220255 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 31efc27..b625e0e 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); -- 1.8.3.1