[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f23a1c71-d1b1-b279-c922-ce0f48cb4448@gmail.com>
Date: Thu, 4 Jul 2019 16:00:00 +0300
From: Boaz Harrosh <openosd@...il.com>
To: Matthew Wilcox <willy@...radead.org>,
Dan Williams <dan.j.williams@...el.com>
Cc: linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Jan Kara <jack@...e.cz>, stable <stable@...r.kernel.org>,
Robert Barror <robert.barror@...el.com>,
Seema Pandit <seema.pandit@...el.com>,
linux-nvdimm <linux-nvdimm@...ts.01.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] dax: Fix missed PMD wakeups
On 04/07/2019 06:27, Matthew Wilcox wrote:
> On Wed, Jul 03, 2019 at 02:28:41PM -0700, Dan Williams wrote:
<>
>>> +#ifdef CONFIG_XARRAY_MULTI
>>> + unsigned int sibs = xas->xa_sibs;
>>> +
>>> + while (sibs) {
>>> + order++;
>>> + sibs /= 2;
>>> + }
>>
>> Use ilog2() here?
>
> Thought about it. sibs is never going to be more than 31, so I don't
> know that it's worth eliminating 5 add/shift pairs in favour of whatever
> the ilog2 instruction is on a given CPU. In practice, on x86, sibs is
> going to be either 0 (PTEs) or 7 (PMDs). We could also avoid even having
> this function by passing PMD_ORDER or PTE_ORDER into get_unlocked_entry().
>
> It's probably never going to be noticable in this scenario because it's
> the very last thing checked before we put ourselves on a waitqueue and
> go to sleep.
>
Matthew you must be kidding an ilog2 in binary is zero clocks
(Return the highest bit or something like that)
In any way. It took me 5 minutes to understand what you are doing
here. And I only fully got it when Dan gave his comment. So please for
the sake of stupid guys like me could you please make it ilog2() so
to make it easier to understand?
(And please don't do the compiler's job. If in some arch the loop
is the fastest let the compiler decide?)
Thanks
Boaz
Powered by blists - more mailing lists