Value of __*{init,exit} anotations?
On Wed, Jan 30, 2008 at 03:41:35PM -0600, James Bottomley wrote: On Wed, 2008-01-30 at 22:20 +0100, Sam Ravnborg wrote: On Wed, Jan 30, 2008 at 03:00:16PM -0600, James Bottomley wrote: ... __init is possibly justifiable with a few hundred k savings on boot. __devinit and the rest are surely killable on the grounds they provide little benefit for all the pain they cause. For the embedded people a few kb here and there is worth it. all __exit seems to do is set us up for unreferenced pointers in discarded sections, so could we kill that too? Again - savings when we build-in the drivers. And without the checks we see 'funny' linker errors on the architectues that can continue to add the .exit.text in /DISCARD/ Perhaps you have different figures, but my standard kernel linking ones tell me that the discard sections only save tens of k (not hundreds that the init ones save), so I really do think they have no real benefit and land us huge problems of pointer references into discarded sections. I don't deny we can invest large amounts of work to fix our current issues and build large scriptable checks to ensure we keep it fixed ... I'm just asking if, at the end of the day, it's really worth it. Some people consider it worth it for their memory restricted systems and would like to drive the annotations even further. [1] My experience while fixing section bugs during the last years is that the __dev{init,exit}* are actually the main question since they are both the majority of annotations and the ones that bring benefits only in a case that has become very exotic (CONFIG_HOTPLUG=n). All the other annotations either both bring value for everyone (plain __init* and __exit*) or are nothing normal drivers would use (__cpu* and _mem*). People at linux-arch (Cc'ed) might be better at explaining how often CONFIG_HOTPLUG gets used in real-life systems and how big the savings are there. That might be a good basis for deciding whether it's worth it. James cu Adrian [1] http://lkml.org/lkml/2007/10/12/297 -- Is there not promise of rain? Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. Only a promise, Lao Er said. Pearl S. Buck - Dragon Seed - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Value of __*{init,exit} anotations?
On Thu, 2008-01-31 at 00:32 +0200, Adrian Bunk wrote: On Wed, Jan 30, 2008 at 03:41:35PM -0600, James Bottomley wrote: On Wed, 2008-01-30 at 22:20 +0100, Sam Ravnborg wrote: On Wed, Jan 30, 2008 at 03:00:16PM -0600, James Bottomley wrote: ... __init is possibly justifiable with a few hundred k savings on boot. __devinit and the rest are surely killable on the grounds they provide little benefit for all the pain they cause. For the embedded people a few kb here and there is worth it. all __exit seems to do is set us up for unreferenced pointers in discarded sections, so could we kill that too? Again - savings when we build-in the drivers. And without the checks we see 'funny' linker errors on the architectues that can continue to add the .exit.text in /DISCARD/ Perhaps you have different figures, but my standard kernel linking ones tell me that the discard sections only save tens of k (not hundreds that the init ones save), so I really do think they have no real benefit and land us huge problems of pointer references into discarded sections. I don't deny we can invest large amounts of work to fix our current issues and build large scriptable checks to ensure we keep it fixed ... I'm just asking if, at the end of the day, it's really worth it. Some people consider it worth it for their memory restricted systems and would like to drive the annotations even further. [1] My experience while fixing section bugs during the last years is that the __dev{init,exit}* are actually the main question since they are both the majority of annotations and the ones that bring benefits only in a case that has become very exotic (CONFIG_HOTPLUG=n). All the other annotations either both bring value for everyone (plain __init* and __exit*) or are nothing normal drivers would use (__cpu* and _mem*). People at linux-arch (Cc'ed) might be better at explaining how often CONFIG_HOTPLUG gets used in real-life systems and how big the savings are there. That might be a good basis for deciding whether it's worth it. I'll certainly buy this. Perhaps killing everything other than __init and __exit (meaning discardable whether the system is hotplug, suspend or whatever) might get rid of 90% of the problem while still preserving 90% of the benefits. I think a lot of the issues do come from confusion over whether it should be __init, __devinint etc . We can argue later over the benefit of __exit ... James - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Value of __*{init,exit} anotations?
On Wed, Jan 30, 2008 at 04:44:12PM -0600, James Bottomley wrote: On Thu, 2008-01-31 at 00:32 +0200, Adrian Bunk wrote: People at linux-arch (Cc'ed) might be better at explaining how often CONFIG_HOTPLUG gets used in real-life systems and how big the savings are there. That might be a good basis for deciding whether it's worth it. I'll certainly buy this. Perhaps killing everything other than __init and __exit (meaning discardable whether the system is hotplug, suspend or whatever) might get rid of 90% of the problem while still preserving 90% of the benefits. I think a lot of the issues do come from confusion over whether it should be __init, __devinint etc . Just looking at HOTPLUG on ARM by a simple grep, 57 default configurations for various machines are hotplug enabled out of 75 - so it's roughly 75%. Whether that 25% remainder cares or not, I'm not sure. -- Russell King Linux kernel2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Value of __*{init,exit} anotations?
Some people consider it worth it for their memory restricted systems and would like to drive the annotations even further. [1] They could get much better bang-for-the-buck (as in memory saved for amount of work invested) by tackling some the dynamic memory allocation pigs. In general it's a trade off between how much work and patch churn versus benefit, and some of the annotations really don't look too good on this scale. People at linux-arch (Cc'ed) might be better at explaining how often CONFIG_HOTPLUG gets used in real-life systems and how big the savings are there. CONFIG_HOTPLUG is widely used for suspend on multi core systems. -Andi - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Value of __*{init,exit} anotations?
I don't deny we can invest large amounts of work to fix our current issues and build large scriptable checks to ensure we keep it fixed ... I'm just asking if, at the end of the day, it's really worth it. Some people consider it worth it for their memory restricted systems and would like to drive the annotations even further. [1] My experience while fixing section bugs during the last years is that the __dev{init,exit}* are actually the main question since they are both the majority of annotations and the ones that bring benefits only in a case that has become very exotic (CONFIG_HOTPLUG=n). Some numbers... I my current tree with an allyesconfig build for x86 64bit I see: 136 Section mismatch warnings in total 99 Section mismatch warnings from drivers/ This is with a few patches of mine applied but none of the recently posted fixes by Adrian. I am concentrating on: drivers/pci/ kernel/ mm/ Will post my patches during the weekend if things goes well. There are some low hanging fruits in drivers/ but I stay away from these from now expecting others to fix these. Sam - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html