[Devel] [PATCH RHEL7 COMMIT] cpuinfo: obtain cpuflags for the current cpu too

Konstantin Khorenko khorenko at virtuozzo.com
Tue Oct 20 09:00:17 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.9.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.8.9
------>
commit 2352708d6a788ce9e87abe9adc6f85e565fc63b5
Author: Vladimir Davydov <vdavydov at virtuozzo.com>
Date:   Tue Oct 20 20:00:17 2015 +0400

    cpuinfo: obtain cpuflags for the current cpu too
    
    Port diff-ve-cpuinfo-obtain-cpuflags-for-the-current-cpu-too
    
    Otherwise, we can get empty flags field.
    
    http://bugzilla.openvz.org/show_bug.cgi?id=2373
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
    
    =============================================================================
    
    Changes in port:
     - use on_each_cpu instead of smp_call_funtion
    
    https://jira.sw.ru/browse/PSBM-33638
    
    Signed-off-by: Vladimir Davydov <vdavydov at virtuozzo.com>
---
 arch/x86/kernel/cpu/proc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 1d5833a..9f46588 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -157,20 +157,24 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 	return 0;
 }
 
-static void *c_start(struct seq_file *m, loff_t *pos)
+static void *__c_start(struct seq_file *m, loff_t *pos)
 {
-	smp_call_function(init_cpu_flags, NULL, 1);
-
 	*pos = cpumask_next(*pos - 1, cpu_online_mask);
 	if (__cpus_weight(cpu_online_mask, *pos) < num_online_vcpus())
 		return &cpu_data(*pos);
 	return NULL;
 }
 
+static void *c_start(struct seq_file *m, loff_t *pos)
+{
+	on_each_cpu(init_cpu_flags, NULL, 1);
+	return __c_start(m, pos);
+}
+
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 {
 	(*pos)++;
-	return c_start(m, pos);
+	return __c_start(m, pos);
 }
 
 static void c_stop(struct seq_file *m, void *v)



More information about the Devel mailing list