From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx136.postini.com [74.125.245.136]) by kanga.kvack.org (Postfix) with SMTP id 157D26B0002 for ; Thu, 21 Feb 2013 17:23:28 -0500 (EST) Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 21 Feb 2013 17:23:26 -0500 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id ACBD038C9914 for ; Thu, 21 Feb 2013 17:11:30 -0500 (EST) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r1LMBT3o275696 for ; Thu, 21 Feb 2013 17:11:29 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r1LMBTvs014658 for ; Thu, 21 Feb 2013 19:11:29 -0300 Date: Thu, 21 Feb 2013 12:36:50 -0800 From: Cody P Schafer Subject: Re: [PATCHv6 1/8] zsmalloc: add to mm/ Message-ID: <20130221203650.GB3778@negative> References: <1361397888-14863-1-git-send-email-sjenning@linux.vnet.ibm.com> <1361397888-14863-2-git-send-email-sjenning@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1361397888-14863-2-git-send-email-sjenning@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: Seth Jennings Cc: Andrew Morton , Greg Kroah-Hartman , Nitin Gupta , Minchan Kim , Konrad Rzeszutek Wilk , Dan Magenheimer , Robert Jennings , Jenifer Hopper , Mel Gorman , Johannes Weiner , Rik van Riel , Larry Woodman , Benjamin Herrenschmidt , Dave Hansen , Joe Perches , Joonsoo Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org On Wed, Feb 20, 2013 at 04:04:41PM -0600, Seth Jennings wrote: > diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c > +#define MAX(a, b) ((a) >= (b) ? (a) : (b)) > +/* ZS_MIN_ALLOC_SIZE must be multiple of ZS_ALIGN */ > +#define ZS_MIN_ALLOC_SIZE \ > + MAX(32, (ZS_MAX_PAGES_PER_ZSPAGE << PAGE_SHIFT >> OBJ_INDEX_BITS)) Could you use the max(a,b) defined in include/linux/kernel.h? -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759092Ab3BUW1t (ORCPT ); Thu, 21 Feb 2013 17:27:49 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:37016 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756628Ab3BUW1s (ORCPT ); Thu, 21 Feb 2013 17:27:48 -0500 Date: Thu, 21 Feb 2013 12:36:50 -0800 From: Cody P Schafer To: Seth Jennings Cc: Andrew Morton , Greg Kroah-Hartman , Nitin Gupta , Minchan Kim , Konrad Rzeszutek Wilk , Dan Magenheimer , Robert Jennings , Jenifer Hopper , Mel Gorman , Johannes Weiner , Rik van Riel , Larry Woodman , Benjamin Herrenschmidt , Dave Hansen , Joe Perches , Joonsoo Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: Re: [PATCHv6 1/8] zsmalloc: add to mm/ Message-ID: <20130221203650.GB3778@negative> References: <1361397888-14863-1-git-send-email-sjenning@linux.vnet.ibm.com> <1361397888-14863-2-git-send-email-sjenning@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1361397888-14863-2-git-send-email-sjenning@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13022122-9360-0000-0000-000010F75C0F Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 20, 2013 at 04:04:41PM -0600, Seth Jennings wrote: > diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c > +#define MAX(a, b) ((a) >= (b) ? (a) : (b)) > +/* ZS_MIN_ALLOC_SIZE must be multiple of ZS_ALIGN */ > +#define ZS_MIN_ALLOC_SIZE \ > + MAX(32, (ZS_MAX_PAGES_PER_ZSPAGE << PAGE_SHIFT >> OBJ_INDEX_BITS)) Could you use the max(a,b) defined in include/linux/kernel.h?