lkml.org 
[lkml]   [2017]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectsysfs_kf_seq_show() spends 87% of time in memset()
Date
Hello Tejun,

Doing a 'perf record' on an application using GPIOs a lot, I discovered
that most of the time spent in the read() system call of the 'value'
sysfs file of that GPIO (which returns "0\n" or "1\n") is indeed spent
in memset() zeroing a buffer of size PAGE_SIZE for a 2 bytes read:


--1.95%--ret_from_syscall
sys_read
|
--1.93%--vfs_read
|
--1.89%--__vfs_read
|
--1.86%--seq_read
|
--1.68%--sysfs_kf_seq_show
|
--1.46%--memset

As far as I can see, that memset() was introduced by your commit
f5c16f29bf5e5 ("sysfs: make sure read buffer is zeroed")

Is that really necessary, taking into account that the ->show will
overwrite it ?

Thanks
Christophe

\
 
 \ /
  Last update: 2017-12-15 14:01    [W:0.033 / U:23.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site