Found by reading the gdb disassemble func, remove the three lines in the hot path, and locks_init_lock init them by memset0: lock.fl_start = 0; lock.fl_ops = NULL; lock.fl_lmops = NULL; Tested in unixbench syscall mircobench mark, and perf locks_remove_posix from 1.32% to 1%. Improve the syscall bench from 1858 to 1873. call path: 99.08% main - 17.07% __close ... - 4.85% __arm64_sys_close - 2.74% filp_flush - 1.00$ locks_remove_posix Signed-off-by: Wentao Guan <guanwentao@xxxxxxxxxxxxx> --- fs/locks.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 44715c43460a1..14b6ee5e82ed4 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -2554,13 +2554,10 @@ void locks_remove_posix(struct file *filp, fl_owner_t owner) locks_init_lock(&lock); lock.fl_type = F_UNLCK; lock.fl_flags = FL_POSIX | FL_CLOSE; - lock.fl_start = 0; lock.fl_end = OFFSET_MAX; lock.fl_owner = owner; lock.fl_pid = current->tgid; lock.fl_file = filp; - lock.fl_ops = NULL; - lock.fl_lmops = NULL; error = vfs_lock_file(filp, F_SETLK, &lock, NULL); -- 2.20.1