lkml.org 
[lkml]   [2013]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args
On Sat, 16 Mar 2013 17:54:47 +0000 Al Viro <viro@ZenIV.linux.org.uk> wrote:

> On Sat, Mar 16, 2013 at 06:50:44AM -0700, Joe Perches wrote:
> > Instead of converting the 800 or so uses of seq_printf with
> > a constant format (without a % substitution) to seq_puts,
> > maybe there's another way to slightly speed up these outputs.
> >
> > Taking a similar approach to commit abd84d60eb
> > ("tracing: Optimize trace_printk() with one arg to use trace_puts()")
> > use the preprocessor to convert seq_printf(seq, "string constant")
> > to seq_puts(seq, "string constant")
> >
> > By stringifying __VA_ARGS__, we can, at compile time, determine
> > the number of args that are being passed to seq_printf() and
> > call seq_puts or seq_printf appropriately.
> >
> > The actual function definition for seq_printf must now
> > be enclosed in parenthesis to avoid further macro expansion.
>
> Joe, would you mind showing me a single real-world case where that
> "optimization" would really matter?

There's also a small reduction in code footprint. We merge less
significant things all day ;)

> NAKed-because: GAFL

Yeah, that macro thing should be nuked from orbit. Please let's add the
checkpatch rule (resend when convenient with clean changelog, please)
and if people want to send "convert seq_printk to seq_puts" patches to
Jan and he takes them into the trivial tree then all is good.


\
 
 \ /
  Last update: 2013-03-18 22:47    [W:0.078 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site