From: David Miller <davem@davemloft.net>
To: tglx@linutronix.de
Cc: torvalds@linux-foundation.org, harvey.harrison@gmail.com,
mingo@elte.hu, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bitops: remove "optimizations"
Date: Tue, 29 Apr 2008 16:30:07 -0700 (PDT) [thread overview]
Message-ID: <20080429.163007.59388708.davem@davemloft.net> (raw)
In-Reply-To: <20080429.155824.183713623.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Tue, 29 Apr 2008 15:58:24 -0700 (PDT)
> Given that others who tested could not find one case where the
> optimization cases actually applied, and it's breaking things for me,
> my theory is that it's triggering for some obscure case on sparc64 and
> thus showing a bug in these optimizations since in practice I'm the
> only person to actually test this new code.
Ok, I think I see the problem.
The core issue is that (X << N) is undefined when N is >= the
word size, but that's exactly what the find_next_bit() inline
optimizations do.
This optimization code will trigger on 64-bit if NR_CPUS is set
to 64, and you actually have 64 cpus. It should also occur
on 32-bit if NR_CPUS=32 and you have 32 cpus.
The bogus expansion occurs in lib/cpumask.c:__next_cpu()
After processing cpu 63, we'll use offset==64 and thus try
to make the undefined shift I described above, causing the
caller's cpumask iteration loop to run forever.
This code was really not tested very well at all.
next prev parent reply other threads:[~2008-04-29 23:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-27 20:19 [PATCH] bitops: simplify generic bit finding functions Harvey Harrison
2008-04-27 20:26 ` Linus Torvalds
2008-04-27 20:29 ` Harvey Harrison
2008-04-27 20:36 ` Al Viro
2008-04-27 20:38 ` Harvey Harrison
2008-04-27 20:38 ` Linus Torvalds
2008-04-27 21:02 ` Al Viro
2008-04-28 14:04 ` Thomas Gleixner
2008-04-28 15:10 ` Alexander van Heukelum
2008-04-28 15:58 ` Thomas Gleixner
2008-04-28 16:25 ` Linus Torvalds
2008-04-28 16:47 ` Thomas Gleixner
2008-04-28 16:54 ` Linus Torvalds
2008-04-28 19:26 ` Thomas Gleixner
2008-04-28 19:37 ` Linus Torvalds
2008-04-28 21:55 ` Ingo Molnar
2008-04-29 10:01 ` [PATCH] bitops: remove "optimizations" Thomas Gleixner
2008-04-29 10:03 ` David Miller
2008-04-29 12:34 ` David Miller
2008-04-29 14:20 ` Ingo Molnar
2008-04-29 22:31 ` David Miller
2008-04-29 16:51 ` Thomas Gleixner
2008-04-29 22:58 ` David Miller
2008-04-29 23:30 ` David Miller [this message]
2008-04-28 19:57 ` [PATCH] bitops: simplify generic bit finding functions Andi Kleen
2008-04-28 14:58 ` Alexander van Heukelum
2008-04-28 14:32 ` Alexander van Heukelum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080429.163007.59388708.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@linux-foundation.org \
--cc=harvey.harrison@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®