mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 2.6.10-rc2-mm1 - detect-atomic-counter-underflows.patch
@ 2004-11-17 18:03 Valdis.Kletnieks
  2004-11-17 20:46 ` Andrew Morton
  2004-11-18  6:30 ` James Morris
  0 siblings, 2 replies; 3+ messages in thread
From: Valdis.Kletnieks @ 2004-11-17 18:03 UTC (permalink / raw)
  To: Ingo Molnar, Andrew Morton; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

Now, I *may* have simply shot myself in the foot, but when I tried booting
2.6.10-rc2-mm1, I got spewed *thousands* of messages triggered by this:

diff -puN include/asm-i386/atomic.h~detect-atomic-counter-underflows include/asm-i386/atomic.h
--- 25/include/asm-i386/atomic.h~detect-atomic-counter-underflows       Wed Nov  3 15:27:37 2004
+++ 25-akpm/include/asm-i386/atomic.h   Wed Nov  3 15:27:37 2004
@@ -132,6 +132,10 @@ static __inline__ int atomic_dec_and_tes
 {
        unsigned char c;
 
+       if (!atomic_read(v)) {
+               printk("BUG: atomic counter underflow at:\n");
+               dump_stack();
+       }
        __asm__ __volatile__(
                LOCK "decl %0; sete %1"
                :"=m" (v->counter), "=qm" (c)

Somehow, warning a *counter* is non-zero doesn't seem right (calling it an
underflow 4 times if the value goes 4, 3, 2, 1 and then NOT complain when it
hits zero?) , and I'm not flooded if it says:

	if (atomic_read(v) < 0) {

So is this code wrong, or did I introduce an now-detected underflow with some
self-inflicted patch that this is picking up?


[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

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

* Re: 2.6.10-rc2-mm1 - detect-atomic-counter-underflows.patch
  2004-11-17 18:03 2.6.10-rc2-mm1 - detect-atomic-counter-underflows.patch Valdis.Kletnieks
@ 2004-11-17 20:46 ` Andrew Morton
  2004-11-18  6:30 ` James Morris
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2004-11-17 20:46 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: mingo, linux-kernel

Valdis.Kletnieks@vt.edu wrote:
>
> Now, I *may* have simply shot myself in the foot, but when I tried booting
> 2.6.10-rc2-mm1, I got spewed *thousands* of messages triggered by this:
> 
> diff -puN include/asm-i386/atomic.h~detect-atomic-counter-underflows include/asm-i386/atomic.h
> --- 25/include/asm-i386/atomic.h~detect-atomic-counter-underflows       Wed Nov  3 15:27:37 2004
> +++ 25-akpm/include/asm-i386/atomic.h   Wed Nov  3 15:27:37 2004
> @@ -132,6 +132,10 @@ static __inline__ int atomic_dec_and_tes
>  {
>         unsigned char c;
>  
> +       if (!atomic_read(v)) {
> +               printk("BUG: atomic counter underflow at:\n");
> +               dump_stack();
> +       }
>         __asm__ __volatile__(
>                 LOCK "decl %0; sete %1"
>                 :"=m" (v->counter), "=qm" (c)
> 
> Somehow, warning a *counter* is non-zero doesn't seem right (calling it an
> underflow 4 times if the value goes 4, 3, 2, 1 and then NOT complain when it
> hits zero?) , and I'm not flooded if it says:
> 
> 	if (atomic_read(v) < 0) {

No, the code is OK.  It's telling us that we're about to take the counter
negative, and that's a good predictor of a bug somewhere.

> So is this code wrong, or did I introduce an now-detected underflow with some
> self-inflicted patch that this is picking up?

Dunno.  What was in the traces?

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

* Re: 2.6.10-rc2-mm1 - detect-atomic-counter-underflows.patch
  2004-11-17 18:03 2.6.10-rc2-mm1 - detect-atomic-counter-underflows.patch Valdis.Kletnieks
  2004-11-17 20:46 ` Andrew Morton
@ 2004-11-18  6:30 ` James Morris
  1 sibling, 0 replies; 3+ messages in thread
From: James Morris @ 2004-11-18  6:30 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Ingo Molnar, Andrew Morton, linux-kernel

On Wed, 17 Nov 2004 Valdis.Kletnieks@vt.edu wrote:

> Now, I *may* have simply shot myself in the foot, but when I tried booting
> 2.6.10-rc2-mm1, I got spewed *thousands* of messages triggered by this:

Are you running SELinux?

Try this: 
http://marc.theaimsgroup.com/?l=linux-kernel&m=110062417701884&w=2



- James
-- 
James Morris
<jmorris@redhat.com>



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

end of thread, other threads:[~2004-11-18  6:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-17 18:03 2.6.10-rc2-mm1 - detect-atomic-counter-underflows.patch Valdis.Kletnieks
2004-11-17 20:46 ` Andrew Morton
2004-11-18  6:30 ` James Morris

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®