Re: [PATCH v3 06/10] fs/namei.c: Improve dcache hash function

2016-06-02 Thread George Spelvin
Linus Torvalds wrote: > Don't worry about pa-risc. There may be a handful of users, where even > "users" is more of a "boot up occasionally just for perverse fun" > rather than anything else. Yes, I'm quite aware that, like alpha and ia64, it's purely of historical interest. It's not even in the

Re: [PATCH v3 06/10] fs/namei.c: Improve dcache hash function

2016-06-02 Thread Linus Torvalds
On Wed, Jun 1, 2016 at 7:31 PM, George Spelvin wrote: > > I could use two more iterations of HASH_MIX() or something similar, > then just take the x value, but that's 6 cycles. If a multiply is > 4 or 5 cycles, that's a net loss. Yes. Especially since the multiply will often end up more able to

Re: [PATCH v3 06/10] fs/namei.c: Improve dcache hash function

2016-06-01 Thread George Spelvin
Linus Torvalds wrote: > On Mon, May 30, 2016 at 11:10 AM, George Spelvin wrote: >> >> I understand, but 64x64-bit multiply on 32-bit is pretty annoyingly >> expensive. In time, code size, and register pressure which bloats >> surrounding code. > Side note, the code seems to work fairly well, but

Re: [PATCH v3 06/10] fs/namei.c: Improve dcache hash function

2016-06-01 Thread Linus Torvalds
On Mon, May 30, 2016 at 11:10 AM, George Spelvin wrote: > > I understand, but 64x64-bit multiply on 32-bit is pretty annoyingly > expensive. In time, code size, and register pressure which bloats > surrounding code. Side note, the code seems to work fairly well, but I do worry a bit about the th

Re: [PATCH v3 06/10] fs/namei.c: Improve dcache hash function

2016-05-30 Thread George Spelvin
On Mon, 30 May 2016 at 18:27:21 +0200, Peter Zijlstra wrote: > On Mon, May 30, 2016 at 12:06:18PM -0400, George Spelvin wrote: > Right; as stated performance really isn't a goal here. I understand, but 64x64-bit multiply on 32-bit is pretty annoyingly expensive. In time, code size, and register p

Re: [PATCH v3 06/10] fs/namei.c: Improve dcache hash function

2016-05-30 Thread Peter Zijlstra
On Mon, May 30, 2016 at 12:06:18PM -0400, George Spelvin wrote: > Not quite. The fold_hash() you quote is used only on 64-bit systems, > which can be assumed to have a reasonable 64-bit multiply. On 32-bit > platforms, I avoid using GOLDEN_RATIO_64 at all, since 64x64-bit > multiplies are so expe

Re: [PATCH v3 06/10] fs/namei.c: Improve dcache hash function

2016-05-30 Thread George Spelvin
Peter Zijlstra wrote: > On Sat, May 28, 2016 at 03:57:19PM -0400, George Spelvin wrote: >> +static inline unsigned int fold_hash(unsigned long x, unsigned long y) >> { >> +y ^= x * GOLDEN_RATIO_64; >> +y *= GOLDEN_RATIO_64; >> +return y >> 32; >> } > So does it make sense to use tha

Re: [PATCH v3 06/10] fs/namei.c: Improve dcache hash function

2016-05-30 Thread Peter Zijlstra
On Sat, May 28, 2016 at 03:57:19PM -0400, George Spelvin wrote: > +static inline unsigned int fold_hash(unsigned long x, unsigned long y) > { > + y ^= x * GOLDEN_RATIO_64; > + y *= GOLDEN_RATIO_64; > + return y >> 32; > } So does it make sense to use that pattern here too? This cod