Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp339500ybe; Wed, 18 Sep 2019 18:28:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzY1mS1hJyfkA/nk3t8eDTdkva4+WCdbuZ+sH3YKQo/a//Zk6QZ1WpmfSOnyZWyryjtBxY+ X-Received: by 2002:a17:906:9703:: with SMTP id k3mr6715060ejx.159.1568856515481; Wed, 18 Sep 2019 18:28:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568856515; cv=none; d=google.com; s=arc-20160816; b=kgMNcEi24Eld4PxHUHn7SZ1XiCEFrDGCQvaFTkMK7CfF9l5CBYhf4VcA5nENraZlb6 0NXVvHRzAl60qjEnBJVB9vGOvuqtmv9D66f/ReKmlQGcypWgXsKjxyp4zYvZdqw18/pM deGIpQESH//slWhgq2+9J27R5aMhv6IRqO+9HOO8hV8xL0NsoHdEna9TIBzmt4uj+29R D7Ln2O2WdindRj7LqzUMhK2ZGNoK1jnPa+swhuc05uXMRTnQnxdcH8OxRDZiUBKpWQFk 4juIfDeoL0dwCBcRPhnm19jmO/U4S1wIR2IT/NUbRmpTz0/3rIyk/ddzoae6y+ZSvFW7 1vsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=RdESYJDzEGFyABJutLoIhQYejAfigl495b3lpFmkto4=; b=CXuDKAlIXMKxFeMVWHdv3wCjYn2QyhMGYI8BcYlEQh6X8DnCljaw9NWfSgu59LBKTK icN7GFnisnJdoIVFPQvwsiGkeBtS9HhKYraGyVdqh/Pw233A6vyB9fu+YYLLisXTMEmg Z0De921R3IfD9WbZC6HXhM1lznGJFU21eCy5Pnz7cgUXnjdFy1XsFv6FJjRP5tlJvZYI vqIc2H9An8q4/mqxyWNDci950gbEf0aNjdXCOcKYYaYwF3hsAn14qvm0/noMVUQUCfoM AYjFXGCH9WkfskbIdPavdgCFnO27f/Z/hdUptu8tL+rRVsy61bw9+Zzrrk727MRnAcQB SPRw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7si2978625ejr.99.2019.09.18.18.28.12; Wed, 18 Sep 2019 18:28:35 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730650AbfISAbJ (ORCPT + 99 others); Wed, 18 Sep 2019 20:31:09 -0400 Received: from mga01.intel.com ([192.55.52.88]:33665 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730015AbfISAbJ (ORCPT ); Wed, 18 Sep 2019 20:31:09 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2019 17:31:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,522,1559545200"; d="scan'208";a="177883572" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga007.jf.intel.com with ESMTP; 18 Sep 2019 17:31:06 -0700 Date: Thu, 19 Sep 2019 08:30:47 +0800 From: Wei Yang To: Yunfeng Ye Cc: Wei Yang , rppt@linux.ibm.com, akpm@linux-foundation.org, osalvador@suse.de, mhocko@suse.co, dan.j.williams@intel.com, david@redhat.com, cai@lca.pw, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: Support memblock alloc on the exact node for sparse_buffer_init() Message-ID: <20190919003047.GA20697@richard> Reply-To: Wei Yang References: <20190918065140.GA5446@richard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?