Re: [patch 3/4] cpu alloc: The allocator

From: Christoph Lameter
Date: Fri Sep 19 2008 - 12:51:43 EST


Eric Dumazet wrote:

>> + unsigned long start;
>> + int units = size_to_units(size);
>> + void *ptr;
>> + int first;
>> + unsigned long flags;
>> +
>> + if (!size)
>> + return ZERO_SIZE_PTR;
>> +
>> + WARN_ON(align > PAGE_SIZE);
>
> if (align < UNIT_SIZE)
> align = UNIT_SIZE;

size_to_units() does round up:


/*
* How many units are needed for an object of a given size
*/
static int size_to_units(unsigned long size)
{
return DIV_ROUND_UP(size, UNIT_SIZE);
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/