[openib-general] Re: user_mad: large rmpp length problem

Roland Dreier rolandd at cisco.com
Sun Nov 27 16:17:42 PST 2005


 > Allocate memory for large MAD buffers with __get_free_pages,
 > making it possible to get buffers up to 512KB in size.

Ugh, why is this an improvement?!  What are the chances of an order-9
allocation succeeding on a system that's been running for a while?

 > +	if (length >= PAGE_SIZE)
 > +		buf = (void *)__get_free_pages(gfp_mask, long_log2(roundup_pow_of_two(length)) - PAGE_SHIFT);
 > +	else
 > +		buf = kmalloc(length, gfp_mask);

this is extra-gross too.

I don't think this is worth it -- much better to fix the MAD API to
handle gather/scatter lists.

 - R.



More information about the general mailing list