[Intel-gfx] [PATCH] drm/i915: allocate large pointer arrays with vmalloc

Jesse Barnes jbarnes at virtuousgeek.org
Sat May 9 01:06:15 CEST 2009


On Fri, 8 May 2009 16:02:54 -0700
Jesse Barnes <jbarnes at virtuousgeek.org> wrote:

> On Fri, 08 May 2009 15:28:47 -0700
> Keith Packard <keithp at keithp.com> wrote:
> 
> > On Fri, 2009-05-08 at 14:51 -0700, Jesse Barnes wrote:
> > 
> > > +static __inline void drm_free_large(void *ptr, int size)
> > > +{
> > > +	if (size <= PAGE_SIZE)
> > > +		return kfree(ptr);
> > > +
> > > +	vfree(ptr);
> > > +}
> > 
> > Ick. Taking a size here is mean. And error prone.
> 
> Yes, suggestions for alternatives?

I suppose we could do:

static __inline void drm_free_large(void *ptr)
{
	if (addr >= VMALLOC_START)
		return vfree(ptr);

	kfree(ptr);
}

but that may be too ugly to live as well.

-- 
Jesse Barnes, Intel Open Source Technology Center



More information about the Intel-gfx mailing list