Posted Feb 21, 2009 10:40 UTC (Sat) by mjcoder (guest, #54432)
[Link]
That's exactly what I thought too...
krealloc()
Posted Feb 21, 2009 14:26 UTC (Sat) by corbet (editor, #1)
[Link]
I think krealloc() does use ksize(). That's part of why it exists.
I don't know for sure, but my guess is that the networking folks don't like that approach because it requires copying the packet in the case where the needed room doesn't exist. Networking hackers hate copying packets. They would rather just allocated the extra space elsewhere if need be.
krealloc()
Posted Feb 28, 2009 7:00 UTC (Sat) by Russ.Dill@gmail.com (subscriber, #52805)
[Link]
A quick check of mm/util.c confirms this. Initially I had no idea what the network developers are thinking. If the new size will fit in the original allocation, then no locks will be taken, no sleeping, etc.
But then it occured to me that the code that needs to do the expansion may be holding locks and may be in interrupt context. Preparing to call krealloc may require releasing locks, etc, since it could take locks.