lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 20 Dec 2017 10:35:36 +0100
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Christophe Leroy <christophe.leroy@....fr>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        linux-gpio@...r.kernel.org
Subject: Re: [PATCH 4/4] gpio: sysfs: avoid using kstrtol() in 'value'
 attribute write

On Mon, Dec 18, 2017 at 11:08 AM, Christophe Leroy
<christophe.leroy@....fr> wrote:

> A 'perf record' on an app continuously writing in the 'value'
> attribute show that most of the time is spent in kstrtol()
>
> --17.99%--value_store
>           |
>           |--10.17%--kstrtoint
>           |          |
>           |          |--8.82%--kstrtoll
>           |
>           |--2.50%--gpiod_set_value_cansleep
>           |
>           |--1.82%--u16_gpio_set
>           |
>           |--1.46%--value_store
>
> The normal case is to write 0 or 1 in the attribute, therefore
> this patch avoids the call to kstrtol() in the most common cases
>
> Then 'perf record' shows
>
> --7.21%--value_store
>           |
>           |--2.69%--u16_gpio_set
>           |
>           |--1.47%--value_store
>           |
>           |--1.08%--gpiod_set_value_cansleep
>           |
>           |--0.60%--mutex_lock
>           |
>            --0.58%--mutex_unlock
>
> Signed-off-by: Christophe Leroy <christophe.leroy@....fr>

Patch applied.

Yours,
Linus Walleij

Powered by blists - more mailing lists