Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp643548imm; Thu, 31 May 2018 07:02:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKKlQ0WPTmtcgNXKjosbb7d1LjlnzEa7TQPVH390acEqhZE2GSv9XAFyqi0dlpcWYfkMSSi X-Received: by 2002:a17:902:5851:: with SMTP id f17-v6mr7252963plj.32.1527775341272; Thu, 31 May 2018 07:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527775341; cv=none; d=google.com; s=arc-20160816; b=iNtJwHDUg9PQqDNbTd/Qro2ZrG5+yLokS6mPT3otZHJq76gH1oC5UOnf1rC7XnWqEW S66lc7+pAfvanXQEvDxmou983Yt0298FENkkvHn6x1bncF0JhzZKAD+aGgPDN2tZkO5u d46x4ufvPxUh7PJP1gFHgYXc8OoGQqKe+UhuB6kmU0NRfW3Oqtv/qty6g15JN7nq+COh gMMwVtWjCuLzQraeROjvpPZQBYEBhKx2aGyv4X1eOmCnnAfxDd2WptiYWNSGR1QBbMBm 1bix+KjvD7B25WkDPku2mgMJLMDCP8d8XYSG2hKPu47vb+hc0UsZUflbY7L2qLDb+MxG S0Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=WS0KEgooywJ4i9Tw2O0WwBReEF45GvQu2odHQprqwkk=; b=QlkN7IUclz+NaQqOVJj0RJIqhoGWRf6kdeb8OaGewdU4x0My6dPjbhYykieQALS6UZ jPGxABaxuVvI6caZuE1wiqOcYGX6joq6l28YjFzGfLvl7T7i8Do4+lmPwmYdHIppo80r QthEY91XHVwNKMZikiIJIl5DJTs0SPpuwldIE4b7MItb0bf5qW95aneEQpgKRI5jq82H CUyVZXhbip5st7I0Hj813eoErHZE7TXxCvCv+tCwvEuWdNa+xKbzeOfMhXB8mRKxCEZk 97TJn0nlTN5VmVsvskkqsFdh8wTLyZ5r3zrOhdI+vSywyecWemU12KHBdDx4YgWv1cRG 1VCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m28-v6si3009611pgn.197.2018.05.31.07.02.05; Thu, 31 May 2018 07:02:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755311AbeEaOBL (ORCPT + 99 others); Thu, 31 May 2018 10:01:11 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:59171 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755103AbeEaOBK (ORCPT ); Thu, 31 May 2018 10:01:10 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A316EEB0A101B; Thu, 31 May 2018 22:01:06 +0800 (CST) Received: from [127.0.0.1] (10.177.223.23) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Thu, 31 May 2018 22:01:00 +0800 Subject: Re: [PATCH 0/2] arm64/drivers: avoid alloc memory on offline node To: Xie XiuQi , , , , , , CC: , , , References: <1527768879-88161-1-git-send-email-xiexiuqi@huawei.com> From: Hanjun Guo Message-ID: <65b32f11-6c83-3497-3cbf-3d3688195291@huawei.com> Date: Thu, 31 May 2018 22:00:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1527768879-88161-1-git-send-email-xiexiuqi@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.223.23] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Xiuqi, On 2018/5/31 20:14, Xie XiuQi wrote: > A numa system may return node which is not online. > For example, a numa node: > 1) without memory > 2) NR_CPUS is very small, and the cpus on the node are not brought up I think adding detail info will be easy to be understood: - NUMA node will be built if CPUs and (or) memory are valid on this NUMA node; - But if we boot the system with memory-less node and also with CONFIG_NR_CPUS less than CPUs in SRAT, for example, 64 CPUs total with 4 NUMA nodes, 16 CPUs on each NUMA node, if we boot with CONFIG_NR_CPUS=48, then we will not built numa node for node 3, but with devices on that numa node, alloc memory will be panic because NUMA node 3 is not a valid node. > > In this situation, we use NUMA_NO_NODE to avoid oops. [snip] > > Xie XiuQi (2): > arm64: avoid alloc memory on offline node > drivers: check numa node's online status in dev_to_node I think we still missing devices like SMMU, ITS, so how about check the numa node online in the core memory allocation such as kmalloc_node()? Thanks Hanjun