From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757991AbcILLcp (ORCPT ); Mon, 12 Sep 2016 07:32:45 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:57869 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756103AbcILLcm (ORCPT ); Mon, 12 Sep 2016 07:32:42 -0400 Date: Mon, 12 Sep 2016 13:32:38 +0200 From: Pavel Machek To: Anisse Astier Cc: linux-mm@kvack.org, linux-pm@vger.kernel.org, "Kirill A . Shutemov" , Laura Abbott , Mel Gorman , "Rafael J . Wysocki" , Alan Cox , Andi Kleen , Andrew Morton , Brad Spengler , Dave Hansen , David Rientjes , Jianyu Zhan , Kees Cook , Len Brown , Linus Torvalds , Mathias Krause , Michal Hocko , PaX Team , Peter Zijlstra , Vlastimil Babka , Yves-Alexis Perez , linux-kernel@vger.kernel.org Subject: Re: [PATCH] PM / Hibernate: allow hibernation with PAGE_POISONING_ZERO Message-ID: <20160912113238.GA30927@amd> References: <1473410612-6207-1-git-send-email-anisse@astier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1473410612-6207-1-git-send-email-anisse@astier.eu> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 2016-09-09 10:43:32, Anisse Astier wrote: > PAGE_POISONING_ZERO disables zeroing new pages on alloc, they are > poisoned (zeroed) as they become available. > In the hibernate use case, free pages will appear in the system without > being cleared, left there by the loading kernel. > > This patch will make sure free pages are cleared on resume when > PAGE_POISONING_ZERO is enabled. We free the pages just after resume > because we can't do it later: going through any device resume code might > allocate some memory and invalidate the free pages bitmap. > > Thus we don't need to disable hibernation when PAGE_POISONING_ZERO is > enabled. > > Signed-off-by: Anisse Astier > Cc: Kirill A. Shutemov > Cc: Laura Abbott > Cc: Mel Gorman > Cc: Rafael J. Wysocki Looks reasonable to me. Acked-by: Pavel Machek Actually.... this takes basically zero time come. Do we want to do it unconditionally? (Yes, it is free memory, but for sake of debugging, I guess zeros are preffered to random content that changed during hibernation.) (But that does not change the Ack.) Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html