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>] [day] [month] [year] [list]
Date:   Tue, 1 Jun 2021 10:12:37 +0800
From:   Shaokun Zhang <zhangshaokun@...ilicon.com>
To:     <linux-fsdevel@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:     Yuqi Jin <jinyuqi@...wei.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Shaokun Zhang <zhangshaokun@...ilicon.com>
Subject: [PATCH RESEND] fs: Optimized file struct to improve performance

From: Yuqi Jin <jinyuqi@...wei.com>

In the syscall process, @f_count and @f_mod are frequently used, if
we put them together with each other and they will share the same
cacheline. It is useful for the performance.

syscall of unixbench is tested on Intel 8180.
before this patch
80 CPUs in system; running 80 parallel copies of tests

System Call Overhead                    3789860.2 lps   (10.0 s, 1 samples)

System Benchmarks Partial Index              BASELINE       RESULT    INDEX
System Call Overhead                          15000.0    3789860.2   2526.6
                                                                   ========
System Benchmarks Index Score (Partial Only)                         2526.6

after this patch
80 CPUs in system; running 80 parallel copies of tests

System Call Overhead                    3951328.1 lps   (10.0 s, 1 samples)

System Benchmarks Partial Index              BASELINE       RESULT    INDEX
System Call Overhead                          15000.0    3951328.1   2634.2
                                                                   ========
System Benchmarks Index Score (Partial Only)                         2634.2

Cc: Alexander Viro <viro@...iv.linux.org.uk>
Signed-off-by: Yuqi Jin <jinyuqi@...wei.com>
Signed-off-by: Shaokun Zhang <zhangshaokun@...ilicon.com>
---
Hi,
    Sorry for the noise that I resent the patch since v1[1], while
Intel's robot gives the 19.2% improvement[2].

[1]https://www.spinics.net/lists/linux-fsdevel/msg192888.html
[2]https://www.spinics.net/lists/linux-fsdevel/msg193521.html

 include/linux/fs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index c3c88fdb9b2a..23baa7c8301b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -922,7 +922,6 @@ struct file {
 		struct llist_node	fu_llist;
 		struct rcu_head 	fu_rcuhead;
 	} f_u;
-	struct path		f_path;
 	struct inode		*f_inode;	/* cached value */
 	const struct file_operations	*f_op;
 
@@ -931,13 +930,14 @@ struct file {
 	 * Must not be taken from IRQ context.
 	 */
 	spinlock_t		f_lock;
-	enum rw_hint		f_write_hint;
 	atomic_long_t		f_count;
 	unsigned int 		f_flags;
 	fmode_t			f_mode;
 	struct mutex		f_pos_lock;
 	loff_t			f_pos;
 	struct fown_struct	f_owner;
+	enum rw_hint		f_write_hint;
+	struct path		f_path;
 	const struct cred	*f_cred;
 	struct file_ra_state	f_ra;
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ