Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752918AbcLGJHL (ORCPT ); Wed, 7 Dec 2016 04:07:11 -0500 Received: from mail-sn1nam01on0062.outbound.protection.outlook.com ([104.47.32.62]:31904 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751790AbcLGJHJ (ORCPT ); Wed, 7 Dec 2016 04:07:09 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; Date: Wed, 7 Dec 2016 10:06:38 +0100 From: Robert Richter To: Will Deacon CC: Ard Biesheuvel , James Morse , "linux-arm-kernel@lists.infradead.org" , Catalin Marinas , David Daney , Mark Rutland , Hanjun Guo , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 0/2] Hibernate fixes for 'Fix memmap to be initialized for the entire section' Message-ID: <20161207090638.GI10776@rric.localdomain> References: <1480530091-1092-1-git-send-email-rrichter@cavium.com> <20161202144909.18405-1-james.morse@arm.com> <20161206173810.GU2498@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161206173810.GU2498@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [92.229.83.231] X-ClientProxiedBy: HE1PR0802CA0010.eurprd08.prod.outlook.com (10.172.123.148) To CY1PR07MB2346.namprd07.prod.outlook.com (10.166.194.145) X-MS-Office365-Filtering-Correlation-Id: 68ab602e-0fe5-4be1-a1dd-08d41e806b74 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2346; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2346;3:NneWRvXfVP4RQiwHtR1JVdY9cqF5UpgtdqUanqXm8omGiGIUSOQrAVoihvRd/BIZmI2tZavgc9KlaCfeiG2FZgti5e8viqW+ObhqQ8ePgDH8Mw3DFD4GstRqKOqM2ytBHj+YFU+lUcX38Q67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YKZJTiqIxrfsZwqTLPcEU/jmAC1bzLQh5GmP2fqaVJOr2Z73G8we3oaudCHUo2CDf4H9shTJOj9YWaawi+IeUrbjKSCJuMzyL5r+JRShkQVCoNLW1xKOczA+GPUTcamjl5+GSImE4tXT96;20:5qk+FQ4aSw5AvQKHIs4jI3HwQ27Ux801zCY2ExY6y6py3TJYXJMBehRRKk86DXzpcIQFxBC2q7LKQ5OEIEqVxjdMYFyK6IshhtUus3dAjn7joCzyJSCFOv6M7REU5xJg3cJsv6lMTj1tImEZjyOpH2l8sgQQYmyC/HR9fhOkYUe/0j+vJrYpXNVjlnzYtvOMQwnSNLM/b6R5IhSME+LGoZTuTfEz8StF+WuTdsePnCuZJSi8ZHLUPco6PiFfDugJS2LC6n1r33tRaG8jcPit7qDVHPjvMvr4b1kgDYP5xRdLVf2l3jlSvQn6EQLL05EpTC8tAQL+oUgK4zb/gZl0GCSpcZWCo9rwxJEFsxKC1fau2tIS3UAkiWnFLKpujZonyfx7OPdIJ0lyIJFFMPRWmzhVjXfEHOLPMehJSbQN/eA2pUOePbBqcvXKDOXCSrNo8txeYNhh1PbAnpCUBgd8uoOmsjftZns7w1YXBUcZqzvVaHlTLwXoOxWd/AXpa5R2 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(20161123558021)(6072148);SRVR:CY1PR07MB2346;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2346; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2346;4:5J1ZEA3EiIjQzzlMok00XFQoAxowMxCr8N7S0Cf3zCYZqqu4hP28xJtRRX9u1i/oCCmDqWaneFElSNnyz1bXWfIpDbz+VxNxCbjcrzQ7nqWcfwM5659uSDjtbIWij4KKxm1iuQovbsy5YlpLOYmkzIHoW9VJnPVdgdmAb9bgesoNyMkANM9M2YjSro0g7WH91hg4vC0sXfOeFaK5+X0Xkx1Ill24FXHkar68Lnj3oIhKM2dG7mJalrBLdbu1grw63ttyurUApQ6Gx0MtgPnKCHhM8WdPfF064uZubbWeJoDIWJ9pkaj8OG7E6PBeg0/Boo82krTS715GsQWD+8ea+WT44osSt12uiebL0ODHxW5Mp1R8yp3aH5tdHxFASOlqGxZvi53Xqp0mnfarFMRmZ2UfnR+K0qIhw7yTbMvAr1u43QfIC7SVTH4TJsquRzRHeYE05OEJserfAdZnKv5NlIbs83Pl63X1QNglIDu6UB0BWRjyctHGmtN9ve4OJGZOQ3GY5iR7OVPyS8/lG8vEEbb6lgADP4Z7hYJl6cxrMvp55bEq4aoezrEAaXeN3RdnHgmFReWeOwHm72Vo3LTcIxlWpCfVp0IvuzvY1UQYpOaULRoxzX2724nITyr5wLfV0IExa0ysNhzwwWBoW9xJiQ== X-Forefront-PRVS: 01494FA7F7 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(54094003)(199003)(189002)(24454002)(733004)(38730400001)(33656002)(101416001)(39450400002)(39410400001)(93886004)(229853002)(6506006)(66066001)(47776003)(76176999)(54356999)(50986999)(39840400001)(39850400001)(97736004)(1076002)(6116002)(3846002)(4001350100001)(46406003)(106356001)(92566002)(105586002)(7736002)(42186005)(6916009)(110136003)(2950100002)(6666003)(50466002)(23726003)(5660300001)(8676002)(81156014)(4326007)(81166006)(97756001)(83506001)(189998001)(9686002)(68736007)(305945005)(2906002)(7846002)(86362001)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2346;H:rric.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB2346;23:LAyx8uAHCZJaTGlPvS3Px7FCL0CCyg3Y82qBSN9C7?= =?us-ascii?Q?3LVyiJz3JlL0js2yZtTp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MEnXPOiQEveQdc098pSxdIXCR5C0VVay3yTbsJ0sQUQ==;24:VOgxP1Czj9xvagWyUBdAoWdkr3asHUH0DDUtmFS/RMxZMbKeq5xYya5frKIoeWb/vji9hEoTQI/sOVVhHG99FREYy+exVSKvpyLwJqTnLJU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2346;7:efGMlcreVx7jd5MC8E8n54xfpn4AKNXDdZEZPDtyTiy/y29HteGOXOQh2pRWfKcs9tVL+wlsYts/irdkbAe4Y5o8N111HoGvNqYPNsdq4zOa2BNfn/vA4UnQ89TkY8wCDCDZF+s+KLP1bseaPZ2QWfDb+3F2A+9fDjJt5r5eJ3Pp9kx9yPoP9pA+JdwsS/W8ge4zfGQXi5Cu4954Wk6uY9tfc1dSCCaojJDkUX3Zb8QSdXIsciQEHcPOQi6Mu9OU/Uq0Zrcy0diA9nh7QiYLHO7aO+g9j7kint6D7l/yKNK/IU9eWbD0DKgNReAs0htUZtCBTR2VQJ9xBsHKq8h3+jpzI8lOHM99nhr/KtmRUrHOtuApfTjT0p9dCaB3Uk782lT0x8G45a4wqCtZgjo1IyIQyss5vLf2QmVlrD1VjeqbNj2VIwTYciDMvisfGWhBtDYoHCIlA/TVQq7YMYyA9w== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2016 09:07:04.5442 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2346 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2061 Lines: 42 On 06.12.16 17:38:11, Will Deacon wrote: > On Mon, Dec 05, 2016 at 03:42:14PM +0000, Ard Biesheuvel wrote: > > On 2 December 2016 at 14:49, James Morse wrote: > > > Patch "arm64: mm: Fix memmap to be initialized for the entire section" > > > changes pfn_valid() in a way that breaks hibernate. These patches fix > > > hibernate, and provided struct page's are allocated for nomap pages, > > > can be applied before [0]. > > > > > > Hibernate core code belives 'valid' to mean "I can access this". It > > > uses pfn_valid() to test the page if the page is 'valid'. > > > > > > pfn_valid() needs to be changed so that all struct pages in a numa > > > node have the same node-id. Currently 'nomap' pages are skipped, and > > > retain their pre-numa node-ids, which leads to a later BUG_ON(). > > > > > > These patches make hibernate's savable_page() take its escape route > > > via 'if (PageReserved(page) && pfn_is_nosave(pfn))'. > > > > > > > This makes me feel slightly uneasy. Robert makes a convincing point, > > but I wonder if we can expect more fallout from the ambiguity of > > pfn_valid(). Now we are not only forced to assign non-existing (as far > > as the OS is concerned) pages to the correct NUMA node, we also need > > to set certain page flags. > > Yes, I really don't know how to proceed here. Playing whack-a-mole with > pfn_valid() users doesn't sounds like an improvement on the current > situation to me. > > Robert -- if we leave pfn_valid() as it is, would a point-hack to > memmap_init_zone help, or do you anticipate other problems? I would suggest to fix the hibernation code as I commented on before to use pfn_is_nosave() that defaults to pfn_valid() but uses memblock_ is_nomap() for arm64. Let's just fix it and see if no other issues arise. I am trying to send a patch for this until tomorrow. I am also going to see how early_pfn_valid() could be redirected to use memblock_is_nomap() on arm64. That would "quick fix" the problem, though I rather prefer to go further with the current solution. -Robert