From: Byungchul Park <byungchul.park@lge.com>
To: Peter Zijlstra <peterz@infradead.org>
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()
Date: Tue, 26 Sep 2017 09:58:21 +0900 [thread overview]
Message-ID: <20170926005820.GO5994@X58A-UD3R> (raw)
In-Reply-To: <20170912003502.GF3240@X58A-UD3R>
On Tue, Sep 12, 2017 at 09:35:02AM +0900, Byungchul Park wrote:
> On Tue, Sep 05, 2017 at 09:22:39AM +0200, Peter Zijlstra wrote:
> > 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.
>
> OK. The description should be modified. I think I failed to explain what
> I intended. What do you think about the following, which I saied in
> another thread?
>
> If we use real acquisitions instead of 'might' for that speculative
> purpose as the workqueue code currently does:
>
> (1) All locks used in every work->func() generate false dependencies
> with 'work' lockdep_map and 'wq' lockdep_map, while any flush works
> are not involved. But, it's inevitable.
>
> (2) Moreover, it also generates more false ones between the real
> acquisitions. Of course, it can be avoidable if we force to use only
> recursive-read for that purpose, which is not true for now.
>
> (3) Moreover, it also generates more false ones between holding locks
> and the real ones. Of course, the workqueue code is not the case for
> now.
>
> (4) Moreover, it also generates more false ones between the real ones
> and a crosslock on commit, once crossrelease is able to work for
> recursive-read things.
Here, I want to discuss 'might' thing. IMHO, new primitive should be
used instead of read-recursive on speculative acquisitons used in e.g.
workqueue or smp/hotplug.
next prev parent reply other threads:[~2017-09-26 0:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 2:29 [PATCH 0/3] Fix the workqueue and lockdep annotation issue Byungchul Park
2017-09-05 2:29 ` [PATCH 1/3] lockdep: Use enum type on hlock->read instead of magic number Byungchul Park
2017-09-05 2:29 ` [PATCH 2/3] lockdep: Introduce lock_acquire_might() Byungchul Park
2017-09-05 7:22 ` Peter Zijlstra
2017-09-12 0:35 ` Byungchul Park
2017-09-26 0:58 ` Byungchul Park [this message]
2017-09-05 2:29 ` [PATCH 3/3] lockdep: Remove unnecessary acquisitions wrt workqueue flush Byungchul Park
2017-09-05 7:25 ` Peter Zijlstra
2017-09-05 7:36 ` 박병철/선임연구원/SW Platform(연)AOT팀(byungchul.park@lge.com)
2017-09-05 8:16 ` Peter Zijlstra
2017-09-05 8:19 ` Byungchul Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170926005820.GO5994@X58A-UD3R \
--to=byungchul.park@lge.com \
--cc=david@fromorbit.com \
--cc=johannes.berg@intel.com \
--cc=kernel-team@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome