[Devel] [PATCH rh7 02/11] Port diff-ve-cpuinfo-obtain-cpuflags-for-the-current-cpu-too

Vladimir Davydov vdavydov at virtuozzo.com
Fri Oct 16 09:22:46 PDT 2015


Author: Vladimir Davydov
Email: vdavydov at parallels.com
Subject: cpuinfo: obtain cpuflags for the current cpu too
Date: Thu, 27 Sep 2012 17:05:18 +0400

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 1d5833a27661..9f4658888ec9 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)
-- 
2.1.4




More information about the Devel mailing list