kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* What's the meaning of CONFIG_BROKEN_ON_SMP?
@ 2014-01-24  9:43 parmenides
  2014-01-24 17:27 ` Valdis.Kletnieks at vt.edu
  0 siblings, 1 reply; 3+ messages in thread
From: parmenides @ 2014-01-24  9:43 UTC (permalink / raw)
  To: kernelnewbies

Hi,

I compiled a driver, ang get the following message:

CONFIG_BROKEN_ON_SMP: should be set in the kernel configuration, but isn't.

Somebody suggested to disable the kernel's SMP feature. I did, and the
problem got solved.

Then, I googled the meaning of CONFIG_BROKEN_ON_SMP, but did not get
definitive explanation, such as
http://cateee.net/lkddb/web-lkddb/BROKEN_ON_SMP.html

I wonder what the meaning of the configuration is. How does it work? Thx!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* What's the meaning of CONFIG_BROKEN_ON_SMP?
  2014-01-24  9:43 What's the meaning of CONFIG_BROKEN_ON_SMP? parmenides
@ 2014-01-24 17:27 ` Valdis.Kletnieks at vt.edu
  2014-01-24 20:28   ` parmenides
  0 siblings, 1 reply; 3+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2014-01-24 17:27 UTC (permalink / raw)
  To: kernelnewbies

On Fri, 24 Jan 2014 17:43:35 +0800, parmenides said:

> CONFIG_BROKEN_ON_SMP: should be set in the kernel configuration, but isn't.

> I wonder what the meaning of the configuration is. How does it work? Thx!

Drivers (and all other kernel-mode code, actually) need to do proper locking,
so that if there's a race between code running on 2 different CPUs at the same
time, they don't stomp all over each other (consider the case of one CPU trying
to walk a linked list at the same time that another CPU is deleting an entry
from the list - this can leave the first CPU walking down a now corrupted list
following now-stale pointers).

There are a lot of old buggy drivers that don't do proper locking.  In a
few cases, the drivers are *technically* buggy, but the bugs just happen to
be in code that will manage to work anyhow *if there is only one CPU* (for
instance, wrapped in a IRQ-disabled section).  These drivers get BROKEN_ON_SMP
attached, because they can still potentially be useful for people compiling
on architectures that only support 1 processor core, or *need* the driver and
don't care if they only use 1 core of the 4 they have.

The proper fix is, of course, to put proper locking in the driver - but most
BROKEN_ON_SMP drivers are creeping horrorshows straight out of HP Lovecraft,
and nobody wants to invest the resources needed to fix the abandonware driver.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140124/59d546f4/attachment.bin 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* What's the meaning of CONFIG_BROKEN_ON_SMP?
  2014-01-24 17:27 ` Valdis.Kletnieks at vt.edu
@ 2014-01-24 20:28   ` parmenides
  0 siblings, 0 replies; 3+ messages in thread
From: parmenides @ 2014-01-24 20:28 UTC (permalink / raw)
  To: kernelnewbies



? 2014/1/25 1:27, Valdis.Kletnieks at vt.edu wote:
> On Fri, 24 Jan 2014 17:43:35 +0800, parmenides said:
>
>> CONFIG_BROKEN_ON_SMP: should be set in the kernel configuration, but isn't.
>
>> I wonder what the meaning of the configuration is. How does it work? Thx!
>
> Drivers (and all other kernel-mode code, actually) need to do proper locking,
> so that if there's a race between code running on 2 different CPUs at the same
> time, they don't stomp all over each other (consider the case of one CPU trying
> to walk a linked list at the same time that another CPU is deleting an entry
> from the list - this can leave the first CPU walking down a now corrupted list
> following now-stale pointers).
>
> There are a lot of old buggy drivers that don't do proper locking.  In a
> few cases, the drivers are *technically* buggy, but the bugs just happen to
> be in code that will manage to work anyhow *if there is only one CPU* (for
> instance, wrapped in a IRQ-disabled section).  These drivers get BROKEN_ON_SMP
> attached, because they can still potentially be useful for people compiling
> on architectures that only support 1 processor core, or *need* the driver and
> don't care if they only use 1 core of the 4 they have.
>
> The proper fix is, of course, to put proper locking in the driver - but most
> BROKEN_ON_SMP drivers are creeping horrorshows straight out of HP Lovecraft,
> and nobody wants to invest the resources needed to fix the abandonware driver.
>

Does that mean BROKEN_ON_SMP drivers are all tagged, and they are not 
seen when I 'make menuconfig', if CONFIG_BROKEN_ON_SMP not be set? If 
so, how these drivers are tagged?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-24 20:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-24  9:43 What's the meaning of CONFIG_BROKEN_ON_SMP? parmenides
2014-01-24 17:27 ` Valdis.Kletnieks at vt.edu
2014-01-24 20:28   ` parmenides

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).