Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755048Ab3IMUZv (ORCPT ); Fri, 13 Sep 2013 16:25:51 -0400 Received: from mail-vb0-f54.google.com ([209.85.212.54]:58621 "EHLO mail-vb0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753777Ab3IMUZt (ORCPT ); Fri, 13 Sep 2013 16:25:49 -0400 MIME-Version: 1.0 In-Reply-To: <20130913200000.GT13318@ZenIV.linux.org.uk> References: <20130910222924.GB13318@ZenIV.linux.org.uk> <20130910153520.14e49cd32feb16d45eb8abac@linux-foundation.org> <20130910223624.GC13318@ZenIV.linux.org.uk> <20130910154116.cc4afe048213a779040ea3cc@linux-foundation.org> <20130910224823.GE13318@ZenIV.linux.org.uk> <20130910225934.GF13318@ZenIV.linux.org.uk> <20130913200000.GT13318@ZenIV.linux.org.uk> Date: Fri, 13 Sep 2013 16:25:48 -0400 X-Google-Sender-Auth: Ok-RagxGyCPZMNBmgaAFO8O2cIk Message-ID: Subject: Re: linux-next: manual merge of the akpm tree with Linus' tree From: Linus Torvalds To: Al Viro Cc: Andrew Morton , Stephen Rothwell , linux-next , Linux Kernel Mailing List , Dave Chinner , Glauber Costa Content-Type: multipart/mixed; boundary=047d7bacb98ef2481704e649a8dc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 10377 Lines: 151 --047d7bacb98ef2481704e649a8dc Content-Type: text/plain; charset=UTF-8 On Fri, Sep 13, 2013 at 4:00 PM, Al Viro wrote: \> > It is right - for one thing, we are holding the lock on that LRU list, > so list_lru_del() would deadlock right there. For another, the same > list_lru_walk (OK, list_lru_walk_node()) will do ->nr_items decrement > when we return LRU_REMOVED to it, so we don't want to do it twice. > Plain list_del_init() is correct here. Yes. And I found the opposite bug in one place: when we are collecting dentries by walking the parents etc, we do *not* hold the global RCU lock, so we cannot use the "d_lru_shrink_list()" thing after all. It's correct as far as the internal logic of fs/dcache.c goes, but it violates the global LRU list rules. So I replaced that with a dentry_lru_del() followed by a d_shrink_add() instead. Updated patch attached. Linus --047d7bacb98ef2481704e649a8dc Content-Type: application/octet-stream; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hljuvn5l0 IGZzL2RjYWNoZS5jIHwgMTI5ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrLS0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDEwMiBpbnNlcnRpb25zKCsp LCAyNyBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9mcy9kY2FjaGUuYyBiL2ZzL2RjYWNoZS5j CmluZGV4IDFiZDQ2MTRjZTkzYi4uNDM1Yjk3NTYwNjc0IDEwMDY0NAotLS0gYS9mcy9kY2FjaGUu YworKysgYi9mcy9kY2FjaGUuYwpAQCAtMzU3LDE1ICszNTcsODAgQEAgc3RhdGljIHZvaWQgZGVu dHJ5X3VubGlua19pbm9kZShzdHJ1Y3QgZGVudHJ5ICogZGVudHJ5KQogfQogCiAvKgorICogVGhl IERDQUNIRV9MUlVfTElTVCBiaXQgaXMgc2V0IHdoZW5ldmVyIHRoZSAnZF9scnUnIGVudHJ5Cisg KiBpcyBpbiB1c2UgLSB3aGljaCBpbmNsdWRlcyBib3RoIHRoZSAicmVhbCIgcGVyLXN1cGVyYmxv Y2sKKyAqIExSVSBsaXN0IF9hbmRfIHRoZSBEQ0FDSEVfU0hSSU5LX0xJU1QgdXNlLgorICoKKyAq IFRoZSBEQ0FDSEVfU0hSSU5LX0xJU1QgYml0IGlzIHNldCB3aGVuZXZlciB0aGUgZGVudHJ5IGlz CisgKiBvbiB0aGUgc2hyaW5rIGxpc3QgKGllIG5vdCBvbiB0aGUgc3VwZXJibG9jayBMUlUgbGlz dCkuCisgKgorICogVGhlIHBlci1jcHUgIm5yX2RlbnRyeV91bnVzZWQiIGNvdW50ZXJzIGFyZSB1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sKLQkJZGVudHJ5X2xydV9kZWwoZGVudHJ5KTsKLQkJbGlzdF9hZGRfdGFpbCgmZGVudHJ5LT5k X2xydSwgJmRhdGEtPmRpc3Bvc2UpOwotCQlkZW50cnktPmRfZmxhZ3MgfD0gRENBQ0hFX1NIUklO S19MSVNUOworCQkvKgorCQkgKiBXZSBjYW4ndCB1c2UgZF9scnVfc2hyaW5rX21vdmUoKSBiZWNh dXNlIHdlCisJCSAqIG5lZWQgdG8gZ2V0IHRoZSBnbG9iYWwgTFJVIGxvY2sgYW5kIGRvIHRoZQor CQkgKiBSTFUgYWNjb3VudGluZy4KKwkJICovCisJCWRfbHJ1X2RlbChkZW50cnkpOworCQlkX3No cmlua19hZGQoZGVudHJ5LCAmZGF0YS0+ZGlzcG9zZSk7CiAJCWRhdGEtPmZvdW5kKys7CiAJCXJl dCA9IERfV0FMS19OT1JFVFJZOwogCX0K --047d7bacb98ef2481704e649a8dc-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/