User: Password:
Subscribe / Log in / New account



Posted Feb 21, 2009 14:26 UTC (Sat) by corbet (editor, #1)
In reply to: Getting the measure of ksize() by oak
Parent article: Getting the measure of ksize()

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.

(Log in to post comments)


Posted Feb 28, 2009 7:00 UTC (Sat) by (guest, #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.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds