Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755236AbcLNKEY (ORCPT ); Wed, 14 Dec 2016 05:04:24 -0500 Received: from mail-co1nam03on0069.outbound.protection.outlook.com ([104.47.40.69]:38842 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755084AbcLNKEV (ORCPT ); Wed, 14 Dec 2016 05:04:21 -0500 X-Greylist: delayed 1212 seconds by postgrey-1.27 at vger.kernel.org; Wed, 14 Dec 2016 05:03:54 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; Date: Wed, 14 Dec 2016 10:45:42 +0100 From: Robert Richter To: Yisheng Xie CC: Russell King , Catalin Marinas , Will Deacon , Ard Biesheuvel , David Daney , "Mark Rutland" , Hanjun Guo , "James Morse" , , , , Hanjun Guo , Xishi Qiu Subject: Re: [PATCH] arm64: mm: Fix NOMAP page initialization Message-ID: <20161214094542.GE5588@rric.localdomain> References: <1481307042-29773-1-git-send-email-rrichter@cavium.com> <83d6e6d0-cfb3-ec8b-241b-ec6a50dc2aa9@huawei.com> <9168b603-04aa-4302-3197-00f17fb336bd@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <9168b603-04aa-4302-3197-00f17fb336bd@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [92.229.88.116] X-ClientProxiedBy: AM5PR0901CA0018.eurprd09.prod.outlook.com (10.164.186.156) To BY2PR07MB2344.namprd07.prod.outlook.com (10.166.114.146) X-MS-Office365-Filtering-Correlation-Id: b13432d0-34a4-4517-1978-08d424060cdb X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BY2PR07MB2344; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2344;3:8JZ3deioGe53+ZCuBJmbHnYYIHnT+Vz49WLEt/ZdeHsntm2oTBR/aY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d/NnrcEnYnycPtqOR8sjg0XWWku0C1ucRkATfz+Wj0vQtfu7VhCIqvsprA6NPWyj6b2Tuz1b359nKesGjhKd+CnnqZT5SExOlWRrOQ5B33qYD33Zk76kdmXkl5eAB75HVCtOPGb6Jr86CRM41h7jRmRspa6K2aKeyzCbTVqunbaBztqJMzaVmJoFqH5/M5woCKZScffsgYEient3IvvfPlwxSi0yyWTyvFGj6HDNu9Vil65/Xwsdyslajm9Rho3Cztx6DRfwUtfjMUXIF6gU2Ty8TbPuZMhlNe8rjXZ1XnC2cIawDxtvFn76M030KjcxJIloQPJ0Q6XTbBgCxY8Z2QdGTa0hNYN4vaUOZw/8oJRzgZcq2GcWnyDpKYC9zoHY0QxS5B38+O8QMl804VAb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(6072148);SRVR:BY2PR07MB2344;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB2344; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2344;4:qFUnnWG+Cnap08NOcsg+y7jSFIkfZcGJkoln2uamVvDKMsIrYl26ogkHPIW/ip+WejTGW9Cv+gvGdMQmjIUVaQS8Wk84aMQok+YM9RkZv1DQq8hTu3QqG5z3kq6wAJVmaAAhtvsLhsWZDP1SAKqGzSCHuFkXonXDHSJLrBMhzZLFbI6siHyEN1Ys4/gA0S+drZeHkk+0Wm+NFhFwPYxjsMNl/fRKNLm4QEYyZ+xbai8LvyBhlETh/f88qOfFcZIEhZvjdKuTlKIIArnBWU4nbP0/WGHYx/91abPAb+SIw0MNnmf6cIOfvrA9BsPHt2LDj4erBbu8OT2f7HimrB2Sy3+MRy7tn1Z6eTSbfA0iQuexx9zc+K/wGLILszKhnX7j7QmJHV5E2Si7iMG5ZKWeM8cPFZS3G0Y7jXN/eMgqx0hxQOE+0qUhcpyI/NrWc1ZKqkZaH16oxuisXv3exZobwsB+tKrNuYkxHZNdUEDgkhLzKIS6K8UIZvvYUHq2KPen7TBjX9QfvwvYgCSGm59OvzAbG7N6kOrk9bVo4bLSVIFre1iutWgzRVSKj5Fj5+idJsGY450yws/AvVewqpKNeQ== X-Forefront-PRVS: 01565FED4C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(39410400002)(39450400003)(39840400002)(189002)(24454002)(199003)(23726003)(305945005)(81166006)(6116002)(81156014)(50466002)(54356999)(1076002)(101416001)(76176999)(83506001)(3846002)(7736002)(2906002)(4326007)(50986999)(46406003)(6666003)(2950100002)(229853002)(38730400001)(92566002)(66066001)(6506006)(189998001)(8676002)(47776003)(110136003)(68736007)(4001350100001)(5660300001)(9686002)(106356001)(86362001)(6916009)(97756001)(105586002)(42186005)(7416002)(33656002)(97736004)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR07MB2344;H:rric.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR07MB2344;23:U5vJ/0XevNtWeCqtbMWWSb3OjrHVPSaHKrsnW1yru?= =?us-ascii?Q?e3w3xSrf5AbDdO0QkedShVwYQ8STUT8gInanYWT0/NQpa6amBEGdciQ/KON/?= =?us-ascii?Q?s42oxKF2LOBr6Zt8gkMtTuIE9qerApPhitRqi79d5WRGk1F88Rx6uAcWzGeb?= =?us-ascii?Q?IrxyxtoCRIFyZJqA+FEv9TmhyB5G6kXR7y6yCSAwZ/VAsDdOTjh3HY+RF0GZ?= =?us-ascii?Q?Qk4b12dHMiJJacCJL5zsuSiaTEc9uWsN4afe/Hi9dyP8ZIa8HCh5wCLawqdg?= =?us-ascii?Q?EE6SK2uOCk3PPz3uElUbG0+oaxdfU8itO490RVcSjIRGxymDqAUZEUg0YQwp?= =?us-ascii?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BDNw+gok+HRfdPAOQVdf?= =?us-ascii?Q?qWxuRymXICQCkteiXI=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2344;6:7LObhzte3m9wdHQqYHYMbR20RcvfHNoWClWZtNZRd/sG4q583F60aOPGCt7ap/MeJ3QhVx4Ifrfx2f259F8vBzcgiTDBUtC4EAYLU7I8+MCF8zwE6AXNQ25KOw3gEvJFgLKLdVTBf5rNZy5N4g/YyQKHKfjgH0qM3sVqhQ/Ntph3hM18zbGtkuFqauOnQn0NPT+/84RnXKrMGJwN65zkkqGGcsLP+qvA89HrOJyiaiRotXJoJpdeEnim0n9kiH+U3Mz5AYAE+n5JOBKrmeuDEl4EkDmILcBA7MYIUsicdDd+f3I1hnA3N2GvZSyLSptTM+fD2izD3UQLvYNsrtGD2mXo1A0K9GWbBRRrIllqiDONm3hOwilMuRLP/P/FXg62N8JkzXiUqKK1pGgv2t9eEX8gJ74JAg+UfsvI5Tmkp64=;5:3Z9JKwhpbhoEzY6CxMMPtRQZbGRy/LmbxgCtP9ej02twfLlG3CE1s7cBnjDPLwk567XNkw0yDP3eY2SRj6t1gA80lTzeRd7s1vuiv16LlVNMhG+FvScUP3ii4w5tLHoj3hgwBtomyvI8/3iNhmJrM3jTMYo6S3jpB6Ura3I9Ez4=;24:P3lcMdQpi81PjjR2/52AF11XG+VmPQjrmvUFCSX89133iGcSIMM6e4Rijd2w/5zDlfiCxbmhiVTcALsl8iKYmN2QlvusR17BC49xtAKmQW0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2344;7:K9li3eAOWlbdDoItY/fRCUzK7zL47sh8BXTOPPVS83YFrsj8IiZqoh/KLar7YrqEUEsxtiifYwat619ERzKg9C4nR8jEhQfR19M7/8LvXeRB8aHeOESCHo4rQw2x0f2SkpdTPbuI1gkWRLTSnZ8PH/YHGxT8BdBgXb820cyzQe918Bx8SVxFIXXf4n43SO17QUS0lq7m/2ruW6ZMvQpMl8bA7Mb1OMyBRX/CBXa+jmh+x+g/JfLUTcTpmanBFlmFzDy3nwyaPC+P5nL6nVHDEnXjuU9p/STTkRddg/KIO7gBgtdRDyCDadrqLmnFXeUzOMVqqS6PJYmdAUXH5nF7k/fOMfk4yP8weR5Oj0rKv6RFKbpp55WHek2BG5WUk02mW1ATFEa7GiQWYfAB3AkUmgGTUGG+xf4GPyqcTCZM/z2lSfTdRRERHnX3pts/VzuSM+6+klmRFVq2VKQCkhJkTg== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2016 09:46:14.1218 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB2344 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1090 Lines: 36 On 12.12.16 17:53:02, Yisheng Xie wrote: > It seems that memblock_is_memory() is also too strict for early_pfn_valid, > so what about this patch, which use common pfn_valid as early_pfn_valid > when CONFIG_HAVE_ARCH_PFN_VALID=y: > ------------ > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0f088f3..9d596f3 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -1200,7 +1200,17 @@ static inline int pfn_present(unsigned long pfn) > #define pfn_to_nid(pfn) (0) > #endif > > +#ifdef CONFIG_HAVE_ARCH_PFN_VALID > +static inline int early_pfn_valid(unsigned long pfn) > +{ > + if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) > + return 0; > + return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); > +} I sent a V2 patch that uses pfn_present(). This only initilizes sections with memory. -Robert > +#define early_pfn_valid early_pfn_valid > +#else > #define early_pfn_valid(pfn) pfn_valid(pfn) > +#endif > void sparse_init(void); > #else > #define sparse_init() do {} while (0) > > >