From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752161AbdIEHWt (ORCPT ); Tue, 5 Sep 2017 03:22:49 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:46473 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbdIEHWp (ORCPT ); Tue, 5 Sep 2017 03:22:45 -0400 Date: Tue, 5 Sep 2017 09:22:39 +0200 From: Peter Zijlstra To: Byungchul Park Cc: tj@kernel.org, johannes.berg@intel.com, mingo@kernel.org, tglx@linutronix.de, oleg@redhat.com, david@fromorbit.com, linux-kernel@vger.kernel.org, kernel-team@lge.com Subject: Re: [PATCH 2/3] lockdep: Introduce lock_acquire_might() Message-ID: <20170905072239.ggxalc2vrbpoyppr@hirez.programming.kicks-ass.net> References: <1504578554-4137-1-git-send-email-byungchul.park@lge.com> <1504578554-4137-3-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1504578554-4137-3-git-send-email-byungchul.park@lge.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 05, 2017 at 11:29:13AM +0900, Byungchul Park wrote: > From the point of view of crossrelease, we can never be aware of the > release context in advance, until we get to the lock_release(). > However, this way we cannot report deadlocks occured at the time. > > Sometimes, we want to report that kind of problems, taking a risk > generating false dependencies e.g. lock_acquire()s in workqueue code, > which inevitably generate false ones with all acquisitions in works. > > It would be better to provide another primitive, lock_acquire_might() > for that purpose so that lockdep internal can be aware of what users > expect and get chances to enhance to avoid false ones. > > The primitive should: > > 1. work as if it's trylock, since links between lock_acquire_might() > and later ones are only meaningful. Remind this should be used to > do what crossrelease commit does, in advance. > > 2. make acquisitions by lock_acquire_might() ignored on the commit. > Shees, talk about ugly... Also might-lock has a different meaning.