Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755954AbZDVRM1 (ORCPT ); Wed, 22 Apr 2009 13:12:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754184AbZDVRMA (ORCPT ); Wed, 22 Apr 2009 13:12:00 -0400 Received: from e38.co.us.ibm.com ([32.97.110.159]:57360 "EHLO e38.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753961AbZDVRL7 (ORCPT ); Wed, 22 Apr 2009 13:11:59 -0400 Subject: Re: [PATCH 18/22] Use allocation flags as an index to the zone watermark From: Dave Hansen To: Mel Gorman Cc: Linux Memory Management List , KOSAKI Motohiro , Christoph Lameter , Nick Piggin , Linux Kernel Mailing List , Lin Ming , Zhang Yanmin , Peter Zijlstra , Pekka Enberg , Andrew Morton In-Reply-To: <1240408407-21848-19-git-send-email-mel@csn.ul.ie> References: <1240408407-21848-1-git-send-email-mel@csn.ul.ie> <1240408407-21848-19-git-send-email-mel@csn.ul.ie> Content-Type: text/plain Date: Wed, 22 Apr 2009 10:11:53 -0700 Message-Id: <1240420313.10627.85.camel@nimitz> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 901 Lines: 30 On Wed, 2009-04-22 at 14:53 +0100, Mel Gorman wrote: > struct zone { > /* Fields commonly accessed by the page allocator */ > - unsigned long pages_min, pages_low, pages_high; > + union { > + struct { > + unsigned long pages_min, pages_low, pages_high; > + }; > + unsigned long pages_mark[3]; > + }; Why the union? It's a bit obfuscated for me. Why not just have a couple of these: static inline unsigned long zone_pages_min(struct zone *zone) { return zone->pages_mark[ALLOC_WMARK_MIN]; } and s/zone->pages_min/zone_pages_min(zone)/ ? -- Dave -- 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/