linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: Sagi Grimberg <sagig@mellanox.com>
Cc: linux-mm@kvack.org, ogrelitz@mellanox.com
Subject: Re: [PATCH V3] mm: convert rcu_read_lock() to srcu_read_lock(), thus allowing to sleep in callbacks
Date: Wed, 21 Mar 2012 19:02:27 +0100	[thread overview]
Message-ID: <20120321180227.GH24602@redhat.com> (raw)
In-Reply-To: <1328709344-6058-1-git-send-email-sagig@mellanox.co.il>

Hi Sagi,

There are a couple of rcu_read_lock not converted at the top.

On Wed, Feb 08, 2012 at 03:55:43PM +0200, Sagi Grimberg wrote:
> @@ -196,6 +200,9 @@ static int do_mmu_notifier_register(struct mmu_notifier *mn,
>  	if (unlikely(!mmu_notifier_mm))
>  		goto out;
>  
> +	if (init_srcu_struct(&mmu_notifier_mm->srcu))
> +		goto out_cleanup;
> +
>  	if (take_mmap_sem)
>  		down_write(&mm->mmap_sem);

out_cleanup will up_write if take_mmap_sem is set, and at that point
the mmap_sem hasn't been taken yet.

>  	ret = mm_take_all_locks(mm);
> @@ -226,8 +233,11 @@ static int do_mmu_notifier_register(struct mmu_notifier *mn,
>  out_cleanup:
>  	if (take_mmap_sem)
>  		up_write(&mm->mmap_sem);
> -	/* kfree() does nothing if mmu_notifier_mm is NULL */
> -	kfree(mmu_notifier_mm);
> +
> +	if (mm->mmu_notifier_mm) {

I guess this should be "if (mmu_notifier_mm)";

I happened to notice my older patch still applies cleanly and it has
the above issues already correct, so I'm appending it after refreshing
it to upstream.

====

      parent reply	other threads:[~2012-03-21 18:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08 13:55 Sagi Grimberg
2012-03-07 15:08 ` Andrea Arcangeli
2012-03-21 18:02 ` Andrea Arcangeli [this message]

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=20120321180227.GH24602@redhat.com \
    --to=aarcange@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=ogrelitz@mellanox.com \
    --cc=sagig@mellanox.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