From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail202.messagelabs.com (mail202.messagelabs.com [216.82.254.227]) by kanga.kvack.org (Postfix) with ESMTP id 6E95C6B00AC for ; Mon, 3 Jan 2011 09:01:49 -0500 (EST) Date: Mon, 3 Jan 2011 08:58:15 -0500 From: Ted Ts'o Subject: Re: Should we be using unlikely() around tests of GFP_ZERO? Message-ID: <20110103135815.GA6024@thunk.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org To: Pekka Enberg Cc: Minchan Kim , Christoph Lameter , Pekka Enberg , Matt Mackall , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Steven Rostedt , David Rientjes , npiggin@kernel.dk List-ID: On Mon, Jan 03, 2011 at 09:40:57AM +0200, Pekka Enberg wrote: > I guess the rationale here is that if you're going to take the hit of > memset() you can take the hit of unlikely() as well. We're optimizing > for hot call-sites that allocate a small amount of memory and > initialize everything themselves. That said, I don't think the > unlikely() annotation matters much either way and am for removing it > unless people object to that. I suspect for many slab caches, all of the slab allocations for a given slab cache type will have the GFP_ZERO flag passed. So maybe it would be more efficient to zap the entire page when it is pressed into service for a particular slab cache, so we can avoid needing to use memset on a per-object basis? - Ted -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: email@kvack.org