[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191204151940.GY2844@hirez.programming.kicks-ass.net>
Date: Wed, 4 Dec 2019 16:19:40 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: David Laight <David.Laight@...LAB.COM>
Cc: 'Fenghua Yu' <fenghua.yu@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
H Peter Anvin <hpa@...or.com>,
Andy Lutomirski <luto@...nel.org>,
Ashok Raj <ashok.raj@...el.com>,
Tony Luck <tony.luck@...el.com>,
Ravi V Shankar <ravi.v.shankar@...el.com>,
linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>
Subject: Re: [PATCH v2 1/4] drivers/net/b44: Change to non-atomic bit
operations
On Tue, Nov 26, 2019 at 09:49:08AM +0000, David Laight wrote:
> > memset(ppattern + offset, 0xff, magicsync);
> > for (j = 0; j < magicsync; j++)
> > - set_bit(len++, (unsigned long *) pmask);
> > + __set_bit(len++, (unsigned long *)pmask);
>
> While this stops the misaligned locks, the code is still horribly borked on BE systems.
Quite so.
> The way pmask is used definitely wanst a u32[] not a u64[] one.
Not sure, the code seems fairly consistent in using u8[].
And I suppose we can write the above like:
pmask[len >> 3] |= BIT(len & 7); len++;
instead.
Powered by blists - more mailing lists