linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michel Lespinasse <walken@google.com>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: linux-mm <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	 David Rientjes <rientjes@google.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Hugh Dickins <hughd@google.com>,
	 Jerome Glisse <jglisse@redhat.com>,
	Laurent Dufour <ldufour@linux.ibm.com>,
	 Liam Howlett <Liam.Howlett@oracle.com>,
	Matthew Wilcox <willy@infradead.org>,
	 Peter Zijlstra <peterz@infradead.org>,
	Vlastimil Babka <vbabka@suse.cz>, Ying Han <yinghan@google.com>,
	 LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 3/8] mmap locking API: use coccinelle to convert mmap_sem rwsem call sites
Date: Thu, 26 Mar 2020 15:17:52 -0700	[thread overview]
Message-ID: <CANN689FtZ3VRzAJdHuSP2k=5r9p9QUe08caJpkuRjeLV=hQ9Kg@mail.gmail.com> (raw)
In-Reply-To: <b1c878c0-878a-6684-7cac-d1f4409295f6@web.de>

That seems to work too. I'm quite noobish in using coccinelle, so I
wouldn't have been able to come up with that version on my own.

On Thu, Mar 26, 2020 at 6:30 AM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> > This change converts the existing mmap_sem rwsem calls to use the new
> > mmap locking API instead.
> >
> > The change is generated using coccinelle with the following rules:
>
> Do you find the following script variant more succinct together
> with the usage of a disjunction in a single SmPL rule?
>
>
> @replacement@
> expression x;
> @@
> (
> -init_rwsem
> +mmap_init_lock
> |
> -down_write
> +mmap_write_lock
> |
> -down_write_killable
> +mmap_write_lock_killable
> |
> -down_write_trylock
> +mmap_write_trylock
> |
> -up_write
> +mmap_write_unlock
> |
> -downgrade_write
> +mmap_downgrade_write_lock
> |
> -down_read
> +mmap_read_lock
> |
> -down_read_killable
> +mmap_read_lock_killable
> |
> -down_read_trylock
> +mmap_read_trylock
> |
> -up_read
> +mmap_read_unlock
> |
> -rwsem_is_locked
> +mmap_is_locked
> )
>  (
> - &
>   x
> - ->mmap_sem
>  )
>
>
> Regards,
> Markus



-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.


  reply	other threads:[~2020-03-26 22:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 13:30 [PATCH 3/8] mmap locking API: use coccinelle to convert mmap_sem rwsem call sites Markus Elfring
2020-03-26 22:17 ` Michel Lespinasse [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-03-26  7:02 [PATCH 0/8] Add a new mmap locking API wrapping mmap_sem calls Michel Lespinasse
2020-03-26  7:02 ` [PATCH 3/8] mmap locking API: use coccinelle to convert mmap_sem rwsem call sites Michel Lespinasse
2020-03-27  0:01   ` kbuild test robot
2020-03-27  0:40   ` kbuild test robot

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='CANN689FtZ3VRzAJdHuSP2k=5r9p9QUe08caJpkuRjeLV=hQ9Kg@mail.gmail.com' \
    --to=walken@google.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=Markus.Elfring@web.de \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=hughd@google.com \
    --cc=jglisse@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=ldufour@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterz@infradead.org \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    --cc=yinghan@google.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;
as well as URLs for NNTP newsgroup(s).