]> git.baikalelectronics.ru Git - kernel.git/commit
mm/hugetlb: avoid calculating fault_mutex_hash in truncate_op case
authorMiaohe Lin <linmiaohe@huawei.com>
Wed, 5 May 2021 01:33:34 +0000 (18:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 5 May 2021 18:27:20 +0000 (11:27 -0700)
commitce3e9f3ee160bd6ccffa1221b5d5ba7ab9b1ade3
tree17a9a6758bcb4f3cc25e1b31712a548c8bcfc7bc
parent87bc9a2d55444651f9b4c52572abae630a8c1bfc
mm/hugetlb: avoid calculating fault_mutex_hash in truncate_op case

The fault_mutex hashing overhead can be avoided in truncate_op case
because page faults can not race with truncation in this routine.

So calculate hash for fault_mutex only in !truncate_op case to save some
cpu cycles.

Link: https://lkml.kernel.org/r/20210308112809.26107-6-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/hugetlbfs/inode.c