Coccinelle Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: wagi@monom.org (Daniel Wagner)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Filter out field names
Date: Fri, 26 Feb 2016 11:40:51 +0100	[thread overview]
Message-ID: <56D02BB3.1060501@monom.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1601211138470.2530@hadrien>

Hi Julia,

Sorry for the long delay. Got distracted again.

On 01/21/2016 12:02 PM, Julia Lawall wrote:
> An issue that remains is that you assume that the lock field has type
> lock.  A quick grep in the Linux kernel shows that this is not always the
> case.  You can make a virtual identifier for the lock field as well.  A
> more complicated approach would be to have Coccinelle figure out the type
> from the structure type definition.
> 
> A final issue is that my quick grep in the Linux kernel also shows that not
> all locks are in structures.  But then it is less obvious how to connect
> the locks to the protected references.
> 
> And thinking on, it is not always the case that because a structure has a
> lock, that every field has to be accessed under a lock.  So in the end, it
> may be necessary to do something even more clever.  For example,
> if a field is somewhere referenced under a lock, and not referenced under a
> lock in some other place, then perhaps that is more likely to be a real
> problem.  But even that is not 100% certain, because there can be eg an
> initialization phase that is not done concurrently, so no locks are
> actually needed at that point, even though locks are needed elsewhere.

Your analysis is absolutely correct. Automatically annotating is not
really feasibly. At least without a lot of additional hand work.
Especially the more interesting data structure do no have a simple
locking pattern. Instead all access is heavily optimized which makes
writing  generic cocci rules really difficult (impossible?).

I think my idea isn't that simple as I hoped. Well, at least I have
learned something.

thanks a lot for your help,
daniel

  parent reply	other threads:[~2016-02-26 10:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21  9:47 [Cocci] Filter out field names Daniel Wagner
2016-01-21 11:02 ` Julia Lawall
2016-01-22 14:32   ` Daniel Wagner
2016-01-22 16:09   ` SF Markus Elfring
2016-02-26 10:40   ` Daniel Wagner [this message]
2016-02-26 12:40     ` SF Markus Elfring

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=56D02BB3.1060501@monom.org \
    --to=wagi@monom.org \
    --cc=cocci@systeme.lip6.fr \
    /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