From: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
To: George Spelvin <linux@sciencehorizons.net>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Cc: acme@kernel.org, adrian.hunter@intel.com, bp@suse.de,
dsahern@gmail.com, jolsa@redhat.com, linux@horizon.com,
linux@rasmusvillemoes.dk, mpe@ellerman.id.au,
namhyung@kernel.org, wangnan0@huawei.com, yury.norov@gmail.com
Subject: Re: [PATCH] tools/perf: fix the word selected in find_*_bit
Date: Thu, 16 Jun 2016 12:51:44 +0530 [thread overview]
Message-ID: <479a4811-9aa2-57fd-a1a5-900bacdd69fc@linux.vnet.ibm.com> (raw)
In-Reply-To: <20160615124409.6985.qmail@ns.sciencehorizons.net>
On Wednesday 15 June 2016 06:14 PM, George Spelvin wrote:
> Madhavan Srinivasan wrote:
>> +#if (__BYTE_ORDER == __BIG_ENDIAN) && (BITS_PER_LONG != 64)
>> + tmp = addr[(((nbits - 1)/BITS_PER_LONG) - (start / BITS_PER_LONG))]
>> + ^ invert;
>> +#else
>> tmp = addr[start / BITS_PER_LONG] ^ invert;
>> +#endif
> Than you for diagnosing this problem, but I don't think the fix
> is correct.
>
> 1) It's not clear that all users of _find_next_bit and for_each_set_bit()
> want this change.
> 2) Is your code even correct? I'd think you'd want addr[x ^ 1]. Are you
> sure you shpuld be reversing the whole array, and not just the halves of
> each 64-bit word?
> 3) You've now broken the case of 32-bit big-endian kernel.
Yes. But looks like we havent hit this case yet. Will post a fix.
Maddy
>
> I think the proper solution is uglier than this. :-(
>
next prev parent reply other threads:[~2016-06-16 7:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 11:42 [PATCH] tools/perf: fix the word selected in find_*_bit Madhavan Srinivasan
2016-06-15 12:44 ` George Spelvin
2016-06-16 7:21 ` Madhavan Srinivasan [this message]
2016-06-15 19:51 ` Yury Norov
2016-06-15 21:11 ` Yury Norov
2016-06-15 21:29 ` Arnaldo Carvalho de Melo
2016-06-16 1:27 ` [PATCH] tools include: Fix wrong macro definitions for cpu_to_le* for big endian He Kuang
2016-06-16 1:32 ` He Kuang
2016-06-16 1:32 ` [PATCH 1/2] tools include: Sync byteorder/generic.h He Kuang
2016-06-16 6:39 ` Jiri Olsa
2016-06-16 1:32 ` [PATCH 2/2] tools include: Fix wrong macro definitions for cpu_to_le* for big endian He Kuang
2016-06-16 6:21 ` kbuild test robot
2016-06-16 6:39 ` Jiri Olsa
2016-06-16 1:35 ` [PATCH] tools/perf: fix the word selected in find_*_bit Hekuang
2016-06-16 13:11 ` Madhavan Srinivasan
2016-06-16 7:15 ` Madhavan Srinivasan
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=479a4811-9aa2-57fd-a1a5-900bacdd69fc@linux.vnet.ibm.com \
--to=maddy@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=bp@suse.de \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@horizon.com \
--cc=linux@rasmusvillemoes.dk \
--cc=linux@sciencehorizons.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=namhyung@kernel.org \
--cc=wangnan0@huawei.com \
--cc=yury.norov@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).