From patchwork Thu Nov 22 04:01:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Matt" X-Patchwork-Id: 10693471 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F9C216B1 for ; Thu, 22 Nov 2018 04:02:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 296EB2CB9D for ; Thu, 22 Nov 2018 04:02:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D6592CBA8; Thu, 22 Nov 2018 04:02:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D855D2CB9D for ; Thu, 22 Nov 2018 04:02:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E1FC06B295A; Wed, 21 Nov 2018 23:02:17 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DD0696B295B; Wed, 21 Nov 2018 23:02:17 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C71AA6B295C; Wed, 21 Nov 2018 23:02:17 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:dkim-signature:to:cc:subject :thread-topic:thread-index:date:message-id:accept-language :content-language:mime-version; bh=2MOiwuJYzCfZE6fvcjMA8Pu7jGHi9Ol6O4fABIcL5nM=; b=LlNrcCW1p3EbkmSS2axlo/lV+m/BxXkS4MgsGISrDlc9UjkeyFE+gWk2cIthUNSDgA XrCtsHzXfv/IbOl8ji1RtxFwE+7sj67Tdc9u9Tr4hZucxw20dQ/61AKVDwMcobmFJMAp iZV8d7xex4YE9ASd7Ierdh4Fkrdl/CrDR5NN47nAmltxuPeX5IIfNjTs0HHRYOoB4nEN AbvG10ukwDqZmRO1qibGrnMWnelPu+QEATz3rE353rEKNstfJ7FD+NQburrjMAgd5glx qARALenesWWwqlHUfB8ZLyX/NbSTPLjIhx9iolDr3jAGKWzjnuxKcuZeBFyGUh8PQPdc CN3g== X-Gm-Message-State: AA+aEWYTAbHJExehks+rq5ngKTwLyHyJn+S9oL/L+1roimt9BhpFt6AF RxOnVptEMJ8z6TzhQX4i88tKdqzgrGbK8MccbaxkJ2Hkx3VsFs74kB4BP3N6oVPTttyBDXtWhJa PWxIq83exqTPIxEm7gYcixTkMnxNjXcjduZcJUg7VWVlJu+bhypTiwwduyntf77AJDQ== X-Received: by 2002:a17:902:6f09:: with SMTP id w9mr9861718plk.309.1542859337185; Wed, 21 Nov 2018 20:02:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/WU20VYokAQg/vclBgEoy22/P0QQ9GnV7M22eGe2Pg9rGLC0HGCaQQjbZAkWTxXIf+9YnUr X-Received: by 2002:a17:902:6f09:: with SMTP id w9mr9861674plk.309.1542859336449; Wed, 21 Nov 2018 20:02:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542859336; cv=none; d=google.com; s=arc-20160816; b=kpukM2XlRvSKcTOPdFIpMq2PaVCThr+YbDNN56IxYXiTundQ9iOtx8BRNGd37NI/kE ePIISwEtw4klMoqcdpsCRRDQ/Ak0do9GgNwaJ51CNrKh/dMrWPSzcjjwQsPVlVp+GlJp 9+rjtrUvvcFXyQlpGFehC7W/KOq50wuPFBJd+XnonIxSTW0xruY2pF/I5JQzlAZqyNjA dwjuHoHkiC7JS2ZOXOEbyrawYTHGUys0u8750HrakwVflnh6UCFxugQJTwmrizv7QBJh gUdfFCycKRYLjsWE0owqD9LNUO8pmWoKaTAgVEeTuGTCqXMz6020vFW7yrN4ASyAnJo6 i2ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-language:accept-language:message-id:date :thread-index:thread-topic:subject:cc:to:dkim-signature:from :dkim-signature; bh=2MOiwuJYzCfZE6fvcjMA8Pu7jGHi9Ol6O4fABIcL5nM=; b=G04xiLY09cDFHi6B7WaHfTXzMho6CejDZJlELpPT5RbMme0tYuT6R40HK7BUra+fJ8 06S/KedrGq/duZJi9BvHmgtiD9erln/OhpSsmgA3WZHVCOwL1vwXrX+pVW8Enn+WdiYG oDEu//s2RF69EvlZ5HfePtxUGv8+5ckOPobh/WaMn/xBHc2lsQv8dO0X4ki7cs9VlzMX 0txW9kuOTMiLTYVlyRqQvA6vwF4397HNJse4S2O/kQFGArn/o6E5fJftHFqLH6ynOy6h byUvMrhe65BtfPqhuNB/RwzZ0fe5dEwmh2JXsFGr+Y7TzrSPC4EZUXbvypKpunLQOSmr G9Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dell.com header.s=smtpout header.b=Qk4DqzQv; dkim=fail header.i=@emc.com header.s=jan2013 header.b=t6h2YywC; spf=pass (google.com: domain of matt.wang@dell.com designates 68.232.149.218 as permitted sender) smtp.mailfrom=Matt.Wang@dell.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dell.com 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-SPF: pass (google.com: domain of matt.wang@dell.com designates 68.232.149.218 as permitted sender) client-ip=68.232.149.218; Authentication-Results: mx.google.com; dkim=pass header.i=@dell.com header.s=smtpout header.b=Qk4DqzQv; dkim=fail header.i=@emc.com header.s=jan2013 header.b=t6h2YywC; spf=pass (google.com: domain of matt.wang@dell.com designates 68.232.149.218 as permitted sender) smtp.mailfrom=Matt.Wang@dell.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dell.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1542859336; x=1574395336; h=from:to:cc:subject:date:message-id:mime-version; bh=ph66hEos14nHE3sstx2rzAwQz0iDAmYaFq9XBeIqb74=; b=Qk4DqzQv+gAbth+ZF8Qe8UVRVO4sh7zO/rv7QDqu55oNTWboy1vo63lo Oi/q2yBDGUxtPv0ZAhlhhtV9CiFy83Q07m8PSZ4nsE1Nyem3UND/Ia8op fEZk9R8ODg0wgrFt+ua3GgNIqrJSar5qvfyww7lnLGyqPy4zaxSnEA7bB w=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2EOAAA9KfZbhyeV50NiHQEBBQEHBQGBUQgBCwGBDSOBOYECJwqMBl+WN4k4hHeBPzsIAwEBLoQ+AoQLIjQJDQEDAQECAQECAQECEAEBAQoLCQgpIwELgjYiEk0vCTMBAQEBAQEBAQEBAQEBAQEBAQEXAkMTAQEYAQIBFRsTHxoBEQEZAwECCyYfER0JAQQOBQgGFIJ/AYEcTQMVAZ5vAoEQiVgBAQGCHYJ9hQQNggoHCIJth1gkgRyBWD6BV4UigioVCYMVgiaPAl6PcS4DBAIChB+JYoNDkQYsDI4TiToCBAIEBQIUgUaCDnCDPIInDgmDSopSQTGNU4EfAQE X-IPAS-Result: A2EOAAA9KfZbhyeV50NiHQEBBQEHBQGBUQgBCwGBDSOBOYECJwqMBl+WN4k4hHeBPzsIAwEBLoQ+AoQLIjQJDQEDAQECAQECAQECEAEBAQoLCQgpIwELgjYiEk0vCTMBAQEBAQEBAQEBAQEBAQEBAQEXAkMTAQEYAQIBFRsTHxoBEQEZAwECCyYfER0JAQQOBQgGFIJ/AYEcTQMVAZ5vAoEQiVgBAQGCHYJ9hQQNggoHCIJth1gkgRyBWD6BV4UigioVCYMVgiaPAl6PcS4DBAIChB+JYoNDkQYsDI4TiToCBAIEBQIUgUaCDnCDPIInDgmDSopSQTGNU4EfAQE Received: from mx0a-00154901.pphosted.com ([67.231.149.39]) by esa8.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Nov 2018 22:02:15 -0600 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" Received: from mailuogwdur.emc.com ([128.221.224.79]) by esa4.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 22 Nov 2018 10:02:13 +0600 Received: from maildlpprd55.lss.emc.com (maildlpprd55.lss.emc.com [10.106.48.159]) by mailuogwprd54.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id wAM42ABl027795 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 21 Nov 2018 23:02:12 -0500 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd54.lss.emc.com wAM42ABl027795 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=emc.com; s=jan2013; t=1542859333; bh=nYT+f1ECxnUPpbOb1vfvLOU1go0=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=t6h2YywCsMiW7TeVov7GWm/BSnw3qCSWmA+X5i3jhh8/rqmYxgXgk1IGspUzzZLtJ G0oP0HwTsNlKDylak8G4xD9ZlocRMmzQflXlW3kjhIXC/eCXQ3V5OwJVh2W1/JFLp3 mD44220zi2C/jr//pK42Tw5+gTt+6Pkbha00SjDQ= X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd54.lss.emc.com wAM42ABl027795 Received: from mailusrhubprd03.lss.emc.com (mailusrhubprd03.lss.emc.com [10.253.24.21]) by maildlpprd55.lss.emc.com (RSA Interceptor); Wed, 21 Nov 2018 23:01:54 -0500 Received: from MXHUB101.corp.emc.com (MXHUB101.corp.emc.com [10.253.50.15]) by mailusrhubprd03.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id wAM41sTE018886 (version=TLSv1.2 cipher=AES128-SHA256 bits=128 verify=FAIL); Wed, 21 Nov 2018 23:01:55 -0500 Received: from MX203CL03.corp.emc.com ([fe80::4dee:b763:b476:8fbc]) by MXHUB101.corp.emc.com ([::1]) with mapi id 14.03.0399.000; Wed, 21 Nov 2018 23:01:54 -0500 To: "akpm@linux-foundation.org" CC: "linux-mm@kvack.org" Subject: Make __memblock_free_early a wrapper of memblock_free rather dup it Thread-Topic: Make __memblock_free_early a wrapper of memblock_free rather dup it Thread-Index: AdSCF1OVzSZ2Dr13S6Segi6rVNOaHg== Date: Thu, 22 Nov 2018 04:01:53 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.32.218.55] MIME-Version: 1.0 X-Sentrion-Hostname: mailusrhubprd03.lss.emc.com X-RSA-Classifications: public X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-22_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=774 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811220036 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Hi Andrew, I noticed that __memblock_free_early and memblock_free 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 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 rather than dup it Signed-off-by: Wentao Wang Signed-off-by: Mike Rapoport Signed-off-by: Mike Rapoport --- mm/memblock.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- 1.8.3.1 Testing: Build with memblock, system bootup normally and works well. Regards, Wentao 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 = 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); } /**