x86: cpu_debug.c prepare report if files are less or more then expected
PATCH 1/1 x86: cpu_debug.c prepare report if files are less or more then expected
This will prepare the report to update cpu_debug
--- arch/x86/include/asm/cpu_debug.h | 1 + arch/x86/kernel/cpu/cpu_debug.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-)
arch/x86/include/asm/cpu_debug.h +1 -0
@@ -187,6 +187,7 @@ enum cpu_processor_bit {#define CPU_ALL (CPU_INTEL_ALL | CPU_AMD_ALL)#define MAX_CPU_FILES 512 +#define MIN_CPU_FILES 10struct cpu_private {unsigned cpu;
arch/x86/kernel/cpu/cpu_debug.c +12 -0
@@ -838,6 +838,14 @@ static int cpu_init_allreg(unsigned cpu, struct dentry *dentry)return err; } +/* Send Report to maintainer if files are less or more then expected */ +static void send_report (int files,struct cpuinfo_x86 *cpui) +{ +pr_info ("Please report \"cpu_debug files %d for %x:%x:%x:%x\" to" +" [email protected]\n" , files, cpui->x86_vendor, + cpui->x86, cpui->x86_model, cpui->x86_mask); +} +static int cpu_init_cpu (void ) {struct dentry *cpu_dentry =NULL ;
@@ -861,9 +869,13 @@ static int cpu_init_cpu(void)pr_info ("cpu%d(%d) debug files %d\n" , cpu, nr_cpu_ids,per_cpu (cpu_priv_count, cpu)); +if ((per_cpu (cpu_priv_count, cpu) <MIN_CPU_FILES ) && !cpu) +send_report (per_cpu (cpu_priv_count, cpu), cpui); +if (per_cpu (cpu_priv_count, cpu) >MAX_CPU_FILES ) {pr_err ("Register files count %d exceeds limit %d\n" ,per_cpu (cpu_priv_count, cpu),MAX_CPU_FILES ); +send_report (per_cpu (cpu_priv_count, cpu), cpui);per_cpu (cpu_priv_count, cpu) =MAX_CPU_FILES ; err = -ENFILE ; }
Signature · 1 line
1.6.0.6
Quoted 25 lines · Jaswinder Singh Rajput
This will prepare the report to update
cpu_debugSigned-off-by Jaswinder Singh Rajput <[email protected]>--- arch/x86/include/asm/cpu_debug.h | 1 + arch/x86/kernel/cpu/cpu_debug.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-)arch/x86/include/asm/cpu_debug.h +1
-0@@ -187,6 +187,7 @@ enum cpu_processor_bit {#define CPU_ALL (CPU_INTEL_ALL | CPU_AMD_ALL)#define MAX_CPU_FILES 512 +#define MIN_CPU_FILES 10struct cpu_private {unsigned cpu;arch/x86/kernel/cpu/cpu_debug.c +0
-0
arch/x86/kernel/cpu/cpu_debug.c static int cpu_init_allreg(unsigned cpu, struct dentry *dentry) · line 846
Quoted 9 lines
arch/x86/kernel/cpu/cpu_debug.c +6
-0@@ -838,6 +838,14 @@ static int cpu_init_allreg(unsigned cpu, struct dentry *dentry)return err; } +/* Send Report to maintainer if files are less or more then expected */ +static void send_report (int files,struct cpuinfo_x86 *cpui) +{ +pr_info ("Please report \"cpu_debug files %d for %x:%x:%x:%x\" to" +" [email protected]\n" , files, cpui->x86_vendor, + cpui->x86, cpui->x86_model, cpui->x86_mask);
i'd rather see this reported to [email protected], plus please use a WARN_ONCE() instead of a pr_info(). Hitting this is a bug we want to fix.
Ingo
Quoted 30 lines · Ingo Molnar
Quoted 28 lines · Jaswinder Singh Rajput
This will prepare the report to update
cpu_debugSigned-off-by Jaswinder Singh Rajput <[email protected]>--- arch/x86/include/asm/cpu_debug.h | 1 + arch/x86/kernel/cpu/cpu_debug.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-)arch/x86/include/asm/cpu_debug.h +1
-0@@ -187,6 +187,7 @@ enum cpu_processor_bit {#define CPU_ALL (CPU_INTEL_ALL | CPU_AMD_ALL)#define MAX_CPU_FILES 512 +#define MIN_CPU_FILES 10struct cpu_private {unsigned cpu;arch/x86/kernel/cpu/cpu_debug.c +0
-0@@ -838,6 +838,14 @@ static int cpu_init_allreg(unsigned cpu, struct dentry *dentry)return err; }
Quoted 11 lines
arch/x86/kernel/cpu/cpu_debug.c static int cpu_init_allreg(unsigned cpu, struct dentry *dentry) · line 846
Quoted 6 lines
arch/x86/kernel/cpu/cpu_debug.c +6
-0+/* Send Report to maintainer if files are less or more then expected */ +static void send_report (int files,struct cpuinfo_x86 *cpui) +{ +pr_info ("Please report \"cpu_debug files %d for %x:%x:%x:%x\" to" +" [email protected]\n" , files, cpui->x86_vendor, + cpui->x86, cpui->x86_model, cpui->x86_mask);i'd rather see this reported to [email protected], plus please use a
WARN_ONCE()instead of apr_info(). Hitting this is a bug we want to fix.
Subject: [PATCH] x86: cpu_debug.c prepare report if files are less or more then expected
This will prepare the report to update cpu_debug
--- arch/x86/include/asm/cpu_debug.h | 1 + arch/x86/kernel/cpu/cpu_debug.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 0 deletions(-)
arch/x86/include/asm/cpu_debug.h +1 -0
@@ -187,6 +187,7 @@ enum cpu_processor_bit {#define CPU_ALL (CPU_INTEL_ALL | CPU_AMD_ALL)#define MAX_CPU_FILES 512 +#define MIN_CPU_FILES 10struct cpu_private {unsigned cpu;
arch/x86/kernel/cpu/cpu_debug.c +14 -0
@@ -30,6 +30,8 @@#include <asm/apic.h> #include <asm/desc.h> +#define
@@ -838,6 +840,14 @@ static int cpu_init_allreg(unsigned cpu, struct dentry *dentry)return err; } +/* Prepare report for LKML and maintainer if files count are inappropriate */ +static void send_report (int files,struct cpuinfo_x86 *cpui) +{ +WARN_ONCE (1 ,"Please report \"cpu_debug files %d for %x:%x:%x:%x\" to" +" %s\n" , files, cpui->x86_vendor, cpui->x86, cpui->x86_model, + cpui->x86_mask,static int cpu_init_cpu (void ) {struct dentry *cpu_dentry =NULL ;
@@ -861,9 +871,13 @@ static int cpu_init_cpu(void)pr_info ("cpu%d(%d) debug files %d\n" , cpu, nr_cpu_ids,per_cpu (cpu_priv_count, cpu)); +if ((per_cpu (cpu_priv_count, cpu) <MIN_CPU_FILES )) +send_report (per_cpu (cpu_priv_count, cpu), cpui); +if (per_cpu (cpu_priv_count, cpu) >MAX_CPU_FILES ) {pr_err ("Register files count %d exceeds limit %d\n" ,per_cpu (cpu_priv_count, cpu),MAX_CPU_FILES ); +send_report (per_cpu (cpu_priv_count, cpu), cpui);per_cpu (cpu_priv_count, cpu) =MAX_CPU_FILES ; err = -ENFILE ; }
Signature · 1 line
1.6.0.6
Quoted 43 lines · Jaswinder Singh Rajput
Quoted 30 lines · Ingo Molnar
Quoted 28 lines · Jaswinder Singh Rajput
This will prepare the report to update
cpu_debugSigned-off-by Jaswinder Singh Rajput <[email protected]>--- arch/x86/include/asm/cpu_debug.h | 1 + arch/x86/kernel/cpu/cpu_debug.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-)arch/x86/include/asm/cpu_debug.h +1
-0@@ -187,6 +187,7 @@ enum cpu_processor_bit {#define CPU_ALL (CPU_INTEL_ALL | CPU_AMD_ALL)#define MAX_CPU_FILES 512 +#define MIN_CPU_FILES 10struct cpu_private {unsigned cpu;arch/x86/kernel/cpu/cpu_debug.c +0
-0@@ -838,6 +838,14 @@ static int cpu_init_allreg(unsigned cpu, struct dentry *dentry)return err; }Quoted 11 lines
arch/x86/kernel/cpu/cpu_debug.c static int cpu_init_allreg(unsigned cpu, struct dentry *dentry) · line 846
Quoted 6 lines
arch/x86/kernel/cpu/cpu_debug.c +6
-0+/* Send Report to maintainer if files are less or more then expected */ +static void send_report (int files,struct cpuinfo_x86 *cpui) +{ +pr_info ("Please report \"cpu_debug files %d for %x:%x:%x:%x\" to" +" [email protected]\n" , files, cpui->x86_vendor, + cpui->x86, cpui->x86_model, cpui->x86_mask);i'd rather see this reported to [email protected], plus please use a
WARN_ONCE()instead of apr_info(). Hitting this is a bug we want to fix.
Quoted 6 lines
Subject: [PATCH] x86:
cpu_debug.cprepare report if files are less or more then expectedThis will prepare the report to update
cpu_debugSigned-off-by Jaswinder Singh Rajput <[email protected]>---
I send better version of this patch:
[PATCH -tip] x86: cpu_debug.c prepare report if files are inappropriate or CPU is not supported
Thanks,
--
JSR