Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751537Ab3HTTKd (ORCPT ); Tue, 20 Aug 2013 15:10:33 -0400 Received: from s3.sipsolutions.net ([144.76.43.152]:56154 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750933Ab3HTTKb (ORCPT ); Tue, 20 Aug 2013 15:10:31 -0400 Message-ID: <1377025813.13829.22.camel@jlt4.sipsolutions.net> Subject: Re: 3.11-rc6 genetlink locking fix offends lockdep From: Johannes Berg To: Hugh Dickins Cc: Ding Tianhong , Linus Torvalds , Greg KH , "David S. Miller" , "Otcheretianski, Andrei" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "stable@vger.kernel.org" , Pravin B Shelar , Thomas Graf Date: Tue, 20 Aug 2013 21:10:13 +0200 In-Reply-To: <1377025368.13829.21.camel@jlt4.sipsolutions.net> References: <1376899214.14734.6.camel@jlt4.sipsolutions.net> <5211FAB3.7080400@huawei.com> <1376911362.14734.11.camel@jlt4.sipsolutions.net> (sfid-20130819_205317_938941_E76DFECF) <1376987338.13829.7.camel@jlt4.sipsolutions.net> <1377025368.13829.21.camel@jlt4.sipsolutions.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1204 Lines: 27 On Tue, 2013-08-20 at 21:02 +0200, Johannes Berg wrote: > On Tue, 2013-08-20 at 10:28 +0200, Johannes Berg wrote: > > > The only way to fix this that I see right now (that doesn't rewrite the > > locking completely) would be to make genetlink use parallel_ops itself, > > thereby removing the genl_lock() in genl_rcv_msg() and breaking all > > those lock chains that lockdep reported. After that, it should be safe > > to use genl_lock() inside all the operations. Something like the patch > > below, perhaps? Completely untested so far. > > Tested now, and it still causes lockdep to complain, though that's a > lockdep issue I believe, it thinks that genl_mutex and nlk->cb_mutex can > be inverted although nlk->cb_mutex exists per family, so we need to > annotate lockdep there. No, lockdep is correct - generic netlink uses the same cb_mutex for all families, obviously, since it's all the same netlink family. I'll just convert it to RCU. johannes -- 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/