* [PATCH] no need to align .modinfo strings
@ 2010-09-02 12:24 Jan Beulich
2010-09-06 8:19 ` Rusty Russell
0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2010-09-02 12:24 UTC (permalink / raw)
To: rusty; +Cc: Michal Marek, linux-kernel
Their use is not performance critical, and hence it seems better to
save some space.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
---
include/linux/moduleparam.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- linux-2.6.36-rc3/include/linux/moduleparam.h
+++ 2.6.36-rc3-modinfo-align/include/linux/moduleparam.h
@@ -21,8 +21,8 @@
#define __module_cat(a,b) ___module_cat(a,b)
#define __MODULE_INFO(tag, name, info) \
static const char __module_cat(name,__LINE__)[] \
- __used \
- __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
+ __used __attribute__((section(".modinfo"), unused, aligned(1))) \
+ = __stringify(tag) "=" info
#else /* !MODULE */
#define __MODULE_INFO(tag, name, info)
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] no need to align .modinfo strings
2010-09-02 12:24 [PATCH] no need to align .modinfo strings Jan Beulich
@ 2010-09-06 8:19 ` Rusty Russell
2010-09-06 8:34 ` Jan Beulich
0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2010-09-06 8:19 UTC (permalink / raw)
To: Jan Beulich; +Cc: Michal Marek, linux-kernel, Andrew Morton
On Thu, 2 Sep 2010 09:54:40 pm Jan Beulich wrote:
> Their use is not performance critical, and hence it seems better to
> save some space.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
The real question is: why is gcc aligning these? Should it be aligning
any string literals at all? If so, should we look for other such wastes
of space?
Thanks,
Rusty.
> --- linux-2.6.36-rc3/include/linux/moduleparam.h
> +++ 2.6.36-rc3-modinfo-align/include/linux/moduleparam.h
> @@ -21,8 +21,8 @@
> #define __module_cat(a,b) ___module_cat(a,b)
> #define __MODULE_INFO(tag, name, info) \
> static const char __module_cat(name,__LINE__)[] \
> - __used \
> - __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
> + __used __attribute__((section(".modinfo"), unused, aligned(1))) \
> + = __stringify(tag) "=" info
> #else /* !MODULE */
> #define __MODULE_INFO(tag, name, info)
> #endif
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] no need to align .modinfo strings
2010-09-06 8:19 ` Rusty Russell
@ 2010-09-06 8:34 ` Jan Beulich
0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2010-09-06 8:34 UTC (permalink / raw)
To: Rusty Russell; +Cc: Andrew Morton, Michal Marek, linux-kernel
>>> On 06.09.10 at 10:19, Rusty Russell <rusty@rustcorp.com.au> wrote:
> On Thu, 2 Sep 2010 09:54:40 pm Jan Beulich wrote:
>> Their use is not performance critical, and hence it seems better to
>> save some space.
>>
>> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>
> Acked-by: Rusty Russell <rusty@rustcorp.com.au>
>
> The real question is: why is gcc aligning these? Should it be aligning
A performance consideration for those cases where strings are being
used a lot, I believe.
> any string literals at all? If so, should we look for other such wastes
> of space?
I think we should, at least I'm keeping an eye open to spot any such.
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-09-06 8:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-02 12:24 [PATCH] no need to align .modinfo strings Jan Beulich
2010-09-06 8:19 ` Rusty Russell
2010-09-06 8:34 ` Jan Beulich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox