Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933463AbcLIOxH (ORCPT ); Fri, 9 Dec 2016 09:53:07 -0500 Received: from mail-dm3nam03on0054.outbound.protection.outlook.com ([104.47.41.54]:33952 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932594AbcLIOxD (ORCPT ); Fri, 9 Dec 2016 09:53:03 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; Date: Fri, 9 Dec 2016 15:52:34 +0100 From: Robert Richter To: Yisheng Xie CC: Hanjun Guo , Ard Biesheuvel , Catalin Marinas , Will Deacon , David Daney , Mark Rutland , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] arm64: mm: Fix memmap to be initialized for the entire section Message-ID: <20161209145234.GB14257@rric.localdomain> References: <1480530091-1092-1-git-send-email-rrichter@cavium.com> <584AA257.3080608@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [92.229.93.144] X-ClientProxiedBy: DB6PR0501CA0024.eurprd05.prod.outlook.com (10.172.232.162) To BY2PR07MB2342.namprd07.prod.outlook.com (10.166.114.144) X-MS-Office365-Filtering-Correlation-Id: 4238c17d-d806-495b-9c65-08d4204311b0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BY2PR07MB2342; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2342;3:59SOxQBzSBpbLwRbLFsOz71JKZ0F5EDLnCMNk2A9fpTEMsV3hgCtcYpgO62XIqTsNPB3a5SYplBRwDItZ+j5ESNmadOh3MRhOoIzA8AzRcGh+emO4b7Cuh/kYJslm54pibzuc/oUGws1kQdTxQKbS8STSdMD8v1HDsxLHzBLCooxrV9UFp/Y8Apdqtcf33B+WJZghs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Yg8fFwJMfOwFe2Om7SWQOwkQPnJTqSsCFCFBG/8BJVILNJ8NQvvnatbB2uTJR5/L+x/Hj11Y4UR3Oh1aAnynKEI72BH+iqXvSY+WbwH1WLpGcJjwf93QrsnZo034aENaM0a67QroDY2cGEbZ6BiDT6pG2iX5RRy/S88TQ6II4rSzD7NVSlzNjBJBWkj/v4yzFCmOvx0dos58WHSQGIss8MP/pm+WKX1b9GQOLfe6nl0LFoP5Xz8BtQ/dO7YActkwKlbviLRllXkGV8RL5QnVODLAVeTyoyQwbc3zoICeIXthkIRx0TEfI99aEqSQwN3FxR3Iu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(20558992708506); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148);SRVR:BY2PR07MB2342;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB2342; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2342;4:CBqXjJMnkXIQ7RQfZkMuMC7wJIPYtx460kJDT7MAoWdJDEq33Dd70kzCIK3bPEeJDwgbLxaqV2wQnfasY0cThbQoWFFdcLz2iMqacVK0PVm5EYlXqAgf8XOwPNj/k/70BJKX5WQB/VlkWzKQGbMOY/snybHENWVirrb6i5NcpxdwjLalKHQB4NP75MaGju0cS1pt0Dy98rz8p5BvmBgPQiTVwter3+3aVLP8rFqsuMN3y3lnbES+2SmcwHnmYNv7IRK5JjqY42cjszkXFPrR3w3muszSPF8wABbMqUWcTnQ6wKld0ZOq5S0YT+zvR1tdKtvYSl/DL+fzstaHF+I/TopmpmtD/5HIEW1WzI0GhXhtw3Z2FN4heRx7U0G1on0IVRrnfP6P5Krj2+XXKQxIVmilMxBYH1V0v2XB9V9gHNiJ+1puFIb9eqW+snNIwWygX8RlyPIQFuqtPaOxU9nn8W+qFi8QeRRQQw/O+ZwhjqUbEPRBa0XyXEpQ080KWjv5+SIkyZdzeHPD1aiS4GIQkJ2wSbn4i0hW7B0b8kbkJEauedfsuUGPNTGljdoUHJdczrU6LIg042mdG1dhoATG59KK1pkT4BpR8NhkcW3Ae0bFHu/ajUOtNBjMtVpRqo4f X-Forefront-PRVS: 015114592F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(39850400002)(39840400002)(39450400003)(39410400002)(189002)(199003)(24454002)(5660300001)(105586002)(42186005)(81166006)(68736007)(8676002)(9686002)(81156014)(83506001)(66066001)(4326007)(47776003)(86362001)(106356001)(2906002)(93886004)(54356999)(97756001)(110136003)(101416001)(50986999)(229853002)(76176999)(4001350100001)(33656002)(38730400001)(97736004)(733004)(7736002)(6506006)(305945005)(3846002)(189998001)(6116002)(6916009)(46406003)(50466002)(1076002)(23726003)(2950100002)(92566002)(6666003)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR07MB2342;H:rric.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR07MB2342;23:Nh/EXSB03o5lVJ+naieYCwy8q7kIk6vdbqKlI5lnE?= =?us-ascii?Q?wCYnTdAaDSmYHiigOQNSSKfARKBAdZczqYysmBdhSiz3NSWpgnV9d1YZ1KjP?= =?us-ascii?Q?tPDloNpaTQO+S7mKj03i3I+q+dhU0hXJ30ZMebfuo9fyJ7DqnF0hmDvONolG?= =?us-ascii?Q?5s+QEXhY+ulc7PQN37lNeEEJOnDaJTqVPKS+JlMS10YHgZy5qdQKvsgkWa/N?= =?us-ascii?Q?d1Lh40icABgix4Pt/mTX/iWZXTG2BWkm8zgdbSTRa09Bx6Z+t/a6oWmPhBXn?= =?us-ascii?Q?iXEurd0YENIIf/qd68InBa2aRiOPxicuS1hBFt11dngr6PKCCa0SbPIK/XKI?= =?us-ascii?Q?mnAcTPqp2LqhV5CzI/PDpxl+F/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?GR2GYs7qIqQ2I++e57nTwXVhJ4jhpC1CBrMhrdsTgvgmZazTkG/WXyjSedHz?= =?us-ascii?B?dz09?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2342;6:QjQ0q7DoAvbt69iOmiNbFHUL0kClMoNvpVOQtLEdN/2dAXejlBkYw0a2qElULD3ZhELnSCchxp02FF/KqD86DGKjf1sPpXHb+ISwiTqwxCthYBlnXgCt7qq0hZBiACMKS7dB1pUHG7c5s1n84/YKHZnu1TCUwdmukbZTIwWxyoR88NyyJmS1+RyfN6NMoFa1a9qfmNYNgrdLzFRdeso46SyOrPu07tG+8v8ccVkUrH9OS6Br3ihptVJ0vajVDVAlCZolO1jBcHd0XSI609Kl5yuXKN4siJYi57YdH2rg5u9PTL+IGsQQnIoKDPEvULU6ymulcRxXiRjWt57JoBx7SY5fNlnNEJvluzjgd20+ZJNlzLGlvoS2Mhsajy+bfblOhJcbv5dnEwZh0SJFBxNu+Pxms3b8l3vLC9MizLaZylk=;5:JpOVHwnkqv19v4NERZxC9ky28LLCI+3XTMoWI6o9UaLoayYKTOkyLidEG6zY8WOHxvYCF0tgZqq/6bHTrUC/jC1MCwiIU6af5LSbb//aG/9H7hq1hXl0H8y4RGswyTFGquHeov/w9kTnCSyFOgHHPQ==;24:lxa/hASbzlLiP/nqPeiEwf0lmFsbweeRKtQZ5zxvLhW94aFsgCdTDuXf5ql5cBKkuzlqe99pzf2NUKt1kIO9DBuYSkTfi0mjFZ0AInimb7E= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2342;7:zSeOVZReiecZRf9CP7vfRy3pKqzqQN7fxViAC+dERj518+xAcFINoAutUYQRK0VDNKZqT6q2BgzJfG3kdNX+xi4KhS449t0ddggY6+Y4yCjSew63xzZtz2vziQ0NumyE4NECVodUa+3/GyNxz77J4SxrCCy6Hzdfkwl1X5Zv2e0GgUn/Kz4SA/0RmSYbcUdBBcooIBSjPpeEBjBYVkYQTVBIHQjPgYfMTahYsaKGfiWfgUDZyRf4hoRpOufnWTGIOC3yoxwZS/vxku/HrKjB3KI5/mR4U0koL/4xT5QdAVo3sqstMG37BNtCTcos9w/swI8AJZz3SUHrM76DbV0S+y95f/DG4jPNMiTb7HuDwlJibXpiLBLhmHzLfQEIU6y9Na1GBCwc1rYCvT4PySSsRwbrz1XRrQlUdAQ58A3Z5Ylbnxc/mF4v1vIVEAHve9f4IFh25dNWc6ZTQ1iTd6ySjw== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2016 14:52:57.4908 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB2342 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1315 Lines: 31 On 09.12.16 21:15:12, Yisheng Xie wrote: > For invalid pages, their zone and node information is not initialized, and it > do have risk to trigger the BUG_ON, so I have a silly question, > why not just change the BUG_ON: We need to get the page handling correct. Modifying the BUG_ON() just hides that something is wrong. -Robert > ----------- > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 6de9440..af199b8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1860,12 +1860,13 @@ int move_freepages(struct zone *zone, > * Remove at a later date when no bug reports exist related to > * grouping pages by mobility > */ > - VM_BUG_ON(page_zone(start_page) != page_zone(end_page)); > + VM_BUG_ON(early_pfn_valid(start_page) && early_pfn_valid(end_page) && > + page_zone(start_page) != page_zone(end_page)); > #endif > > for (page = start_page; page <= end_page;) { > /* Make sure we are not inadvertently changing nodes */ > - VM_BUG_ON_PAGE(page_to_nid(page) != zone_to_nid(zone), page); > + VM_BUG_ON_PAGE(early_pfn_valid(page) && (page_to_nid(page) != zone_to_nid(zone)), page); > > if (!pfn_valid_within(page_to_pfn(page))) { > page++;