LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-06-2004, 06:17 PM   #1
Dagda99
LQ Newbie
 
Registered: Jul 2004
Posts: 19

Rep: Reputation: 0
Hardware, /proc/cpuinfo disagree with smp_num_cpus


Strange problem: on a dual P3 Xeon system, if I run cat /proc/cpuinfo, it shows 2 processors, processor: 0 and processor: 1. But if in a kernel module I write, say,
Code:
#include <asm/smp.h> //or #include <linux/smp.h>, both have same result

printk(KERN_ALERT "# Cpu's %i , %i", smp_num_cpus, NR_CPUS);
It prints:
Code:
# Cpu's 1 , 1
which means for some reason it only sees one CPU?

The reason that this is a problem is that in a module I'm writing, calling smp_call_function checks smp_num_cpus to make sure it isn't 1. Since it is, for some reason, it returns immediately.

Any ideas as to why this is so and how I can fix it? Googling hasn't come up with anything. Links, thoughts, anything would be helpful.
-Dagda

Dual P3 Xeon
Slackware 10.0
Linux 2.4.26
SMP enabled
Gcc 3.3.4
 
Old 08-09-2004, 01:18 PM   #2
Dagda99
LQ Newbie
 
Registered: Jul 2004
Posts: 19

Original Poster
Rep: Reputation: 0
What I've found:
for some reason, even though I've enabled SMP in menuconfig when compiling my kernel, CONFIG_SMP is not defined! Its treating my system as uniprocessor in programs, though cat /proc/cpuinfo shows 2 cpu's.
I've tried to manually define CONFIG_SMP as 1, though I get many errors at compile time for things not being defined; but even so, I shouldn't have to manually define it. And is my kernel configured to support SMP in programs?
Any ideas?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/proc/cpuinfo flag lm Henry_1 Linux - General 8 05-23-2019 06:15 PM
/proc/cpuinfo says processor is 700mhz? J--Lew Linux - Newbie 3 10-19-2005 08:18 AM
/proc/cpuinfo oops! feta Linux - Hardware 2 11-08-2004 10:16 PM
/proc/cpuinfo embsupafly Linux - General 3 12-29-2003 06:54 AM
Hypertherad Kernel 2.5.75 and your /proc/cpuinfo Kayaker Slackware 2 09-16-2003 08:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration