Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933166AbcL0Tli (ORCPT ); Tue, 27 Dec 2016 14:41:38 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:34627 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755171AbcL0Tlb (ORCPT ); Tue, 27 Dec 2016 14:41:31 -0500 MIME-Version: 1.0 In-Reply-To: References: <20161225030030.23219-1-npiggin@gmail.com> <20161225030030.23219-3-npiggin@gmail.com> <20161226111654.76ab0957@roar.ozlabs.ibm.com> <20161227211946.3770b6ce@roar.ozlabs.ibm.com> From: Linus Torvalds Date: Tue, 27 Dec 2016 11:40:38 -0800 X-Google-Sender-Auth: KmAw0QhhAcxX5YTDYXI-NbLQ4MY Message-ID: Subject: Re: [PATCH 2/2] mm: add PageWaiters indicating tasks are waiting for a page bit To: Nicholas Piggin Cc: Dave Hansen , Bob Peterson , Linux Kernel Mailing List , Steven Whitehouse , Andrew Lutomirski , Andreas Gruenbacher , Peter Zijlstra , linux-mm , Mel Gorman Content-Type: multipart/mixed; boundary=94eb2c077580e74a760544a90632 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5025 Lines: 88 --94eb2c077580e74a760544a90632 Content-Type: text/plain; charset=UTF-8 On Tue, Dec 27, 2016 at 11:24 AM, Linus Torvalds 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 --94eb2c077580e74a760544a90632 Content-Type: text/plain; charset=US-ASCII; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ix7x3qlx1 IGFyY2gveDg2L2luY2x1ZGUvYXNtL2JpdG9wcy5oIHwgMTMgKysrKysrKysrKysrKwogaW5jbHVk ZS9saW51eC9wYWdlLWZsYWdzLmggICAgfCAgMiArLQogbW0vZmlsZW1hcC5jICAgICAgICAgICAg ICAgICAgfCAyNCArKysrKysrKysrKysrKysrKysrKystLS0KIDMgZmlsZXMgY2hhbmdlZCwgMzUg aW5zZXJ0aW9ucygrKSwgNCBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9hcmNoL3g4Ni9pbmNs dWRlL2FzbS9iaXRvcHMuaCBiL2FyY2gveDg2L2luY2x1ZGUvYXNtL2JpdG9wcy5oCmluZGV4IDY4 NTU3ZjUyYjk2MS4uODU0MDIyNzcyYzViIDEwMDY0NAotLS0gYS9hcmNoL3g4Ni9pbmNsdWRlL2Fz bS9iaXRvcHMuaAorKysgYi9hcmNoL3g4Ni9pbmNsdWRlL2FzbS9iaXRvcHMuaApAQCAtMTM5LDYg KzEzOSwxOSBAQCBzdGF0aWMgX19hbHdheXNfaW5saW5lIHZvaWQgX19jbGVhcl9iaXQobG9uZyBu ciwgdm9sYXRpbGUgdW5zaWduZWQgbG9uZyAqYWRkcikKIAlhc20gdm9sYXRpbGUoImJ0ciAlMSwl MCIgOiBBRERSIDogIklyIiAobnIpKTsKIH0KIAorc3RhdGljIF9fYWx3YXlzX2lubGluZSBib29s IGNsZWFyX2JpdF91bmxvY2tfaXNfbmVnYXRpdmVfYnl0ZShsb25nIG5yLCB2b2xhdGlsZSB1bnNp Z25lZCBsb25nICphZGRyKQoreworCWJvb2wgbmVnYXRpdmU7CisJYXNtIHZvbGF0aWxlKExPQ0tf UFJFRklYICJhbmRiICUyLCUxXG5cdCIKKwkJQ0NfU0VUKHMpCisJCTogQ0NfT1VUKHMpIChuZWdh dGl2ZSksIE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