From nobody@FreeBSD.org  Thu Jan 17 03:33:44 2002
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id D653737B416
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 17 Jan 2002 03:33:43 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id g0HBXhM11656;
	Thu, 17 Jan 2002 03:33:43 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200201171133.g0HBXhM11656@freefall.freebsd.org>
Date: Thu, 17 Jan 2002 03:33:43 -0800 (PST)
From: Karthik <kar_alerts@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: SMP support not compiled to smbfs kernel module when enabled in kernel config
X-Send-Pr-Version: www-1.0

>Number:         33985
>Category:       misc
>Synopsis:       SMP support not compiled to smbfs kernel module when enabled in kernel config
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    bp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 17 03:40:01 PST 2002
>Closed-Date:    Sat Apr 13 07:59:40 PDT 2002
>Last-Modified:  Sat Apr 13 07:59:40 PDT 2002
>Originator:     Karthik
>Release:        4.5-RC
>Organization:
>Environment:
FreeBSD testpc5 4.5-RC FreeBSD 4.5-RC #0: Thu Jan 17 02:21:08 GMT 2002     root@:/usr/src/sys/compile/SVR  i386
>Description:
1.	Added the kernel options
	"options	SMP"
	"options	APIC_IO" 
	to kernel config file.

2.	compiled and installed the kernel.

3.	ran "make buildworld" and "make installworld"

4.	ran "mergemaster" which created /dev/nsmb0.

5.	ran "mount_smbfs -I <ipaddr> //administrator@s5/c /mnt/s5"

6.	Got message "mount_smbfs: can't get handle to requester (no /dev/nsmb* device)"

7.	The kernel reports (from the dmesg)

****---start
Jan 17 19:27:54 testpc5 /kernel: error: module compiled without SMP support
Jan 17 19:27:54 testpc5 /kernel: error: module compiled without SMP support
Jan 17 19:27:54 testpc5 /kernel: netsmb_dev: unloaded
Jan 17 19:27:54 testpc5 /kernel: netsmb_dev: unloaded
Jan 17 19:27:54 testpc5 /kernel: module_register_init: MOD_LOAD (dev_netsmb, c5c2ca40, 0) error 1
Jan 17 19:27:54 testpc5 /kernel: module_register_init: MOD_LOAD (dev_netsmb, c5c2ca40, 0) error 1
Jan 17 19:27:54 testpc5 /kernel: error: module compiled without SMP support
Jan 17 19:27:54 testpc5 /kernel: error: module compiled without SMP support

****---end

8.	Got into the console, then ran "kldunload smbfs" and "kldload smbfs"

9.	Got the same message as in point 7.

10.	But everything is OK with SMP-disabled 

11.	For information, nothing in /etc/make.conf

>How-To-Repeat:
use "kldload smbfs" or "mount_smbfs ....." on a SMP machine with SMP-enabled kernel.
>Fix:
Probably smbfs module not compiled with SMP support even when SMP was mentioned in the kernel config file.
>Release-Note:
>Audit-Trail:

From: Ceri <setantae@submonkey.net>
To: Karthik <kar_alerts@mglorysb.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when enabled in kernel config
Date: Thu, 17 Jan 2002 11:47:34 +0000

 On Thu, Jan 17, 2002 at 03:33:43AM -0800, Karthik wrote:
 
 > 1.	Added the kernel options
 > 	"options	SMP"
 > 	"options	APIC_IO" 
 > 	to kernel config file.
 > 
 > 2.	compiled and installed the kernel.
 
 I think there should be a :
 
   2.5.  rebooted
 
 > 3.	ran "make buildworld" and "make installworld"
 
 Ceri

From: Karthik K <kar_alerts@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar_alerts@mglorysb.com
Cc:  
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when enabled in kernel config
Date: Thu, 17 Jan 2002 21:29:32 +0800

 Yes, the machine was rebooted after 2 (compiled and installed the kernel)
 and also after 4 (mergemaster).
State-Changed-From-To: open->feedback 
State-Changed-By: sheldonh 
State-Changed-When: Thu Jan 17 07:31:02 PST 2002 
State-Changed-Why:  
Feedback requested -- out-of-sync modules suspected. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=33985 

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Karthik <kar_alerts@mglorysb.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when enabled in kernel config 
Date: Thu, 17 Jan 2002 17:33:25 +0200

 On Thu, 17 Jan 2002 03:33:43 PST, Karthik wrote:
 
 > 1.	Added the kernel options
 > 	"options	SMP"
 > 	"options	APIC_IO" 
 > 	to kernel config file.
 > 
 > 2.	compiled and installed the kernel.
 
 It sounds to me like you installed the new kernel but didn't build and
 install new modules at the same time.  Did you perform your builds
 with NO_MODULES or MODULES_WITH_WORLD defined in make.conf or the
 environment?
 
 As the error message you reported suggests, if you're going to build an
 SMP kernel, some modules (if not all) have to be rebuilt as well.
 
 Ciao,
 Sheldon.

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Karthik <kar_alerts@mglorysb.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when enabled in kernel config 
Date: Thu, 17 Jan 2002 17:36:04 +0200

 On Thu, 17 Jan 2002 17:33:25 +0200, Sheldon Hearn wrote:
 
 > It sounds to me like you installed the new kernel but didn't build and
 > install new modules at the same time.  Did you perform your builds
 > with NO_MODULES or MODULES_WITH_WORLD defined in make.conf or the
 > environment?
 
 I should have mentioned that I can't reproduce this problem on my 4.5-RC
 SMP box.  So you should know that it _is_ possible to get this right.
 
 Sometimes people start asking you questions and leave you with the
 impression that they don't know for sure that what you're trying to do
 can actually be done. :-)
 
 Ciao,
 Sheldon.

From: Karthik K <kar_alerts@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar_alerts@mglorysb.com
Cc:  
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when enabled in kernel config
Date: Fri, 18 Jan 2002 01:10:20 +0800

 Even I doubt that the modules and kernel were out of sync SMP-wise. Let me 
 provide information on how I build kernel.
 
 1.	cd /usr/src/sys/i386/conf
 2.	config SVR
 3.	cd ../../compile/SVR
 4.	make depend 
 5.	make
 6.	make install
 
 When I did "make install", I could see "install ..." messages installing the 
 .ko files to /modules directory. Which means that the new modules are getting 
 installed in /modules directory. The file date/time of the smbfs.ko is latest 
 time.
 
 FYI, the commands above were used in my servers from FBSD 4.2 until now. 
 After installing the kernel I used to do a "make clean; make buildworld; make 
 installworld" from /usr/src directory.
 
 In this SMP setup, I have freshly installed Freebsd-4.4 release (from CD) , 
 cvsupped to stable today, then did a SMP-enabled build of kernel. I usually 
 update the userland along with the kernel as I did today (after enabling SMP 
 in kernel config).
 
 May be I will try removing the /usr/src folder then re-cvsup again and will 
 try again.

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Karthik K <kar_alerts@mglorysb.com>
Cc: bug-followup@freebsd.org
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when enabled in kernel config 
Date: Thu, 17 Jan 2002 19:43:11 +0200

 On Thu, 17 Jan 2002 09:20:03 PST, Karthik K wrote:
 
 >  Even I doubt that the modules and kernel were out of sync SMP-wise. Let me 
 >  provide information on how I build kernel.
 
 Then I'm not sure what the problem is, since I have a 4.5-RC SMP system
 from yesterday that doesn't exhibit this behaviour.
 
 What does this give you?
 
 	sysctl hw.ncpu
 
 Do you also get '2'?
 
 Ciao,
 Sheldon.

From: Karthik K <kar_alerts@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar_alerts@mglorysb.com
Cc:  
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when enabled in kernel config
Date: Fri, 18 Jan 2002 03:08:45 +0800

 sysctl hw.ncpu gives
 "hw.ncpu: 2"
 
 That means the kernel has recognized the two CPUs and I could see a column 
 "C" in "top" which has values 0/1.
 
 Thanks
 Karthik

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Karthik K <kar_alerts@mglorysb.com>
Cc: bug-followup@freebsd.org
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when enabled in kernel config 
Date: Thu, 17 Jan 2002 21:51:44 +0200

 On Thu, 17 Jan 2002 11:20:01 PST, Karthik K wrote:
 
 >  sysctl hw.ncpu gives
 >  "hw.ncpu: 2"
 
 Then I'm not sure what more we can do for you in the absence of further
 information. :-(
 
 Ciao,
 Sheldon.

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Karthik K <kar_alerts@mglorysb.com>
Cc: bug-followup@freebsd.org
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when enabled in kernel config 
Date: Fri, 18 Jan 2002 16:49:59 +0200

 On Thu, 17 Jan 2002 21:51:44 +0200, Sheldon Hearn wrote:
 
 > Then I'm not sure what more we can do for you in the absence of further
 > information. :-(
 
 I've been wrong all the time!
 
 I'm so sorry for wasting your time.  I've just discovered that the
 messages you complained about went to an unexpected console device!
 
 I'll assign your PR to the maintainer ASAP.
 
 Ciao,
 Sheldon.
State-Changed-From-To: feedback->open 
State-Changed-By: sheldonh 
State-Changed-When: Fri Jan 18 07:09:47 PST 2002 
State-Changed-Why:  
Boris, could you take a look at this one.  Even if it's cosmetic, 
it's probably not a good idea to be blurting this severe-looking 
error message on the stable branch. 


Responsible-Changed-From-To: freebsd-bugs->bp 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Fri Jan 18 07:09:47 PST 2002 
Responsible-Changed-Why:  
Over to the smbfs maintainer. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=33985 

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Boris Popov <bp@freebsd.org>
Cc: kar_alerts@mglorysb.com, bug-followup@freebsd.org
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when enabled in kernel config 
Date: Mon, 28 Jan 2002 13:11:29 +0200

 On Sun, 27 Jan 2002 09:02:21 +0600, Boris Popov wrote:
 
 > 	This is a known problem with SMP and modules in the RELENG_4 -
 > there is no support for building an SMP enabled KLDs. It is better not to
 > use modules at all on SMP systems by compiling everything in the kernel.
 > BTW, smbfs port had SMP=YES option in order to support SMP kernels while
 > compiled as module...
 
 Hi Boris,
 
 Could you refer us to more information about the general problem in
 RELENG_4, perhaps in the mailing list archives, the PR database or some
 other source?
 
 Ciao,
 Sheldon.

From: Boris Popov <bp@freebsd.org>
To: Sheldon Hearn <sheldonh@starjuice.net>
Cc: kar_alerts@mglorysb.com, bug-followup@freebsd.org
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when
 enabled in kernel config 
Date: Tue, 29 Jan 2002 12:30:03 +0600 (ALMT)

 On Mon, 28 Jan 2002, Sheldon Hearn wrote:
 
 > Could you refer us to more information about the general problem in
 > RELENG_4, perhaps in the mailing list archives, the PR database or some
 > other source?
 
 	I'm can't dig archives right now, but problem lies in the build
 process: for an SMP kernel we do additional #define's like SMP and
 APIC_IO. Since modules do not include kernel configuration files like
 opt_global.h they aren't SMP aware because compile path is different for
 SMP and non-SMP case. For simple example see sys/lock.h file around
 
 	"#if MAXCPU == 1 /* no multiprocessor locking is necessary */"
 
 line.
 
 -- 
 Boris Popov
 http://rbp.euro.ru
 

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Boris Popov <bp@freebsd.org>
Cc: kar_alerts@mglorysb.com, bug-followup@freebsd.org
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module when enabled in kernel config 
Date: Tue, 29 Jan 2002 12:18:25 +0200

 On Tue, 29 Jan 2002 12:30:03 +0600, Boris Popov wrote:
 
 > 	I'm can't dig archives right now, but problem lies in the build
 > process: for an SMP kernel we do additional #define's like SMP and
 > APIC_IO.
 
 Thanks, Boris.  I've forwarded your explanation to the -hackers mailing
 list and requested more detail.
 
 Hopefully, someone will come back with something like "Oh, that was ages
 ago, now all you do is X Y Z and it works."  :-)
 
 Ciao,
 Sheldon.

From: Sheldon Hearn <sheldonh@starjuice.net>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: misc/33985: SMP support not compiled to smbfs kernel module
Date: Thu, 14 Feb 2002 19:45:17 +0200

 Here's the message I sent to the hackers list, to which I got no
 response.  Looks like a bit of a dead end at the moment. :-(
 
 Ciao,
 Sheldon.
 
 ------- Forwarded Message
 
 From: Sheldon Hearn <sheldonh@starjuice.net>
 To: hackers@FreeBSD.org
 Subject: Kernel modules, SMP and -STABLE
 Date: Tue, 29 Jan 2002 12:17:26 +0200
 Message-ID: <21904.1012299446@axl.seasidesoftware.co.za>
 Sender: sheldonh@axl.seasidesoftware.co.za
 
 
 Hi folks,
 
 Boris Popov, the maintainer of smbfs and nwfs in FreeBSD, has mentioned
 in discussions surrounding PR misc/33985, that there's a problem in
 - -STABLE affecting the building of modules on SMP systems.
 
 If anyone could shed some light on this, I'd love to add your comments
 to the audit trail of the PR.
 
 Thanks,
 Sheldon.
 
 - ------- Forwarded Message
 
 Date: Tue, 29 Jan 2002 12:30:03 +0600 (ALMT)
 From: Boris Popov <bp@freebsd.org>
 To: Sheldon Hearn <sheldonh@starjuice.net>
 Cc: kar_alerts@mglorysb.com, bug-followup@freebsd.org
 Subject: Re: misc/33985: SMP support not compiled to smbfs kernel [...]
 In-Reply-To: <79258.1012216289@axl.seasidesoftware.co.za>
 Message-ID: <Pine.BSF.4.21.0201291211060.67199-100000@lion.butya.kz>
 MIME-Version: 1.0
 Content-Type: TEXT/PLAIN; charset=US-ASCII
 
 On Mon, 28 Jan 2002, Sheldon Hearn wrote:
 
 > Could you refer us to more information about the general problem in
 > RELENG_4, perhaps in the mailing list archives, the PR database or some
 > other source?
 
 	I'm can't dig archives right now, but problem lies in the build
 process: for an SMP kernel we do additional #define's like SMP and
 APIC_IO. Since modules do not include kernel configuration files like
 opt_global.h they aren't SMP aware because compile path is different for
 SMP and non-SMP case. For simple example see sys/lock.h file around
 
 	"#if MAXCPU == 1 /* no multiprocessor locking is necessary */"
 
 line.
 
 - - -- 
 Boris Popov
 http://rbp.euro.ru
 
 
 - ------- End of Forwarded Message
 
 
 ------- End of Forwarded Message
 
State-Changed-From-To: open->closed 
State-Changed-By: bp 
State-Changed-When: Sat Apr 13 07:56:01 PDT 2002 
State-Changed-Why:  
The solution is to compile everything into kernel because -stable (and 
-current in some cases) are not modules friendly when SMP option enabled. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=33985 
>Unformatted:
