[openib-general] [PATCH 02/17] ehca: module infrastructure

Heiko J Schick schihei at de.ibm.com
Fri Mar 3 06:17:18 PST 2006


Hello Christoph,

I only did kmalloc(PAGE_SIZE, GFP_KERNEL) because we need
some amount of memory which is 4k aligned. I'm not sure,
but I think if I use kmalloc(SIZE, GFP_KERNEL) and SIZE
is smaller as 4k the memory will not be 4k aligned?

If that is the case we can change kmalloc(PAGE_SIZE, ...)
to __get_zeroed_page(...).

Regards,
	Heiko

Christoph Hellwig wrote:
>> > +	rblock = kmalloc(PAGE_SIZE, GFP_KERNEL);
>> > +	if (rblock == NULL) {
>> > +		EDEB_ERR(4, "Cannot allocate rblock memory.");
>> > +		ret = -ENOMEM;
>> > +		goto num_ports0;
>> > +	}
>> > +
>> > +	memset(rblock, 0, PAGE_SIZE);
>>
>>Use kzalloc instead (this appears a quite a few places).
> 
> 
> for a page-sized allocation __get_zeroed_page sounds better anyway.





More information about the general mailing list