sysfs_kf_seq_show() spends 87% of time in memset()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux