From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752646AbdLHRfK (ORCPT ); Fri, 8 Dec 2017 12:35:10 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:46800 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752003AbdLHRfI (ORCPT ); Fri, 8 Dec 2017 12:35:08 -0500 Date: Fri, 8 Dec 2017 12:35:07 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Byungchul Park cc: Dave Chinner , "Theodore Ts'o" , Matthew Wilcox , Matthew Wilcox , Ross Zwisler , Jens Axboe , Rehas Sachdeva , , , , , , , , , Subject: Re: [PATCH v4 72/73] xfs: Convert mru cache to XArray In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 8 Dec 2017, Byungchul Park wrote: > I'm sorry to hear that.. If I were you, I would also get > annoyed. And.. thanks for explanation. > > But, I think assigning lock classes properly and checking > relationship of the classes to detect deadlocks is reasonable. > > In my opinion about the common lockdep stuff, there are 2 > problems on it. > > 1) Firstly, it's hard to assign lock classes *properly*. By > default, it relies on the caller site of lockdep_init_map(), > but we need to assign another class manually, where ordering > rules are complicated so cannot rely on the caller site. That > *only* can be done by experts of the subsystem. > > I think if they want to get benifit from lockdep, they have no > choice but to assign classes manually with the domain knowledge, > or use *lockdep_set_novalidate_class()* to invalidate locks > making the developers annoyed and not want to use the checking > for them. Lockdep's no_validate class is used when the locking patterns are too complicated for lockdep to understand. Basically, it tells lockdep to ignore those locks. The device core uses that class. The tree of struct devices, each with its own lock, gets used in many different and complicated ways. Lockdep can't understand this -- it doesn't have the ability to represent an arbitrarily deep hierarchical tree of locks -- so we tell it to ignore the device locks. It sounds like XFS may need to do the same thing with its semaphores. Alan Stern