From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by kanga.kvack.org (Postfix) with ESMTP id 828A66B295A for ; Wed, 21 Nov 2018 23:02:17 -0500 (EST) Received: by mail-pl1-f199.google.com with SMTP id x21-v6so5523503pln.10 for ; Wed, 21 Nov 2018 20:02:17 -0800 (PST) Received: from esa8.dell-outbound.iphmx.com (esa8.dell-outbound.iphmx.com. [68.232.149.218]) by mx.google.com with ESMTPS id b26si19460651pgl.539.2018.11.21.20.02.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 20:02:16 -0800 (PST) Received: from pps.filterd (m0142693.ppops.net [127.0.0.1]) by mx0a-00154901.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAM3wegK169135 for ; Wed, 21 Nov 2018 23:02:15 -0500 Received: from esa4.dell-outbound2.iphmx.com (esa4.dell-outbound2.iphmx.com [68.232.154.98]) by mx0a-00154901.pphosted.com with ESMTP id 2nw8vxuqy5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 21 Nov 2018 23:02:14 -0500 From: "Wang, Matt" Subject: Make __memblock_free_early a wrapper of memblock_free rather dup it Date: Thu, 22 Nov 2018 04:01:53 +0000 Message-ID: Content-Language: en-US Content-Type: multipart/mixed; boundary="_004_C8ECE1B7A767434691FEEFA3A01765D72AFB8E78MX203CL03corpem_" MIME-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: "akpm@linux-foundation.org" Cc: "linux-mm@kvack.org" --_004_C8ECE1B7A767434691FEEFA3A01765D72AFB8E78MX203CL03corpem_ Content-Type: multipart/alternative; boundary="_000_C8ECE1B7A767434691FEEFA3A01765D72AFB8E78MX203CL03corpem_" --_000_C8ECE1B7A767434691FEEFA3A01765D72AFB8E78MX203CL03corpem_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Andrew, I noticed that __memblock_free_early and memblock_free has the same code. A= t first I think we can delete __memblock_free_early till __memblock_free_la= te remind me __memblock_free_early is meaningful. It's a note to call this = before struct page was initialized. So I choose to make __memblock_free_early a wrapper of memblock_free. Here = is the patch (see attachment file): >>From 5f21fb0409e91b42373832627e44cd0a8275c820 Mon Sep 17 00:00:00 2001 From: Wentao Wang Date: Thu, 22 Nov 2018 11:35:59 +0800 Subject: [PATCH] Make __memblock_free_early a wrapper of memblock_free rath= er than dup it Signed-off-by: Wentao Wang --- mm/memblock.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index 9a2d5ae..08bf136 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1546,12 +1546,7 @@ void * __init memblock_alloc_try_nid( */ void __init __memblock_free_early(phys_addr_t base, phys_addr_t size) { - phys_addr_t end =3D base + size - 1; - - memblock_dbg("%s: [%pa-%pa] %pF\n", - __func__, &base, &end, (void *)_RET_IP_); - kmemleak_free_part_phys(base, size); - memblock_remove_range(&memblock.reserved, base, size); + memblock_free(base, size); } /** -- 1.8.3.1 Testing: Build with memblock, system bootup normally and works well. Regards, Wentao --_000_C8ECE1B7A767434691FEEFA3A01765D72AFB8E78MX203CL03corpem_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Andrew,

 

I noticed that __memblock_free_early and memblock_fr= ee has the same code. At first I think we can delete __memblock_free_early = till __memblock_free_late remind me __memblock_free_early is meaningful. It= ’s a note to call this before struct page was initialized.

 

So I choose to make __memblock_free_early a wrapper = of memblock_free. Here is the patch (see attachment file):

 

From 5f21fb0409e91b42373832627e44cd0a8275c820 Mon Se= p 17 00:00:00 2001

From: Wentao Wang <witallwang@gmail.com><= /o:p>

Date: Thu, 22 Nov 2018 11:35:59 +0800=

Subject: [PATCH] Make __memblock_free_early a wrappe= r of memblock_free rather

than dup it

 

Signed-off-by: Wentao Wang <witallwang@gmail.com&= gt;

---

mm/memblock.c | 7 +------

1 file changed, 1 insertion(+), 6 deletions(-)

 

diff --git a/mm/memblock.c b/mm/memblock.c

index 9a2d5ae..08bf136 100644

--- a/mm/memblock.c

+++ b/mm/memblock.c

@@ -1546,12 +1546,7 @@ void * __init memblock_al= loc_try_nid(

  */

void __init __memblock_free_early(phys_addr_t base, = phys_addr_t size)

{

-       phys_addr_t en= d =3D base + size - 1;

-

-       memblock_dbg(&= quot;%s: [%pa-%pa] %pF\n",

-        &nb= sp;           __func__, &= amp;base, &end, (void *)_RET_IP_);

-       kmemleak_free_= part_phys(base, size);

-       memblock_remov= e_range(&memblock.reserved, base, size);

+       memblock_f= ree(base, size);

}

 

/**

--

1.8.3.1

 

Testing:

Build with memblock, system bootup normally and work= s well.

 

Regards,

Wentao

 

--_000_C8ECE1B7A767434691FEEFA3A01765D72AFB8E78MX203CL03corpem_-- --_004_C8ECE1B7A767434691FEEFA3A01765D72AFB8E78MX203CL03corpem_ Content-Type: application/octet-stream; name="0001-Make-__memblock_free_early-a-wrapper-of-memblock_fre.patch" Content-Description: 0001-Make-__memblock_free_early-a-wrapper-of-memblock_fre.patch Content-Disposition: attachment; filename="0001-Make-__memblock_free_early-a-wrapper-of-memblock_fre.patch"; size=900; creation-date="Thu, 22 Nov 2018 03:51:59 GMT"; modification-date="Thu, 22 Nov 2018 03:51:59 GMT" Content-Transfer-Encoding: base64 RnJvbSA1ZjIxZmIwNDA5ZTkxYjQyMzczODMyNjI3ZTQ0Y2QwYTgyNzVjODIwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBXZW50YW8gV2FuZyA8d2l0YWxsd2FuZ0BnbWFpbC5jb20+CkRh dGU6IFRodSwgMjIgTm92IDIwMTggMTE6MzU6NTkgKzA4MDAKU3ViamVjdDogW1BBVENIXSBNYWtl IF9fbWVtYmxvY2tfZnJlZV9lYXJseSBhIHdyYXBwZXIgb2YgbWVtYmxvY2tfZnJlZSByYXRoZXIK IH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