Thread (21 messages) 21 messages, 4 authors, 2017-01-03

Re: [PATCH 2/2] mm: add PageWaiters indicating tasks are waiting for a page bit

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-12-27 19:41:38
Also in: lkml

On Tue, Dec 27, 2016 at 11:24 AM, Linus Torvalds
[off-list ref] 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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help