Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753554AbbETMYg (ORCPT ); Wed, 20 May 2015 08:24:36 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:36637 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752723AbbETMYb (ORCPT ); Wed, 20 May 2015 08:24:31 -0400 MIME-Version: 1.0 In-Reply-To: <20150519124644.GD2462@suse.de> References: <1431613188-4511-1-git-send-email-anisse@astier.eu> <20150519124644.GD2462@suse.de> From: Anisse Astier Date: Wed, 20 May 2015 14:24:09 +0200 Message-ID: Subject: Re: [PATCH v4 0/3] Sanitizing freed pages To: Mel Gorman Cc: Andrew Morton , "Kirill A. Shutemov" , David Rientjes , Alan Cox , Linus Torvalds , Peter Zijlstra , PaX Team , Brad Spengler , Kees Cook , Andi Kleen , "Rafael J. Wysocki" , Pavel Machek , Len Brown , linux-mm@kvack.org, Linux PM list , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1948 Lines: 46 On Tue, May 19, 2015 at 2:46 PM, Mel Gorman wrote: > On Thu, May 14, 2015 at 04:19:45PM +0200, Anisse Astier wrote: >> Hi, >> >> - it can help with long-term memory consumption in an environment with >> multiple VMs and Kernel Same-page Merging on the host. [2] > > This is not quantified but a better way of dealing with that problem would > be for a guest to signal to the host when a page is really free. I vaguely > recall that s390 has some hinting of this nature. While I accept there > may be some benefits in some cases, I think it's a weak justification for > always zeroing pages on free. Sure, there's always a better way, like virtio's ballooning. This approach has the merit of being much simpler to use. >> I haven't been able to measure a meaningful performance difference when >> compiling a (in-cache) kernel; I'd be interested to see what difference it >> makes with your particular workload/hardware (I suspect mine is CPU-bound on >> this small laptop). >> > > What did you use to determine this and did you check if it was hitting > the free paths heavily while it's running? It can be very easy to hide > the cost of something like this if all the frees happen at exit. I'll admit that it's lacking numbers; I've chosen the simplest benchmark available (kernel compiles), and couldn't measure a difference in overall time, but I didn't go as far as using perf to find where the hot path is. Another way of thinking about this is just moving the clearing from allocation to freeing. Userland memory allocated through anonymous mapping is already cleared on alloc, so this will make allocation faster. It's a different kind of tradeoff. Regards, Anisse -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/