Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932272Ab2KFAOw (ORCPT ); Mon, 5 Nov 2012 19:14:52 -0500 Received: from outmail015.snc4.facebook.com ([66.220.144.149]:35341 "EHLO intmgw001.snc6.facebook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753490Ab2KFAOu (ORCPT ); Mon, 5 Nov 2012 19:14:50 -0500 X-Greylist: delayed 1201 seconds by postgrey-1.27 at vger.kernel.org; Mon, 05 Nov 2012 19:14:49 EST Date: Mon, 5 Nov 2012 15:54:43 -0800 From: Arun Sharma To: KOSAKI Motohiro Cc: Paul Turner , Andrew Morton , Minchan Kim , linux-kernel@vger.kernel.org, linux-mm@kvack.org, John Stultz , Christoph Lameter , Android Kernel Team , Robert Love , Mel Gorman , Hugh Dickins , Dave Hansen , Rik van Riel , Dave Chinner , Neil Brown , Mike Hommey , Taras Glek , KAMEZAWA Hiroyuki , sanjay@google.com, David Rientjes Subject: Re: [RFC v2] Support volatile range for anon vma Message-ID: <20121105235443.GA27718@dev3310.snc6.facebook.com> References: <1351560594-18366-1-git-send-email-minchan@kernel.org> <20121031143524.0509665d.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1137 Lines: 24 On Wed, Oct 31, 2012 at 06:56:05PM -0400, KOSAKI Motohiro wrote: > glibc malloc discard freed memory by using MADV_DONTNEED > as tcmalloc. and it is often a source of large performance decrease. > because of MADV_DONTNEED discard memory immediately and > right after malloc() call fall into page fault and pagesize memset() path. > then, using DONTNEED increased zero fill and cache miss rate. The memcg based solution that I posted a few months ago is working well for us. We see significantly less cpu in zero'ing pages. Not everyone was comfortable with the security implications of recycling pages between processes in a memcg, although it was disabled by default and had to be explicitly opted-in. Also, memory allocators have a second motivation in using madvise: to create virtually contiguous regions of memory from a fragmented address space, without increasing the RSS. -Arun -- 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/