[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFyXXKdjbidzVC=waiaAaUJpwqZQZv-kKoZfaiWtYy3z=A@mail.gmail.com>
Date: Tue, 27 Dec 2016 11:40:38 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Nicholas Piggin <npiggin@...il.com>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>,
Bob Peterson <rpeterso@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Steven Whitehouse <swhiteho@...hat.com>,
Andrew Lutomirski <luto@...nel.org>,
Andreas Gruenbacher <agruenba@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
linux-mm <linux-mm@...ck.org>,
Mel Gorman <mgorman@...hsingularity.net>
Subject: Re: [PATCH 2/2] mm: add PageWaiters indicating tasks are waiting for
a page bit
On Tue, Dec 27, 2016 at 11:24 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> Oops. I should include the actual patch I was talking about too, shouldn't I?
And that patch was completely buggy. The mask for the "and" was computed as
+ : "Ir" (1 << nr) : "memory");
but that clears every bit *except* for the one we actually want to
clear. I even posted the code it generates:
lock; andb $1,(%rdi) #, MEM[(volatile long int *)_7]
js .L114 #,
which is obviously crap.
The mask needs to be inverted, of course, and the constraint should be
"ir" (not "Ir" - the "I" is for shift constants) so it should be
+ : "ir" ((char) ~(1 << nr)) : "memory");
new patch attached (but still entirely untested, so caveat emptor).
This patch at least might have a chance in hell of working. Let's see..
Linus
View attachment "patch.diff" of type "text/plain" (2830 bytes)
Powered by blists - more mailing lists