提交 27d1439d 编写于 作者: Y Yang Yingliang 提交者: openeuler-sync-bot

fs/stat: make tmp variable 16-bytes aligned in copy stat

hulk inclusion
category: performance
bugzilla: https://gitee.com/openeuler/kernel/issues/I7F4XV

--------------------------------

The tmp variable is used to copy_to_user(), it has better
performance if the address accesseed by ldp instruction
is 16 bytes aligned on arm64.

The performance of nginx test is improved after this patch:
http "Connection: close"	1.11%
http "Connection: keep-alive"	2.11%
https "Connection: close"	1.56%
https "Connection: keep-alive"	0.18%
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
(cherry picked from commit 2b34be30)
上级 217f35e0
......@@ -225,7 +225,7 @@ int vfs_fstatat(int dfd, const char __user *filename,
static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * statbuf)
{
static int warncount = 5;
struct __old_kernel_stat tmp;
struct __old_kernel_stat __aligned(16) tmp;
if (warncount > 0) {
warncount--;
......@@ -312,7 +312,7 @@ SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, stat
static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
{
struct stat tmp;
struct stat __aligned(16) tmp;
if (sizeof(tmp.st_dev) < 4 && !old_valid_dev(stat->dev))
return -EOVERFLOW;
......@@ -457,7 +457,7 @@ SYSCALL_DEFINE3(readlink, const char __user *, path, char __user *, buf,
static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
{
struct stat64 tmp;
struct stat64 __aligned(16) tmp;
INIT_STRUCT_STAT64_PADDING(tmp);
#ifdef CONFIG_MIPS
......@@ -541,7 +541,7 @@ SYSCALL_DEFINE4(fstatat64, int, dfd, const char __user *, filename,
static noinline_for_stack int
cp_statx(const struct kstat *stat, struct statx __user *buffer)
{
struct statx tmp;
struct statx __aligned(16) tmp;
memset(&tmp, 0, sizeof(tmp));
......@@ -613,7 +613,7 @@ SYSCALL_DEFINE5(statx,
#ifdef CONFIG_COMPAT
static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
{
struct compat_stat tmp;
struct compat_stat __aligned(16) tmp;
if (sizeof(tmp.st_dev) < 4 && !old_valid_dev(stat->dev))
return -EOVERFLOW;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册