提交 b6bc5e6d 编写于 作者: H Hang Xiaoqian 提交者: guzitao

sw64: remove unaligned count

Sunway inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5GFNY

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

In the case of highly concurrent unaligned processing, unaligned
count may cause severe cache thrashing. However, unaligned count
is not required, so remove it to reduce cache thrashing.
Signed-off-by: NHang Xiaoqian <hangxiaoqian@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 edb81706
...@@ -31,7 +31,7 @@ obj-$(CONFIG_HIBERNATION) += hibernate_asm.o hibernate.o ...@@ -31,7 +31,7 @@ obj-$(CONFIG_HIBERNATION) += hibernate_asm.o hibernate.o
obj-$(CONFIG_AUDIT) += audit.o obj-$(CONFIG_AUDIT) += audit.o
obj-$(CONFIG_PCI) += pci_common.o obj-$(CONFIG_PCI) += pci_common.o
obj-$(CONFIG_RELOCATABLE) += relocate.o obj-$(CONFIG_RELOCATABLE) += relocate.o
obj-$(CONFIG_DEBUG_FS) += unaligned.o segvdbg.o obj-$(CONFIG_DEBUG_FS) += segvdbg.o
obj-$(CONFIG_JUMP_LABEL) += jump_label.o obj-$(CONFIG_JUMP_LABEL) += jump_label.o
ifndef CONFIG_PCI ifndef CONFIG_PCI
......
...@@ -320,11 +320,6 @@ do_entIF(unsigned long inst_type, struct pt_regs *regs) ...@@ -320,11 +320,6 @@ do_entIF(unsigned long inst_type, struct pt_regs *regs)
force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc, 0); force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc, 0);
} }
struct unaligned_stat {
unsigned long count, va, pc;
} unaligned[2];
asmlinkage void asmlinkage void
do_entUna(void *va, unsigned long opcode, unsigned long reg, do_entUna(void *va, unsigned long opcode, unsigned long reg,
struct pt_regs *regs) struct pt_regs *regs)
...@@ -334,10 +329,6 @@ do_entUna(void *va, unsigned long opcode, unsigned long reg, ...@@ -334,10 +329,6 @@ do_entUna(void *va, unsigned long opcode, unsigned long reg,
unsigned long pc = regs->pc - 4; unsigned long pc = regs->pc - 4;
const struct exception_table_entry *fixup; const struct exception_table_entry *fixup;
unaligned[0].count++;
unaligned[0].va = (unsigned long) va;
unaligned[0].pc = pc;
/* /*
* We don't want to use the generic get/put unaligned macros as * We don't want to use the generic get/put unaligned macros as
* we want to trap exceptions. Only if we actually get an * we want to trap exceptions. Only if we actually get an
...@@ -666,10 +657,6 @@ do_entUnaUser(void __user *va, unsigned long opcode, ...@@ -666,10 +657,6 @@ do_entUnaUser(void __user *va, unsigned long opcode,
if ((unsigned long)va >= TASK_SIZE) if ((unsigned long)va >= TASK_SIZE)
goto give_sigsegv; goto give_sigsegv;
++unaligned[1].count;
unaligned[1].va = (unsigned long)va;
unaligned[1].pc = regs->pc - 4;
if ((1L << opcode) & OP_INT_MASK) { if ((1L << opcode) & OP_INT_MASK) {
/* it's an integer load/store */ /* it's an integer load/store */
if (reg < 30) { if (reg < 30) {
......
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2020 Mao Minkai
* Author: Mao Minkai
*
* This code is taken from arch/mips/kernel/segment.c
* Copyright (C) 2013 Imagination Technologies Ltd.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <asm/unaligned.h>
#include <asm/debug.h>
static int show_unaligned(struct seq_file *sf, void *v)
{
extern struct unaligned_stat {
unsigned long count, va, pc;
} unaligned[2];
seq_printf(sf, "kernel unaligned acc\t: %ld (pc=%lx, va=%lx)\n", unaligned[0].count, unaligned[0].pc, unaligned[0].va);
seq_printf(sf, "user unaligned acc\t: %ld (pc=%lx, va=%lx)\n", unaligned[1].count, unaligned[1].pc, unaligned[1].va);
return 0;
}
static int unaligned_open(struct inode *inode, struct file *file)
{
return single_open(file, show_unaligned, NULL);
}
static const struct file_operations unaligned_fops = {
.open = unaligned_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static int __init unaligned_info(void)
{
struct dentry *unaligned;
if (!sw64_debugfs_dir)
return -ENODEV;
unaligned = debugfs_create_file("unaligned", S_IRUGO,
sw64_debugfs_dir, NULL,
&unaligned_fops);
if (!unaligned)
return -ENOMEM;
return 0;
}
device_initcall(unaligned_info);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册