On Thursday 27 March 2008 13:38, Ilpo Järvinen wrote:This will be very confusing for casual reader: "what, they want to save one push instruction per callsite??". Can you add a comment which explains the intent? +struct sk_buff *dev_alloc_skb(unsigned int length) +{ + /* There is more code here than it seems: + * __dev_alloc_skb is an inline */ + return __dev_alloc_skb(length, GFP_ATOMIC); +} +EXPORT_SYMBOL(dev_alloc_skb); Another good chunk of code size saving can be achieved by introducing dev_alloc_skb_or_warn(), and using it in places like these: drivers/net/irda/nsc-ircc.c: skb = dev_alloc_skb(len+1); if (skb == NULL) { IRDA_WARNING("%s(), memory squeeze, " "dropping frame.\n", __FUNCTION__); drivers/net/appletalk/ltpc.c: skb = dev_alloc_skb(3+sklen); if (skb == NULL) { printk("%s: dropping packet due to memory squeeze.\n", net/econet/af_econet.c: newskb = alloc_skb((len - sizeof(struct aunhdr) + 15) & ~15, GFP_ATOMIC); if (newskb == NULL) { printk(KERN_DEBUG "AUN: memory squeeze, dropping packet.\n"); /* Send nack and hope sender tries again */ goto bad; } (hmm, this last one also wants s/alloc_skb(GFP_ATOMIC)/dev_alloc_skb/) -- vda --
| Linus Torvalds | Re: [GIT]: Networking |
| Mark Lord | Re: [Bug #10391] 2.6.25-rc7/8: Another resume regression |
| David Miller | Slow DOWN, please!!! |
| James Bottomley | [Ksummit-2008-discuss] Fixing the Kernel Janitors project |
git: | |
| Ittay Dror | detecting rename->commit->modify->commit |
| Peter Stahlir | Git as a filesystem |
| Junio C Hamano | [ANNOUNCE] GIT 1.5.4 |
| Andreas Hildebrandt | CVS-$Id:$ replacement in git? |
| Gilles Chehade | Re: Real men don't attack straw men |
| carlopmart | About Xen: maybe a reiterative question but .. |
| Christophe Rioux | OpenBSD as host for VMWare Server |
| Kevin Neff | Patching a SSH 'Weakness' |
| David Miller | Re: [BUG] New Kernel Bugs |
| Pavel Emelyanov | [PATCH 4/5] Mark the setup_net as __net_init |
| Chris Snook | [PATCH 0/4] atlx: add atl2 support |
| Jeff Garzik | Re: [RFC][PATCH 1/1] cxgb3i: cxgb3 iSCSI initiator |
| high memory | 5 hours ago | Linux kernel |
| semaphore access speed | 8 hours ago | Applications and Utilities |
| the kernel how to power off the machine | 9 hours ago | Linux kernel |
| Easter Eggs in windows XP | 12 hours ago | Windows |
| Shared swap partition | 13 hours ago | Linux general |
| Root password | 13 hours ago | Linux general |
| Where/when DNOTIFY is used? | 15 hours ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 17 hours ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 17 hours ago | Linux kernel |
| USB Driver -- Interrupt Polling -- A Little Help Please | 23 hours ago | Linux general |
