From: Dave Jones <davej@redhat.com>
To: Gu Zheng <guz.fnst@cn.fujitsu.com>
Cc: Benjamin <bcrl@kvack.org>, Al Viro <viro@zeniv.linux.org.uk>,
jmoyer@redhat.com, kosaki.motohiro@jp.fujitsu.com,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
tangchen <tangchen@cn.fujitsu.com>,
miaox@cn.fujitsu.com, linux-aio@kvack.org,
fsdevel <linux-fsdevel@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2/2] aio: fix the confliction of read events and migrating ring page
Date: Thu, 20 Mar 2014 10:32:07 -0400 [thread overview]
Message-ID: <20140320143207.GA3760@redhat.com> (raw)
In-Reply-To: <532A80B1.5010002@cn.fujitsu.com>
On Thu, Mar 20, 2014 at 01:46:25PM +0800, Gu Zheng wrote:
> diff --git a/fs/aio.c b/fs/aio.c
> index 88ad40c..e353085 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -319,6 +319,9 @@ static int aio_migratepage(struct address_space *mapping, struct page *new,
> ctx->ring_pages[old->index] = new;
> spin_unlock_irqrestore(&ctx->completion_lock, flags);
>
> + /* Ensure read event is completed before putting old page */
> + mutex_lock(&ctx->ring_lock);
> + mutex_unlock(&ctx->ring_lock);
> put_page(old);
>
> return rc;
This looks a bit weird. Would using a completion work here ?
Dave
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org. For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
WARNING: multiple messages have this Message-ID (diff)
From: Dave Jones <davej@redhat.com>
To: Gu Zheng <guz.fnst@cn.fujitsu.com>
Cc: Benjamin <bcrl@kvack.org>, Al Viro <viro@zeniv.linux.org.uk>,
jmoyer@redhat.com, kosaki.motohiro@jp.fujitsu.com,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
tangchen <tangchen@cn.fujitsu.com>,
miaox@cn.fujitsu.com, linux-aio@kvack.org,
fsdevel <linux-fsdevel@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2/2] aio: fix the confliction of read events and migrating ring page
Date: Thu, 20 Mar 2014 10:32:07 -0400 [thread overview]
Message-ID: <20140320143207.GA3760@redhat.com> (raw)
In-Reply-To: <532A80B1.5010002@cn.fujitsu.com>
On Thu, Mar 20, 2014 at 01:46:25PM +0800, Gu Zheng wrote:
> diff --git a/fs/aio.c b/fs/aio.c
> index 88ad40c..e353085 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -319,6 +319,9 @@ static int aio_migratepage(struct address_space *mapping, struct page *new,
> ctx->ring_pages[old->index] = new;
> spin_unlock_irqrestore(&ctx->completion_lock, flags);
>
> + /* Ensure read event is completed before putting old page */
> + mutex_lock(&ctx->ring_lock);
> + mutex_unlock(&ctx->ring_lock);
> put_page(old);
>
> return rc;
This looks a bit weird. Would using a completion work here ?
Dave
next prev parent reply other threads:[~2014-03-20 14:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-20 5:46 [PATCH 2/2] aio: fix the confliction of read events and migrating ring page Gu Zheng
2014-03-20 5:46 ` Gu Zheng
2014-03-20 14:32 ` Dave Jones [this message]
2014-03-20 14:32 ` Dave Jones
2014-03-20 16:30 ` Benjamin LaHaise
2014-03-20 16:30 ` Benjamin LaHaise
2014-03-21 1:56 ` Gu Zheng
2014-03-21 1:56 ` Gu Zheng
2014-03-21 17:35 ` Benjamin LaHaise
2014-03-21 17:35 ` Benjamin LaHaise
2014-03-21 18:35 ` [PATCH] aio: ensure access to ctx->ring_pages is correctly serialised Benjamin LaHaise
2014-03-21 18:35 ` Benjamin LaHaise
2014-03-24 10:56 ` Gu Zheng
2014-03-24 10:56 ` Gu Zheng
2014-03-24 10:59 ` [V2 PATCH 1/2] aio: clean up aio_migratepage() and related code much Gu Zheng
2014-03-24 10:59 ` Gu Zheng
2014-03-24 13:20 ` Benjamin LaHaise
2014-03-24 13:20 ` Benjamin LaHaise
2014-03-25 10:11 ` Gu Zheng
2014-03-24 10:59 ` [V2 PATCH 2/2] aio: fix the confliction of aio read events and aio migrate page Gu Zheng
2014-03-24 10:59 ` Gu Zheng
2014-03-24 18:22 ` [PATCH] aio: ensure access to ctx->ring_pages is correctly serialised Sasha Levin
2014-03-24 18:22 ` Sasha Levin
2014-03-24 19:07 ` Benjamin LaHaise
2014-03-24 19:07 ` Benjamin LaHaise
2014-03-25 17:47 ` Sasha Levin
2014-03-25 17:47 ` Sasha Levin
2014-03-25 18:57 ` Benjamin LaHaise
2014-03-25 18:57 ` Benjamin LaHaise
2014-03-25 18:57 ` Benjamin LaHaise
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=20140320143207.GA3760@redhat.com \
--to=davej@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bcrl@kvack.org \
--cc=guz.fnst@cn.fujitsu.com \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=jmoyer@redhat.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaox@cn.fujitsu.com \
--cc=tangchen@cn.fujitsu.com \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.