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.
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general