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] [thread-next>] [day] [month] [year] [list]
Message-Id: <200702071915.37016.dada1@cosmosbay.com>
Date:	Wed, 7 Feb 2007 19:15:36 +0100
From:	Eric Dumazet <dada1@...mosbay.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	"linux-kernel" <linux-kernel@...r.kernel.org>
Subject: [PATCH] FS : Speedup rw_verify_area()

oprofile hunting showed a stall in rw_verify_area(), because of triple 
indirection and potential cache misses.
(file->f_path.dentry->d_inode->i_flock)

By moving initialization of 'struct inode' pointer before the pos/count sanity 
tests, we allow the compiler and processor to perform two loads by 
anticipation, reducing stall, without prefetch() hints. Even x86 arch has 
enough registers to not use temporary variables and not increase text size.

I validated this patch running a bench and studied oprofile changes, and 
absolute perf of the test program.

Results of my epoll_pipe_bench (source available on request) on a Pentium-M  
1.6 GHz machine

Before :
# ./epoll_pipe_bench -l 30 -t 20
Avg: 436089 evts/sec read_count=8843037 write_count=8843040 21.218390 samples 
per call
(best value out of 10 runs)

After :
# ./epoll_pipe_bench -l 30 -t 20
Avg: 470980 evts/sec read_count=9549871 write_count=9549894 21.216694 samples 
per call
(best value out of 10 runs)

oprofile CPU_CLK_UNHALTED events gave a reduction from 5.3401 % to 2.5851 % 
for the rw_verify_area() function.

Signed-off-by: Eric Dumazet <dada1@...mosbay.com>

View attachment "rw_verify_area.patch" of type "text/plain" (629 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ