Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1501723

Re: MD-RAID: Use seq_putc() in three status functions?

From Hannes Reinecke <hare@suse.de>
Newsgroups linux.kernel
Subject Re: MD-RAID: Use seq_putc() in three status functions?
Date 2016-10-17 10:20 +0200
Message-ID <stbjk-YS-15@gated-at.bofh.it> (permalink)
References (4 earlier) <ssOZs-3nb-27@gated-at.bofh.it> <ssWWZ-8mi-23@gated-at.bofh.it> <ssXgm-h3-21@gated-at.bofh.it> <st97Q-7NQ-9@gated-at.bofh.it> <staQi-wi-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 10/17/2016 09:39 AM, SF Markus Elfring wrote:
>>>> Does it improve code? Does it improve anything?
>>>
>>> Yes. - I got such an impression.
>>>
>>> * Is it more efficient to call the function "seq_printf" for the desired data processing
>>>   for a single character than to pass it to the function "" in a string?
>>>
>>> * Will the required data transfer shrink a bit for the affected functions because of
>>>   such a change?
>>>
>> Which are questions _you_ should be able to answer.
> 
> I wonder that the answers are not obvious for you already.
> 
> Calling the function "seq_putc" will be more efficient than "seq_printf"
> in this case because of the following reasons.
> 
> 1. How does the distribution look like for supported processor architectures
>    where the data transfer for bytes (as a function call parameter)
>    is faster than for (string) pointers?
> 
How would I know? I would assume that _you_ did some measurements here;
after all, _you_ are trying to push this patch.
I could easily claim that seq_printf() is more efficient than
seq_putc(), and won't apply your patch.
So _you_ have to prove that your patch is more efficient.

> 2. Did anybody measure already how many the execution times can vary
>    for these functions?
> 
Probably not.
But referring to the previous topic:
Unless _you_ prove that _your_ patch is more efficient it won't get
applied. _You_ want us to apply your patch, so the burden is on _you_ to
provide the required data.


>    Where do you get doubts about its efficiency for the data processing
>    of a single character?
> 
Because it's being called at the end of a function calling seq_printf()
already. So exchanging a single call is probably not helping anything,
as the compiler will optimize it anyway.
Case in point: with your patch the x86_64 compiler generates nearly
identical code for driver/md/raid1.c, but with one instruction _more_
after your patch has been applied.

So it's not immediately obvious that your patch is an improvement.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] MD-RAID: Use seq_putc() in three status functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-16 10:30 +0200
  Re: [PATCH] MD-RAID: Use seq_putc() in three status functions Hannes Reinecke <hare@suse.de> - 2016-10-16 19:00 +0200
    Re: MD-RAID: Use seq_putc() in three status functions? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-16 19:20 +0200
      Re: MD-RAID: Use seq_putc() in three status functions? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-16 19:20 +0200
      Re: MD-RAID: Use seq_putc() in three status functions? Hannes Reinecke <hare@suse.de> - 2016-10-17 08:00 +0200
        Re: MD-RAID: Use seq_putc() in three status functions? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-17 09:50 +0200
          Re: MD-RAID: Use seq_putc() in three status functions? Hannes Reinecke <hare@suse.de> - 2016-10-17 10:20 +0200
            Re: MD-RAID: Use seq_putc() in three status functions? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-17 11:10 +0200
              Re: MD-RAID: Use seq_putc() in three status functions? Hannes Reinecke <hare@suse.de> - 2016-10-17 12:00 +0200
                Re: MD-RAID: Use seq_putc() in three status functions? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-17 13:20 +0200
                Re: MD-RAID: Use seq_putc() in three status functions? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-17 13:50 +0200
                Re: MD-RAID: Use seq_putc() in three status functions? Hannes Reinecke <hare@suse.de> - 2016-10-17 16:10 +0200
                Re: MD-RAID: Use seq_putc() in three status functions? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-17 16:40 +0200
                Re: MD-RAID: Use seq_putc() in three status functions? Hannes Reinecke <hare@suse.de> - 2016-10-17 17:40 +0200
                Re: MD-RAID: Use seq_putc() in three status functions? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-17 18:10 +0200
                Re: MD-RAID: Use seq_putc() in three status functions? Hannes Reinecke <hare@suse.de> - 2016-10-17 19:20 +0200
                Re: MD-RAID: Use seq_putc() in three status functions? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-18 20:30 +0200
                Re: MD-RAID: Use seq_putc() in three status functions? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-20 14:30 +0200
                Re: MD-RAID: Use seq_putc() in three status functions? Bernd Petrovitsch <bernd@petrovitsch.priv.at> - 2016-10-17 14:20 +0200
                Re: MD-RAID: Use seq_putc() in three status functions? Hannes Reinecke <hare@suse.de> - 2016-10-17 16:10 +0200

csiph-web