[Devel] [PATCH RHEL8 COMMIT] x86/cpuid_fault: Increase max count of cpuid overrides
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Apr 13 19:56:12 MSK 2021
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.12
------>
commit 31a60176dce5f50a17513416349e1ffa07eb62c9
Author: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
Date: Tue Apr 13 19:56:12 2021 +0300
x86/cpuid_fault: Increase max count of cpuid overrides
Due to implementation of cpu pools task, a maximum of 16 cpuid overrides
has become too small. Increase it to 128.
Also as the amount of records has now grown, the maximum write size has
also grown, so get_free_page has been changed to get_free_pages with
order 1.
Also the ratelimited logging now might skip some of the lines written to
cpuid_override file and it would be hard to debug if the parsing has
been performed correctly.
https://jira.sw.ru/browse/PSBM-126172
Signed-off-by: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
---
arch/x86/kernel/cpuid_fault.c | 4 ++--
include/linux/cpuid_override.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/cpuid_fault.c b/arch/x86/kernel/cpuid_fault.c
index cb6c2216fa8a..2093b6bfe71f 100644
--- a/arch/x86/kernel/cpuid_fault.c
+++ b/arch/x86/kernel/cpuid_fault.c
@@ -133,7 +133,7 @@ static ssize_t cpuid_override_write(struct file *file, const char __user *buf,
if (!t)
goto out;
- page = (void *)__get_free_page(GFP_KERNEL);
+ page = (void *)__get_free_pages(GFP_KERNEL, 1);
if (!page)
goto out;
@@ -158,7 +158,7 @@ static ssize_t cpuid_override_write(struct file *file, const char __user *buf,
}
err = 0;
out:
- free_page((unsigned long)page);
+ free_pages((unsigned long)page, 1);
if (!err)
cpuid_override_update(t);
diff --git a/include/linux/cpuid_override.h b/include/linux/cpuid_override.h
index ea0fa7af3d3c..4ee9b0504d88 100644
--- a/include/linux/cpuid_override.h
+++ b/include/linux/cpuid_override.h
@@ -13,7 +13,7 @@ struct cpuid_override_entry {
unsigned int edx;
};
-#define MAX_CPUID_OVERRIDE_ENTRIES 16
+#define MAX_CPUID_OVERRIDE_ENTRIES 128
struct cpuid_override_table {
struct rcu_head rcu_head;
More information about the Devel
mailing list