[Devel] Re: [PATCH 2/4] Switch caches notification dynamically

Pavel Emelyanov xemul at openvz.org
Mon Sep 17 23:54:08 PDT 2007


Christoph Lameter wrote:
> On Mon, 17 Sep 2007, Pavel Emelyanov wrote:
> 
>>  struct kmem_cache kmalloc_caches[PAGE_SHIFT] __cacheline_aligned;
>>  EXPORT_SYMBOL(kmalloc_caches);
>>  
>> +static inline int is_kmalloc_cache(struct kmem_cache *s)
>> +{
>> +	int km_idx;
>> +
>> +	km_idx = s - kmalloc_caches;
>> +	return km_idx >= 0 && km_idx < ARRAY_SIZE(kmalloc_caches);
>> +}
> 
> 
> Could be as simple at
> 
> 	return s > kmalloc_caches && s < kmalloc_caches + 
> ARRAY_SIZE(kmalloc_caches);
> 
> 
>> +	if (buf[0] == '0') {
>> +		if (any_slab_objects(s))
>> +			/*
>> +			 * we cannot turn this off because of the
>> +			 * full slabs cannot be found in this case
>> +			 */
>> +			return -EBUSY;
> 
> The full slabs can be checked by subtracting the partial slabs from the 
> allocated slabs in the per node structure.

No no! This is not that I meant here. This is just like the redzoning
turning on/off dynamically.

I meant that we cannot find the pages that are full of objects to notify
others that these ones are no longer tracked. I know that we can do
it by tracking these pages with some performance penalty, but does it
worth having the ability to turn notifications off by the cost of the
performance degradation?

Thanks,
Pavel




More information about the Devel mailing list