From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail190.messagelabs.com (mail190.messagelabs.com [216.82.249.51]) by kanga.kvack.org (Postfix) with SMTP id A31A26B00BF for ; Mon, 23 Feb 2009 10:42:26 -0500 (EST) From: Nick Piggin Subject: Re: [PATCH 04/20] Convert gfp_zone() to use a table of precalculated values Date: Tue, 24 Feb 2009 02:41:47 +1100 References: <1235344649-18265-1-git-send-email-mel@csn.ul.ie> <1235344649-18265-5-git-send-email-mel@csn.ul.ie> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902240241.48575.nickpiggin@yahoo.com.au> Sender: owner-linux-mm@kvack.org To: Christoph Lameter Cc: Mel Gorman , Linux Memory Management List , Pekka Enberg , Rik van Riel , KOSAKI Motohiro , Johannes Weiner , Nick Piggin , Linux Kernel Mailing List , Lin Ming , Zhang Yanmin List-ID: On Tuesday 24 February 2009 02:23:52 Christoph Lameter wrote: > On Sun, 22 Feb 2009, Mel Gorman wrote: > > Every page allocation uses gfp_zone() to calcuate what the highest zone > > allowed by a combination of GFP flags is. This is a large number of > > branches to have in a fast path. This patch replaces the branches with a > > lookup table that is calculated at boot-time and stored in the > > read-mostly section so it can be shared. This requires __GFP_MOVABLE to > > be redefined but it's debatable as to whether it should be considered a > > zone modifier or not. > > Are you sure that this is a benefit? Jumps are forward and pretty short > and the compiler is optimizing a branch away in the current code. Pretty easy to mispredict there, though, especially as you can tend to get allocations interleaved between kernel and movable (or simply if the branch predictor is cold there are a lot of branches on x86-64). I would be interested to know if there is a measured improvement. It adds an extra dcache line to the footprint, but OTOH the instructions you quote is more than one icache line, and presumably Mel's code will be a lot shorter. > > 0xffffffff8027bde8 : mov %esi,-0x58(%rbp) -- 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/ . Don't email: email@kvack.org