Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1095550ybe; Thu, 19 Sep 2019 08:33:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWbY/ffFnt5RRdkjjZfCig2OzOZl0hyAHoa6aCR4vD23riicmn4YlWI2nkKmF7A0/KnkQo X-Received: by 2002:a17:906:cc9b:: with SMTP id oq27mr13775302ejb.125.1568907188945; Thu, 19 Sep 2019 08:33:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568907188; cv=none; d=google.com; s=arc-20160816; b=dNnMxDETw/PU5pqulF2K3ZKNMYzlzi93kJv5UW/CT2tlJukIDXCOYDbGobHyYk04Ga mN/UCK8axyEsqkXXlYFN3qBIjSx2jrIhj/prrao47+HYhslgEtSZ7D7PB9kCD5tOimdg jATsFfTXHum7VwfxXi+/0RN3z+XVQyLCRbXhbnuJdoYJ8om3awkBC0w0FRJstLzOeHVm 2fZqFekrdAKedp0CDvVXLESudWyKoemEPRiVkhf+ayUMwN6zj43r+/tQw6CHhPp+7HoB abggYzgLjFhgSjwkpt9JwsU1VhDh3phU/boKjzZ5mKwx5npNd4BpC4quiy41kIM/ikpI oWqg== 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; bh=WLyeprkmq2YKv11LV5Ds66C7y3hcifiiwwJmxx8b8uY=; b=t4nkL1GR7nOFPofeNlOAQihKmKjFtnQeR/VaWVL2hU84d7RKNIxWSkOlUcdQ+rCUO+ FwjIYhVYI9J13AoprFwcADRjHHaAt7ZI4Tz/MRWVpDdWeqsAnwvhsPjX4T+NLv7Op3KF mBKgammffLMKEyVA0VtcWaBNI4SwF3XGv+usRgUeOiMW+GdUg0CwRVtQt1MIsAhkeB4U EWCfB7JEQCTe+op+4zFKbCG0uyAIMcI6xKCcfS8xs9ykiSz4km/+TZSKPUx+BzLSzLXN kNYWPhk6pHSliE/w0W+TnxuDEbm44EZm1Qr+sWE9nORzFfY7Od3/sCz2kdLLp48eoUof QCeg== 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 q20si4826846ejn.18.2019.09.19.08.32.45; Thu, 19 Sep 2019 08:33:08 -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 S2389910AbfISLdx (ORCPT + 99 others); Thu, 19 Sep 2019 07:33:53 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2737 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388015AbfISLdx (ORCPT ); Thu, 19 Sep 2019 07:33:53 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id CB98343A971F55E9DBF1; Thu, 19 Sep 2019 19:33:51 +0800 (CST) Received: from [127.0.0.1] (10.177.251.225) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.439.0; Thu, 19 Sep 2019 19:33:50 +0800 Subject: Re: [PATCH] mm: Support memblock alloc on the exact node for sparse_buffer_init() To: Wei Yang CC: , , , , , , , , References: <20190918065140.GA5446@richard> <20190919003047.GA20697@richard> From: Yunfeng Ye Message-ID: Date: Thu, 19 Sep 2019 19:33:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190919003047.GA20697@richard> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.251.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/9/19 8:30, Wei Yang wrote: > On Wed, Sep 18, 2019 at 03:08:41PM +0800, Yunfeng Ye wrote: >> >> >> On 2019/9/18 14:51, Wei Yang wrote: >>> On Wed, Sep 18, 2019 at 12:22:29PM +0800, Yunfeng Ye wrote: >>>> Currently, when memblock_find_in_range_node() fail on the exact node, it >>>> will use %NUMA_NO_NODE to find memblock from other nodes. At present, >>>> the work is good, but when the large memory is insufficient and the >>>> small memory is enough, we want to allocate the small memory of this >>>> node first, and do not need to allocate large memory from other nodes. >>>> >>>> In sparse_buffer_init(), it will prepare large chunks of memory for page >>>> structure. The page management structure requires a lot of memory, but >>>> if the node does not have enough memory, it can be converted to a small >>>> memory allocation without having to allocate it from other nodes. >>>> >>>> Add %MEMBLOCK_ALLOC_EXACT_NODE flag for this situation. Normally, the >>>> behavior is the same with %MEMBLOCK_ALLOC_ACCESSIBLE, only that it will >>>> not allocate from other nodes when a single node fails to allocate. >>>> >>>> If large contiguous block memory allocated fail in sparse_buffer_init(), >>>> it will allocates small block memmory section by section later. >>>> >>> >>> Looks this changes current behavior even it fall back to section based >>> allocation. >>> >> When fall back to section allocation, it still use %MEMBLOCK_ALLOC_ACCESSIBLE >> ,I think the behavior is not change, Can you tell me the detail about the >> changes. thanks. >> > > You pass MEMBLOCK_ALLOC_EXACT_NODE for the first round allocation, which > forbid it allocates from other node. This is different from current behavior. > Am I right? > Most cases, it will not go to the %MEMBLOCK_ALLOC_EXACT_NODE allocate routine. so the behavior will not change. If current node have no large contiguous block memory, it will fall back to allocate memory based section. this is the different from current behavior. thanks. > . >