From: Zan Lynx <zlynx@acm.org>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: Andi Kleen <ak@suse.de>, LKML <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: Wrong number of core_siblings in sysfs for Athlon64 X2
Date: Thu, 16 Feb 2006 19:10:56 -0700 [thread overview]
Message-ID: <1140142257.29021.31.camel@localhost> (raw)
In-Reply-To: <9a8748490602161408i736a7ab3vef09f3e1c95916fe@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1737 bytes --]
On Thu, 2006-02-16 at 23:08 +0100, Jesper Juhl wrote:
> On 2/16/06, Andi Kleen <ak@suse.de> wrote:
> > On Thursday 16 February 2006 22:46, Jesper Juhl wrote:
> >
> > > Obviously something is wrong, but I just can't seem to spot it. Any clues?
> >
> > It's a bitmap. 3 = 0b11
> >
>
> When I was reading the smpboot code my brain *was* actually in the
> "this is a bitmap" mode, but when I then looked at the sysfs code it
> for some reason switched to "this wants to just print the number of
> siblings as an integer" mode - which was obviously where I went wrong.
> If it's being treated as a bitmap when it's created why would that
> change when it gets printed - D'OH!
>
> Thank you very much for that hit with the clue stick Andi.
While looking around for other examples, I ran across
cpufreq/affected_cpus. Shouldn't cpufreq.c:show_affected_cpus() be
using cpumask_scnprintf instead of "%u"?
But anyway...
It seems to me that this could be confusing for a lot of people who are
casually browsing through sysfs. Why not name core_siblings something
like core_sibling_bitmap? Using _units isn't unprecedented, we have
read_ahead_kb. I think it's nice not having to look it up to know
read_ahead is in kb and not bytes or sectors. Likewise, it'd be nice to
know it's a bitmap and not a count just by looking at the name.
More alternatively, bitmaps seem ugly. Why not one of these options
instead?
- a space separated list of bitmap offsets: "0 1" instead of 3
- a directory of symlinks to devices/system/cpu/cpu[N]:
devices/system/cpu/cpu1/topology/core_siblings/0 -> ../../../cpu0
devices/system/cpu/cpu1/topology/core_siblings/1 -> ../../../cpu1
--
Zan Lynx <zlynx@acm.org>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-02-17 2:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-16 21:46 Wrong number of core_siblings in sysfs for Athlon64 X2 Jesper Juhl
2006-02-16 21:59 ` Andi Kleen
2006-02-16 22:08 ` Jesper Juhl
2006-02-17 2:10 ` Zan Lynx [this message]
2006-02-17 2:18 ` Andi Kleen
2006-02-17 2:58 ` Zan Lynx
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=1140142257.29021.31.camel@localhost \
--to=zlynx@acm.org \
--cc=ak@suse.de \
--cc=gregkh@suse.de \
--cc=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.kernel.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