From: Linus Torvalds <torvalds@linux-foundation.org>
To: Benjamin LaHaise <bcrl@kvack.org>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
Sasha Levin <sasha.levin@oracle.com>,
Tang Chen <tangchen@cn.fujitsu.com>,
Gu Zheng <guz.fnst@cn.fujitsu.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
stable <stable@vger.kernel.org>,
linux-aio@kvack.org, linux-mm <linux-mm@kvack.org>
Subject: Re: git pull -- [PATCH] aio: v2 ensure access to ctx->ring_pages is correctly serialised
Date: Thu, 27 Mar 2014 13:22:11 -0700 [thread overview]
Message-ID: <CA+55aFy_sRnFu7KguAUAN5kbHk3Qa_0ZuATPU5i8LOyMMWZ_5g@mail.gmail.com> (raw)
In-Reply-To: <20140327200851.GL17679@kvack.org>
On Thu, Mar 27, 2014 at 1:08 PM, Benjamin LaHaise <bcrl@kvack.org> wrote:
>
> The patch below is lightly tested -- my migration test case is able to
> successfully move the aio ring around multiple times. It still needs to
> be run through some more thorough tests (like Trinity). See below for
> the differences relative to your patch.
Ok, from a quick glance-through this fixes my big complaints (not
unrurprisingly, similarly to my patch), and seems to fix few of the
smaller ones that I didn't bother with.
However, I think you missed the mutex_unlock() in the error paths of
ioctx_alloc().
> What I did instead is to just hold mapping->private_lock over the entire
> operation of aio_migratepage. That gets rid of the probably broken attempt
> to take a reference count on the kioctx within aio_migratepage(), and makes
> it completely clear that migration won't touch a kioctx after
> put_aio_ring_file() returns. It also cleans up much of the error handling
> in aio_migratepage() since things cannot change unexpectedly.
Yes, that looks simpler. I don't know what the latency implications
are, but the expensive part (the actual page migration) was and
continues to be under the completion lock with interrupts disabled, so
I guess it's not worse.
It would be good to try to get rid of the completion lock irq thing,
but that looks complex. It would likely require a two-phase migration
model, where phase one is "unmap page from user space and copy it to
new page", and phase two would be "insert new page into mapping". Then
we could have just a "update the tail pointer and the kernel mapping
under the completion lock" thing with interrupts disabled in between.
But that's a much bigger change and requires help from the migration
people. Maybe we don't care about latency here.
> I also added a few comments to help explain the locking.
>
> How does this version look?
Looks ok, except for the error handling wrt mutex_unlock. Did I miss it?
Linus
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-03-27 20:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-27 13:46 Benjamin LaHaise
2014-03-27 18:16 ` Linus Torvalds
2014-03-27 19:43 ` Linus Torvalds
2014-03-27 20:08 ` Benjamin LaHaise
2014-03-27 20:22 ` Linus Torvalds [this message]
2014-03-27 20:57 ` Benjamin LaHaise
2014-03-27 21:34 ` Linus Torvalds
2014-03-28 14:58 ` Benjamin LaHaise
2014-03-28 17:08 ` Linus Torvalds
2014-03-28 17:22 ` Benjamin LaHaise
2014-03-28 17:31 ` Linus Torvalds
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=CA+55aFy_sRnFu7KguAUAN5kbHk3Qa_0ZuATPU5i8LOyMMWZ_5g@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=bcrl@kvack.org \
--cc=guz.fnst@cn.fujitsu.com \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=linux-aio@kvack.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sasha.levin@oracle.com \
--cc=stable@vger.kernel.org \
--cc=tangchen@cn.fujitsu.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