Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3110062ybv; Sun, 9 Feb 2020 15:41:26 -0800 (PST) X-Google-Smtp-Source: APXvYqwa1qWMP5wVqpYDMO/epfZdzPhI5oh8h/fUSZNJ76DZnG9l3cZDthIGYffgzclR37wuuDe9 X-Received: by 2002:a9d:20c1:: with SMTP id x59mr8488471ota.286.1581291686606; Sun, 09 Feb 2020 15:41:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581291686; cv=none; d=google.com; s=arc-20160816; b=QpKEU0vNNrUkxKDAt9qKNnD2YFaBpX5w5/mdGt+Et46OC3f+4NLhXdv6ngm9a/tVyD +Y008kgt9ylGHavPtigCQYdGHbaTnS26t2GlGLvlmvbKdhsGDhpJxfIhOnlEDmleqhSp yvu34pB1rlKQOQ+NMjmzBQjivK4LMZ5N3+2chZ/KMofkIsjK0XneWCLVaV2Ru48vACvM fzuekX83Cf8V7fYh/HL14uATHQ1/0AEW697MTrcureqZMp94UiiZFYudUrUQPhOJANYC OUOapIS6syIpoPhHjoLJDn4hrX+VIA1ZEjnXzeIxFSIraRAEoncjyH4Kx+BKAfs5a5iA JZxw== 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=yFO7xhqv7sN0zes0sNGrhk8hEEr3cN+G+DH59ASxVQM=; b=iWGnZ7fnAL6xrpEKHwOdw7aPnoDQnq6BECKOpISvkqTpjjn/71Hp+PPqPpdCrW1CEI WlFPxTDTyXGnboOiQhceVyFAa489G8JDOVid29wxDQh8sWOdoXBnZXFSUUpOZLd6iAa5 SNFT0lcUuD5HN0Ix7HKhl1G8jZBm/CKvYnih9/g7lHodidtQBtZvB/14HJLZcDd5Holy AaWCZgDLYaGIdZP+pmFJmBjsR+HtJvzOWipJvCzZY4d9KbCzJI7wepqezUTsSkcDP+1g 8Q6F19QRvA4HIliZ9wvg82soRtXfuR2ESEatYVVdKNPZDh7fATVtyWremtJaLJN6DdRN FTeg== 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 7si6773274oix.49.2020.02.09.15.41.02; Sun, 09 Feb 2020 15:41:26 -0800 (PST) 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 S1727003AbgBIXjV (ORCPT + 99 others); Sun, 9 Feb 2020 18:39:21 -0500 Received: from mga18.intel.com ([134.134.136.126]:23461 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726861AbgBIXjV (ORCPT ); Sun, 9 Feb 2020 18:39:21 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2020 15:39:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,423,1574150400"; d="scan'208";a="405416746" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga005.jf.intel.com with ESMTP; 09 Feb 2020 15:39:17 -0800 Date: Mon, 10 Feb 2020 07:39:35 +0800 From: Wei Yang To: Baoquan He Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, dan.j.williams@intel.com, richardw.yang@linux.intel.com, david@redhat.com Subject: Re: [PATCH 4/7] mm/sparse.c: Use __get_free_pages() instead in populate_section_memmap() Message-ID: <20200209233935.GB8705@richard> Reply-To: Wei Yang References: <20200209104826.3385-1-bhe@redhat.com> <20200209104826.3385-5-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200209104826.3385-5-bhe@redhat.com> 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 Sun, Feb 09, 2020 at 06:48:23PM +0800, Baoquan He wrote: >This removes the unnecessary goto, and simplify codes. > >Signed-off-by: Baoquan He Reasonable. Reviewed-by: Wei Yang >--- > mm/sparse.c | 16 ++++++---------- > 1 file changed, 6 insertions(+), 10 deletions(-) > >diff --git a/mm/sparse.c b/mm/sparse.c >index cf55d272d0a9..36e6565ec67e 100644 >--- a/mm/sparse.c >+++ b/mm/sparse.c >@@ -751,23 +751,19 @@ static void free_map_bootmem(struct page *memmap) > struct page * __meminit populate_section_memmap(unsigned long pfn, > unsigned long nr_pages, int nid, struct vmem_altmap *altmap) > { >- struct page *page, *ret; >+ struct page *ret; > unsigned long memmap_size = sizeof(struct page) * PAGES_PER_SECTION; > >- page = alloc_pages(GFP_KERNEL|__GFP_NOWARN, get_order(memmap_size)); >- if (page) >- goto got_map_page; >+ ret = (void*)__get_free_pages(GFP_KERNEL|__GFP_NOWARN, >+ get_order(memmap_size)); >+ if (ret) >+ return ret; > > ret = vmalloc(memmap_size); > if (ret) >- goto got_map_ptr; >+ return ret; > > return NULL; >-got_map_page: >- ret = (struct page *)pfn_to_kaddr(page_to_pfn(page)); >-got_map_ptr: >- >- return ret; > } > > static void depopulate_section_memmap(unsigned long pfn, unsigned long nr_pages, >-- >2.17.2 -- Wei Yang Help you, Help me