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-next>] [day] [month] [year] [list]
Date:   Tue, 9 Mar 2021 10:40:12 +0800
From:   Xiangyang Yu <yuxiangyang4@...wei.com>
To:     <tglx@...utronix.de>, <mingo@...hat.com>, <peterz@...radead.org>,
        <dvhart@...radead.org>
CC:     <linux-kernel@...r.kernel.org>, <yuxiangyang4@...wei.com>
Subject: [PATCH] kernel/futex: Change pi_state_update_owner() to an inline function

In our performance tests, we find that the performance of
sysbench is descend. Function call consumes too many instructions,
change pi_state_update_owner() to an inline function.

Test environment:
CPU: Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz * 2
MEM: 312G

Test case: https://github.com/akopytov/sysbench
Test cmd: ./sysbench --test=threads --num-threads=$thr
              --thread-yields=100 --thread-locks=2 run

$thr    stock   non-inline   inline
256    0.8511     0.9254     0.8588
512    0.8489     0.9232     0.8503
1024   0.8347     0.9248     0.8495
2048   0.8338     0.9575     0.8402

Signed-off-by: Xiangyang Yu <yuxiangyang4@...wei.com>
---
 kernel/futex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index e68db7745039..570dee4e9e6f 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -763,7 +763,7 @@ static struct futex_pi_state *alloc_pi_state(void)
 	return pi_state;
 }
 
-static void pi_state_update_owner(struct futex_pi_state *pi_state,
+static inline void pi_state_update_owner(struct futex_pi_state *pi_state,
 				  struct task_struct *new_owner)
 {
 	struct task_struct *old_owner = pi_state->owner;
-- 
2.23.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ