* Expertise required on building code for SMP
@ 2006-07-13 7:42 bhuvan.kumarmital
2006-07-13 7:45 ` Arjan van de Ven
2006-07-13 8:09 ` Andreas Mohr
0 siblings, 2 replies; 4+ messages in thread
From: bhuvan.kumarmital @ 2006-07-13 7:42 UTC (permalink / raw)
To: linux-usb-devel, kernelnewbies-request, kernel-mentors,
os_drivers, linux-kernel
We've written a device driver in linux for a pcmcia card with usb and
serial functionality. I need to test this driver on a dual core/SMP
machine. We work on kernel 2.6.15.4. I have recompiled this kernel
version on my dual core machine with the CONFIG_SMP flag set during
menuconfig.
How do i ensure that my driver is making use of the SMP feature? Do
build my driver code i have a makefile in which i use the EXTRA_CFLAGS=
-D__SMP__ -DCONFIG_SMP -DLINUX.
Am i using the right flags? Do these flags really have any significance
in deciding whether the SMP capability will be exploited? Are there any
other flags i need to use while building my driver code? What does the
-jN flag mean? Should i be using it in my case.
Please guide me. I am a bit confused.
Regards
Bhuvan Mital
Project Engineer,
Wipro Technologies
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Expertise required on building code for SMP
2006-07-13 7:42 Expertise required on building code for SMP bhuvan.kumarmital
@ 2006-07-13 7:45 ` Arjan van de Ven
2006-07-13 10:56 ` Hannibal B
2006-07-13 8:09 ` Andreas Mohr
1 sibling, 1 reply; 4+ messages in thread
From: Arjan van de Ven @ 2006-07-13 7:45 UTC (permalink / raw)
To: bhuvan.kumarmital
Cc: linux-usb-devel, kernelnewbies-request, kernel-mentors,
os_drivers, linux-kernel
On Thu, 2006-07-13 at 13:12 +0530, bhuvan.kumarmital@wipro.com wrote:
> We've written a device driver in linux for a pcmcia card with usb and
> serial functionality. I need to test this driver on a dual core/SMP
> machine. We work on kernel 2.6.15.4. I have recompiled this kernel
> version on my dual core machine with the CONFIG_SMP flag set during
> menuconfig.
>
> How do i ensure that my driver is making use of the SMP feature? Do
> build my driver code i have a makefile in which i use the EXTRA_CFLAGS=
> -D__SMP__ -DCONFIG_SMP -DLINUX.
NO!
You should just use a normal KBuild makefile, and not ever add any extra
cflags....
(but you failed to provide a URL to even your Makefile but also to your
code so it's hard to give you a detailed recommendation)
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Expertise required on building code for SMP
2006-07-13 7:45 ` Arjan van de Ven
@ 2006-07-13 10:56 ` Hannibal B
0 siblings, 0 replies; 4+ messages in thread
From: Hannibal B @ 2006-07-13 10:56 UTC (permalink / raw)
To: Arjan van de Ven, bhuvan.kumarmital
Cc: linux-usb-devel, kernelnewbies-request, kernel-mentors,
os_drivers, linux-kernel
Bottom half of your driver code is the were you can take advantage of
the SMP feature.You can use either workqueue(which is a simpler
interface which will create number threads based on the cpu count ),but
if U want finer control you can use Kthread(which does'nt inherits
parents sigmask and VM) or kernel_thread, depending on your need.
-----Original Message-----
From: Arjan van de Ven [mailto:arjan@infradead.org]
Sent: Thursday, July 13, 2006 1:16 PM
To: bhuvan.kumarmital@wipro.com
Cc: linux-usb-devel@lists.sourceforge.net;
kernelnewbies-request@nl.linux.org; kernel-mentors@selenic.com;
os_drivers@osdl.org; linux-kernel@vger.kernel.org
Subject: Re: Expertise required on building code for SMP
On Thu, 2006-07-13 at 13:12 +0530, bhuvan.kumarmital@wipro.com wrote:
> We've written a device driver in linux for a pcmcia card with usb and
> serial functionality. I need to test this driver on a dual core/SMP
> machine. We work on kernel 2.6.15.4. I have recompiled this kernel
> version on my dual core machine with the CONFIG_SMP flag set during
> menuconfig.
>
> How do i ensure that my driver is making use of the SMP feature? Do
> build my driver code i have a makefile in which i use the
EXTRA_CFLAGS=
> -D__SMP__ -DCONFIG_SMP -DLINUX.
NO!
You should just use a normal KBuild makefile, and not ever add any extra
cflags....
(but you failed to provide a URL to even your Makefile but also to your
code so it's hard to give you a detailed recommendation)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Expertise required on building code for SMP
2006-07-13 7:42 Expertise required on building code for SMP bhuvan.kumarmital
2006-07-13 7:45 ` Arjan van de Ven
@ 2006-07-13 8:09 ` Andreas Mohr
1 sibling, 0 replies; 4+ messages in thread
From: Andreas Mohr @ 2006-07-13 8:09 UTC (permalink / raw)
To: bhuvan.kumarmital
Cc: linux-usb-devel, kernelnewbies-request, kernel-mentors,
os_drivers, linux-kernel
Hi,
On Thu, Jul 13, 2006 at 01:12:14PM +0530, bhuvan.kumarmital@wipro.com wrote:
> We've written a device driver in linux for a pcmcia card with usb and
> serial functionality. I need to test this driver on a dual core/SMP
> machine. We work on kernel 2.6.15.4. I have recompiled this kernel
> version on my dual core machine with the CONFIG_SMP flag set during
> menuconfig.
>
> How do i ensure that my driver is making use of the SMP feature? Do
> build my driver code i have a makefile in which i use the EXTRA_CFLAGS=
> -D__SMP__ -DCONFIG_SMP -DLINUX.
> Am i using the right flags? Do these flags really have any significance
> in deciding whether the SMP capability will be exploited? Are there any
> other flags i need to use while building my driver code? What does the
> -jN flag mean? Should i be using it in my case.
>
> Please guide me. I am a bit confused.
Are you talking about "make -jN"?
If so, that is purely for deciding how many threads to use to *compile*
the code, not run-time execution. Not relevant.
As Arjan said, you should use the normal kbuild infrastructure,
either for external module builds by using something like:
make -C /lib/modules/`uname -r`/build M=`pwd`
make -C /lib/modules/`uname -r`/build M=`pwd` modules_install
or for in-kernel-tree builds.
See linux/Documentation/kbuild/
Simply provide a driver Makefile that contains all tags required for kbuild
infrastructure, that should automatically take care of any and all
compiler flags you need to use, whether you're using an
SMP kernel configuration or not.
For sample users of the external kbuild driver build, see e.g. the
acx WLAN driver (both in-kernel and external build possible there,
see README).
About SMP in general: AFAIK there is nothing to configure here,
the only thing you really have to get right is proper locking inside your
driver to prevent concurrent resource access.
Andreas Mohr
P.S.: oh, and getting this driver submitted for kernel inclusion
would be nice :)
(both for you and us, since it'd reduce amount of maintenance work
due to people improving it automatically)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-07-13 10:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13 7:42 Expertise required on building code for SMP bhuvan.kumarmital
2006-07-13 7:45 ` Arjan van de Ven
2006-07-13 10:56 ` Hannibal B
2006-07-13 8:09 ` Andreas Mohr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®