Re: [PATCH 1/3] slab: introduce krealloc

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Christoph Lameter
Date: Wednesday, February 21, 2007 - 11:48 am

On Wed, 21 Feb 2007, Pekka Enberg wrote:


Why not? Its a realloc call and these are the classic semantics of 
realloc. Otherwise realloc will always move the memory.


Check that both sizes fall into the same general cache. Do the following 
at the beginning of the function

struct kmem_cache *cachep = page_get_slab(virt_to_page(object));

if (new_size && cachep == kmem_find_general_cachep(new_size, 
cachep->gfpflags))
	/*
	 * Old and new object size us the same general slab so we do not 
	 * have to do anything
	 */
	return object;

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/3] slab: introduce krealloc, Pekka J Enberg, (Wed Feb 21, 1:06 am)
Re: [PATCH 1/3] slab: introduce krealloc, Arjan van de Ven, (Wed Feb 21, 2:24 am)
Re: [PATCH 1/3] slab: introduce krealloc, Pekka Enberg, (Wed Feb 21, 2:33 am)
Re: [PATCH 1/3] slab: introduce krealloc, Arjan van de Ven, (Wed Feb 21, 2:36 am)
Re: [PATCH 1/3] slab: introduce krealloc, Christoph Lameter, (Wed Feb 21, 10:51 am)
Re: [PATCH 1/3] slab: introduce krealloc, Christoph Lameter, (Wed Feb 21, 10:53 am)
Re: [PATCH 1/3] slab: introduce krealloc, Pekka Enberg, (Wed Feb 21, 11:21 am)
Re: [PATCH 1/3] slab: introduce krealloc, Christoph Lameter, (Wed Feb 21, 11:27 am)
Re: [PATCH 1/3] slab: introduce krealloc, Pekka Enberg, (Wed Feb 21, 11:37 am)
Re: [PATCH 1/3] slab: introduce krealloc, Christoph Lameter, (Wed Feb 21, 11:48 am)
Re: [PATCH 1/3] slab: introduce krealloc, Pekka Enberg, (Wed Feb 21, 12:19 pm)
Re: [PATCH 1/3] slab: introduce krealloc, Christoph Lameter, (Wed Feb 21, 12:22 pm)