From: Konstantin Khlebnikov <khlebnikov@openvz.org>
To: "sagig@mellanox.com" <sagig@mellanox.com>
Cc: "aarcange@redhat.com" <aarcange@redhat.com>,
"ogerlitz@mellanox.com" <ogerlitz@mellanox.com>,
"gleb@redhat.com" <gleb@redhat.com>,
"oren@mellanox.com" <oren@mellanox.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH RFC V1] mm: convert rcu_read_lock() to srcu_read_lock(), thus allowing to sleep in callbacks
Date: Mon, 06 Feb 2012 00:27:59 +0400 [thread overview]
Message-ID: <4F2EE64F.6010900@openvz.org> (raw)
In-Reply-To: <4f2eae5e.e951b40a.3aa3.5ddc@mx.google.com>
sagig@mellanox.com wrote:
> Now that anon_vma lock and i_mmap_mutex are both sleepable mutex, it is possible to schedule inside invalidation callbacks
> (such as invalidate_page, invalidate_range_start/end and change_pte) .
> This is essential for a scheduling HW sync in RDMA drivers which apply on demand paging methods.
>
> Signed-off-by: sagi grimberg<sagig@mellanox.co.il>
Ok, this is better, but it still does not work =)
Nobody synchronize with this srcu. There at least two candidates:
mmu_notifier_release() and mmu_notifier_unregister().
They call synchronize_rcu(), you must replace it with synchronize_srcu().
> ---
> changes from V0:
> 1. srcu_struct should be shared and not allocated in each callback - removed from callbacks
> 2. added srcu_struct under mmu_notifier_mm
> 3. init_srcu_struct when creating mmu_notifier_mm
> 4. srcu_cleanup when destroying mmu_notifier_mm
>
> @@ -204,6 +208,8 @@ static int do_mmu_notifier_register(struct mmu_notifier *mn,
>
> if (!mm_has_notifiers(mm)) {
> INIT_HLIST_HEAD(&mmu_notifier_mm->list);
> + if (init_srcu_struct(&mmu_notifier_mm->srcu))
> + goto out_cleanup;
move it upper, out of mm->mmap_sem lock. and fix error path.
> spin_lock_init(&mmu_notifier_mm->lock);
> mm->mmu_notifier_mm = mmu_notifier_mm;
> mmu_notifier_mm = NULL;
> @@ -266,6 +272,7 @@ EXPORT_SYMBOL_GPL(__mmu_notifier_register);
> void __mmu_notifier_mm_destroy(struct mm_struct *mm)
> {
> BUG_ON(!hlist_empty(&mm->mmu_notifier_mm->list));
> + cleanup_srcu_struct(&mm->mmu_notifier_mm->srcu);
> kfree(mm->mmu_notifier_mm);
> mm->mmu_notifier_mm = LIST_POISON1; /* debug */
> }
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-02-05 20:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-05 16:29 [PATCH RFC V1] mm: convert rcu_read_lock() to srcu_read_lock(), thus allowing to sleep in callbacks sagig
2012-02-05 20:27 ` Konstantin Khlebnikov [this message]
2012-02-06 9:11 ` sagig
2012-02-06 11:29 ` Konstantin Khlebnikov
2012-02-06 9:11 ` sagig
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=4F2EE64F.6010900@openvz.org \
--to=khlebnikov@openvz.org \
--cc=aarcange@redhat.com \
--cc=gleb@redhat.com \
--cc=linux-mm@kvack.org \
--cc=ogerlitz@mellanox.com \
--cc=oren@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;
as well as URLs for NNTP newsgroup(s).