ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: "ksummit-discuss@lists.linuxfoundation.org"
	<ksummit-discuss@lists.linuxfoundation.org>,
	Carlos O'Donell <carlos@redhat.com>,
	"open list:ABI/API" <linux-api@vger.kernel.org>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Thorsten Leemhuis <linux@leemhuis.info>
Subject: Re: [Ksummit-discuss] [MAINTAINERS SUMMIT] & [TECH TOPIC] Improve regression tracking
Date: Wed, 5 Jul 2017 20:24:26 +0200	[thread overview]
Message-ID: <CAKMK7uEGrNH-VGh=cX5y77F-=b+VZfnBzGPh3a1MQYNuohO2pg@mail.gmail.com> (raw)
In-Reply-To: <1499267389.3668.16.camel@HansenPartnership.com>

On Wed, Jul 5, 2017 at 5:09 PM, James Bottomley
<James.Bottomley@hansenpartnership.com> wrote:
>> > > All tests should be run with lockdep enabled ;-)  Which a
>> > > surprising few developers appear to do :-p
>> >
>> > Lockdep checks the locking hierarchies and makes assumptions about
>> > them which it then validates ... it doesn't tell you if the data
>> > you think
>>
>> We should probably look at adding infrastructure that helps in that.
>> RCU already has a lot of there to help know if data is being
>> protected by RCU or not.
>>
>> Hmm, maybe we could add a __rcu like type that we can associate
>> protected data with, where a config can associate access to a
>> variable with a lock being held?
>
> That's about 10x more complex than the releases/acquires/must_hold
> annotation, which we have fairly dismal coverage on.

Yeah, I've never found those useful at all. What we're trying to do in
drm code is liberally sprinkle lockdep_assert_held into accessor and
helper functions (there's lots of nontrivial stuff where you need a
little bit of computation around a pure access, so doesn't result in
ugly code). That catches a lot of these, but of course not all.

The problem with static annotations is that often the lock you need to
hold isn't statically known, and annotating the entire callchain is a
no-go as James points out. But maybe we could use such annotations
plus a gcc plugin to auto-insert the right lockdep_assert_held every
time you read/write into a given field?

That's not going to cover locking rules where the locking rules change
during the lifetime of an object, but I think even without that it
would cover a _lot_ of cases. And if your static annotation would be
allowed to chase pointers (well, just any C expression that takes the
struct pointer as parameter would be sweet) you could even annotate
fields where the protecting lock is in some parent struct.

Another thing I'm really looking forward to (but it's somehow not
moving fast) is the cross-release stuff. Too many times I've screamed
at kernel backtraces stuck in wait_event, and lockdep could have
directly told me what's wrong long before a stress test successfully
hit that race.

There's definitely a lot of room to prove more stuff in locking using tools.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  parent reply	other threads:[~2017-07-05 18:24 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-02 17:51 Thorsten Leemhuis
2017-07-03 16:30 ` Steven Rostedt
2017-07-03 18:50   ` Dan Williams
2017-07-04 19:03   ` Thorsten Leemhuis
2017-07-05 12:45     ` Steven Rostedt
2017-07-05 13:09       ` Carlos O'Donell
2017-07-05 13:27         ` Steven Rostedt
2017-07-05 14:06           ` Greg KH
2017-07-05 14:28             ` Carlos O'Donell
2017-07-05 14:33             ` Steven Rostedt
2017-07-05 14:52               ` Mark Brown
2017-07-05 15:08               ` Carlos O'Donell
2017-07-05 16:10                 ` Steven Rostedt
2017-07-06 11:34                   ` Laurent Pinchart
2017-07-09 13:46               ` Thorsten Leemhuis
2017-07-05 14:33             ` Mark Brown
2017-07-05 14:36               ` Steven Rostedt
2017-07-05 14:50                 ` James Bottomley
2017-07-05 14:56                   ` Steven Rostedt
2017-07-05 15:09                     ` James Bottomley
2017-07-05 15:20                       ` Mark Brown
2017-07-05 15:40                         ` Geert Uytterhoeven
2017-07-05 15:20                       ` Steven Rostedt
2017-07-05 15:32                         ` James Bottomley
2017-07-05 15:43                           ` Steven Rostedt
2017-07-05 18:24                       ` Daniel Vetter [this message]
2017-07-05 18:17                 ` Daniel Vetter
2017-07-05 15:16             ` Guenter Roeck
2017-07-05 15:27               ` Steven Rostedt
2017-07-05 15:36                 ` James Bottomley
2017-07-05 16:04                   ` Steven Rostedt
2017-07-05 16:58                     ` James Bottomley
2017-07-05 17:07                       ` Steven Rostedt
2017-07-05 16:48                 ` Guenter Roeck
2017-07-05 16:58                   ` Dan Williams
2017-07-05 17:02                   ` Steven Rostedt
2017-07-06  9:28                     ` Mark Brown
2017-07-06  9:41                       ` Daniel Vetter
2017-07-06 14:53                         ` Theodore Ts'o
2017-07-06 21:28                           ` Daniel Vetter
2017-07-06 14:48                       ` James Bottomley
2017-07-07 10:03                         ` Mark Brown
2017-07-31 16:54                     ` Eric W. Biederman
2017-07-31 20:11                       ` Steven Rostedt
2017-07-31 20:12                         ` Eric W. Biederman
2017-08-02 16:53                       ` Shuah Khan
2017-08-02 17:33                         ` Eric W. Biederman
2017-08-02 17:46                           ` Shuah Khan
2017-08-02 17:58                             ` Shuah Khan
2017-08-02 18:04                             ` Eric W. Biederman
2017-08-02 18:23                               ` Randy Dunlap
2017-08-02 18:42                               ` Shuah Khan
2017-08-03  3:03                                 ` Theodore Ts'o
2017-08-03 17:42                                   ` Bird, Timothy
2017-08-03 22:11                                     ` Shuah Khan
2017-08-03 18:51                                   ` Shuah Khan
2017-08-04  1:15                                     ` Theodore Ts'o
2017-07-07  3:33                 ` Fengguang Wu
2017-07-07  4:52                   ` Frank Rowand
2017-07-05 15:32               ` Greg KH
2017-07-05 15:36                 ` Carlos O'Donell
2017-07-05 15:52                 ` Steven Rostedt
2017-07-05 18:42                   ` Greg KH
2017-07-05 18:29                 ` Daniel Vetter
2017-07-06 22:24                 ` Shuah Khan
2017-07-06 22:32                   ` Steven Rostedt
2017-07-06 22:40                     ` Shuah Khan
2017-07-05 16:54             ` Dan Williams
2017-07-05 18:45               ` Greg KH
2017-07-05 19:47                 ` Dan Williams
2017-07-05 14:06           ` Carlos O'Donell
2017-07-05 15:47         ` Mark Brown
2017-07-07  6:15 ` Andrei Vagin

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='CAKMK7uEGrNH-VGh=cX5y77F-=b+VZfnBzGPh3a1MQYNuohO2pg@mail.gmail.com' \
    --to=daniel.vetter@ffwll.ch \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=carlos@redhat.com \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux@leemhuis.info \
    --cc=shuahkh@osg.samsung.com \
    /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