[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ee168801-3f7e-49ec-9a6e-14b6a4bc6a5f@default>
Date: Mon, 21 May 2012 08:04:00 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@...cle.com>
To: Seth Jennings <sjenning@...ux.vnet.ibm.com>,
Minchan Kim <minchan@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
Konrad Wilk <konrad.wilk@...cle.com>,
Nitin Gupta <ngupta@...are.org>
Subject: RE: [PATCH] zsmalloc: use unsigned long instead of void *
> From: Seth Jennings [mailto:sjenning@...ux.vnet.ibm.com]
> Subject: Re: [PATCH] zsmalloc: use unsigned long instead of void *
>
> On 05/20/2012 09:23 PM, Minchan Kim wrote:
>
> > We should use unsigned long as handle instead of void * to avoid any
> > confusion. Without this, users may just treat zs_malloc return value as
> > a pointer and try to deference it.
>
> I wouldn't have agreed with you about the need for this change as people
> should understand a void * to be the address of some data with unknown
> structure.
>
> However, I recently discussed with Dan regarding his RAMster project
> where he assumed that the void * would be an address, and as such,
> 4-byte aligned. So he has masked two bits into the two LSBs of the
> handle for RAMster, which doesn't work with zsmalloc since the handle is
> not an address.
>
> So really we do need to convey as explicitly as possible to the user
> that the handle is an _opaque_ value about which no assumption can be made.
Someone once said: "Opaque is a computer science term and has no
meaning in system software and computer engineering." ;-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists