Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2593247imm; Thu, 16 Aug 2018 12:04:39 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy9p50LDU8LmwZCy6CogJ9R8ThP7WF/2PuYuXhxPY9QaiM3Lfh0S3Wbl1hgwxQzthHivnBt X-Received: by 2002:a63:28c1:: with SMTP id o184-v6mr29946803pgo.225.1534446279106; Thu, 16 Aug 2018 12:04:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534446279; cv=none; d=google.com; s=arc-20160816; b=vzL6aCoIhHIkFxUfBvnt308aUlrvSk3HoOOoXRhY7pFRSwdCdk+fCP52gZABb/mXr2 NCypGxy98RQOCffTFYZUNCi94nvtHPdtmHnWGxtcT51Lq1rFgoOPHnxsUcW46cjtXQ5b I5+XsHe9PKAYJoolKL3AXQf4hn38qLH5rzVv+WThYjmUx0yjLVPE/CcZ7IvbVMQVFpLq UahRw/o2paVUvJFfO15QgubU5aY0Q7dwwY5+qvwSQ7dEtOCiM459JjWvwS1dGmnLbDie XJ8LlFrSpr370nUdNK0DIoZLy075NvRLYNUz1VCzU3h4eeNwwdXq2RpIFhrL1vBSV1G7 6N9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=bIPO0BAHf9CVsugwtAiz8dFA3FE1mP0K7kNbO2XwK8U=; b=cNGQ5bvII6vKBEAwiqUuMw1wKO/IIlKtfa/laXAZEn4b8Ab0FqINMieGlaU7FhPZJZ jVbrYdzQL7sFO6eQC1d3NhPAqkC2pAUUwU574VTFio1tiQqxnNueUBh9raSKrNtXqsCo MQhsW5oX+scOgTlYbSHdxhPEjLXm/9R0Jz44bLJ0I9mFqqPALk/izIeFhIuC4Sdcfayd zB9KM+/shx2mNLgGjyEzFt/3+1Vb8gN5wKjSsFO6HCZa2TUtHscCWJyTH+yUEGRFexxg A4PwH1APWWij8emQQJmTHIIJZbZddHgBSvT9SoJAVmEKOZ8coUk1p+bqHPAI8GtpLHvb jP3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=XtUZQM+J; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f40-v6si23691plb.504.2018.08.16.12.04.21; Thu, 16 Aug 2018 12:04:39 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=XtUZQM+J; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726431AbeHPWDN (ORCPT + 99 others); Thu, 16 Aug 2018 18:03:13 -0400 Received: from mail-by2nam03on0093.outbound.protection.outlook.com ([104.47.42.93]:42832 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725947AbeHPWDM (ORCPT ); Thu, 16 Aug 2018 18:03:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bIPO0BAHf9CVsugwtAiz8dFA3FE1mP0K7kNbO2XwK8U=; b=XtUZQM+JKz+w5zrtNS+CSO5aTBi8BTLTUrElz3uvK4rpCxrPuQsjgugmK856XofIuCAFe4Ku1Q5mZci2E3gpT+UYwve79z+3Qf5EWD/+uLNfT8wTofkWFaz8uX7+djaxkDxMFKviDGyT9+Xhb8H3AUjLNEzt5TspLVC7cHNggDo= Received: from DM5PR21MB0508.namprd21.prod.outlook.com (10.172.91.142) by DM5PR21MB0156.namprd21.prod.outlook.com (10.173.173.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.1; Thu, 16 Aug 2018 19:02:42 +0000 Received: from DM5PR21MB0508.namprd21.prod.outlook.com ([fe80::65dd:b17f:eb0d:2eee]) by DM5PR21MB0508.namprd21.prod.outlook.com ([fe80::65dd:b17f:eb0d:2eee%8]) with mapi id 15.20.1080.009; Thu, 16 Aug 2018 19:02:42 +0000 From: Pasha Tatashin To: Andrew Morton CC: Jia He , Russell King , Catalin Marinas , Will Deacon , Mark Rutland , Ard Biesheuvel , Michal Hocko , Wei Yang , Kees Cook , Laura Abbott , Vladimir Murzin , Philip Derrin , AKASHI Takahiro , James Morse , Steve Capper , Gioh Kim , Vlastimil Babka , Mel Gorman , Johannes Weiner , Kemi Wang , Petr Tesarik , YASUAKI ISHIMATSU , Andrey Ryabinin , Nikolay Borisov , Daniel Jordan , Daniel Vacek , Eugeniu Rosca , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [RESEND PATCH v10 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64 Thread-Topic: [RESEND PATCH v10 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64 Thread-Index: AQHUNZO1/cRNVxmBf0uQR82FDfwseg== Date: Thu, 16 Aug 2018 19:02:42 +0000 Message-ID: <20180816190241.o6ctjypmbd65jdpl@xakep.localdomain> References: <1530867675-9018-1-git-send-email-hejianet@gmail.com> <20180815153456.974798c62dd5a5e4628db8f5@linux-foundation.org> In-Reply-To: <20180815153456.974798c62dd5a5e4628db8f5@linux-foundation.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [73.69.118.222] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR21MB0156;6:7hmXq73k4sET0d1yQmoojtnqmQqtbfePLgnP+U42dnscFXvQF04HdSxJYKMHHN7FtMXzIu4y+YsJEdQN91NkvxlJSJNVQbJ9brJHpjRut43Pbz2yQ9/UP+HXrn9iw/uJ7J1RYyZrkyQcnxV/ha7M6hHgLE2FHCf9TL1zLteDsS5mubxJ1m00FQc6QDpwrJy1whVwdscamgv3YVcxK1Xt+9XA7dpCDB/MyiTsC7P5dGokDG6QNpCNlACcpjfJ/TxYZ6EhaWUQ7fQbgeAUm4FzHCR60BERvaPW7+nlI6Cl0o4EK5jbtbszAM7vtwjI/RVm/r1H+Z+QUCL4zTHdXkvtdCq7BtCkCAPt7Z267VCjw1+gPis11xn90wJtkt6tjPl+PD3TzT/ab+WL4KOvtLfmC+6Qn00qH9xgLqcY/vJOWGzML26fBy1agkVm/nHdLt5vAE0Z1kkRacOnLMjjSIlYCQ==;5:niiPpoeVsEEvuwlxPTGZDIJlw1J98frzxRZmb/Lt3TgEn1J1MKTBDs4cKC/AURRYJJR8gXlgvsYt6tM25z6QKc9aKyzN4+izRImK0QsL7QvQPBTEDpk+WO1RCGlxSw9SSvGFX4qO+B71vC7P2up1vU3CiXRc3Ll0JeYEs7RmaCs=;7:p9uFS+vnwuyXU2cZf/13KqFEBjr8XErhAPeRxrwvt/Bz8ivxnuAc7b1jMy3bpTqwBAvvWJH3K9ETAgV0tQHGH1AuZEHKTV7VaLp/NF215yc+kk63iQMEJrek+9+H8y+7UnHBC2Jqni0NXja+wsV4Dz60hMEBjiZrZ1iTl89bbykNdYtDQdy0F61d1o4+EUWtth+JfGjbP7hUlfQfr7yO8RSYqToy66ZMfQWTGGaaetF+50oo1Hy45a5g/0kuk93G x-ms-office365-filtering-correlation-id: c6fa661d-1cbd-4f18-07f3-08d603aad814 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020);SRVR:DM5PR21MB0156; x-ms-traffictypediagnostic: DM5PR21MB0156: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Pavel.Tatashin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(85827821059158); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(20180801012)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231336)(8214008)(944501410)(52105095)(2018427008)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699016);SRVR:DM5PR21MB0156;BCL:0;PCL:0;RULEID:;SRVR:DM5PR21MB0156; x-forefront-prvs: 07665BE9D1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(136003)(376002)(366004)(396003)(346002)(199004)(189003)(22452003)(6506007)(53546011)(8676002)(97736004)(76176011)(99286004)(33896004)(10090500001)(6512007)(68736007)(229853002)(9686003)(102836004)(26005)(7736002)(106356001)(105586002)(2900100001)(7416002)(5250100002)(305945005)(186003)(6486002)(7406005)(6436002)(8936002)(3846002)(6116002)(66066001)(54906003)(11346002)(316002)(10290500003)(72206003)(478600001)(476003)(486006)(14454004)(1076002)(39060400002)(6246003)(86612001)(4326008)(86362001)(5660300001)(53936002)(256004)(446003)(25786009)(81156014)(217873002)(6916009)(81166006)(2906002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR21MB0156;H:DM5PR21MB0508.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 6u3hyOQP8ePEZ8Vkd5gFNnZ02Bf7yuekLSNztcdLRU+NPWAeIf9kU1IUu482hCXAKhwyFQCI4PXjlNEyibn3gBQJUvaNMeiTAupi9b3Pax5mZE+Ey9LieYWMFIFn1PSMzUYFKofBRpUaZa/+H50Bza80GI0DgktI6p4zXEI6pBCw/abR7wB1DXUIHtiH8MQcTR+4Sof3XhBnxi8cLfPxg5ozrpFhuCZUKAv2vpXxWPh4UuFC04dkxN+oc1iAk74/lQZyz0UYH4Mc/aHdj5mT8zzYt8hGwC8xgst7YwsB4z8PIGWuHQMmFw5stdY8DtV38aUUTKIeWZfz14eiBxNd8pzRoG5S37BEap2KFAdHXWRLxMV0yItc5e1T2AhiAaLaVqIYxlULdSu8+Yl9Eka1bBGmQXsG7zX43HvPcX7YJj/rc05Oz8/rJkKglgmCiSWtD2kINT6DNJU6ZDmZCVjmlnlPD2tWnt6E6y/gu1PWJus= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6fa661d-1cbd-4f18-07f3-08d603aad814 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Aug 2018 19:02:42.1526 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR21MB0156 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18-08-15 15:34:56, Andrew Morton wrote: > On Fri, 6 Jul 2018 17:01:09 +0800 Jia He wrote: >=20 > > Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns > > where possible") optimized the loop in memmap_init_zone(). But it cause= s > > possible panic bug. So Daniel Vacek reverted it later. > >=20 > > But as suggested by Daniel Vacek, it is fine to using memblock to skip > > gaps and finding next valid frame with CONFIG_HAVE_ARCH_PFN_VALID. > >=20 > > More from what Daniel said: > > "On arm and arm64, memblock is used by default. But generic version of > > pfn_valid() is based on mem sections and memblock_next_valid_pfn() does > > not always return the next valid one but skips more resulting in some > > valid frames to be skipped (as if they were invalid). And that's why > > kernel was eventually crashing on some !arm machines." > >=20 > > About the performance consideration: > > As said by James in b92df1de5, > > "I have tested this patch on a virtual model of a Samurai CPU with a > > sparse memory map. The kernel boot time drops from 109 to 62 seconds." > > Thus it would be better if we remain memblock_next_valid_pfn on arm/arm= 64. > >=20 > > Besides we can remain memblock_next_valid_pfn, there is still some room > > for improvement. After this set, I can see the time overhead of memmap_= init > > is reduced from 27956us to 13537us in my armv8a server(QDF2400 with 96G > > memory, pagesize 64k). I believe arm server will benefit more if memory= is > > larger than TBs >=20 > This patchset is basically unreviewed at this stage. Could people > please find some time to check it carefully? Working on it. Pavel=