From: Helge Deller <deller@gmx.de>
To: Benjamin LaHaise <bcrl@kvack.org>,
linux-aio@kvack.org, linux-kernel@vger.kernel.org,
linux-parisc@vger.kernel.org,
James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: [PATCH] aio: fix D-cache aliasing issues
Date: Fri, 15 Nov 2013 23:05:29 +0100 [thread overview]
Message-ID: <20131115220529.GA3160@ls3530.box> (raw)
When a user page mapping is released via kunmap*() functions, the D-cache needs
to be flushed via flush_dcache_page() to avoid D-cache aliasing issues.
This patch fixes aio on the parisc platform (and probably others).
Signed-off-by: Helge Deller <deller@gmx.de>
To: Benjamin LaHaise <bcrl@kvack.org>
To: linux-aio@kvack.org
Cc: stable@vger.kernel.org # 3.12+
diff --git a/fs/aio.c b/fs/aio.c
index 823efcb..2181821 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -514,6 +514,7 @@ static void free_ioctx(struct work_struct *work)
atomic_add(avail, &ctx->reqs_available);
ring->head = ring->tail;
kunmap_atomic(ring);
+ flush_dcache_page(ctx->ring_pages[0]);
if (atomic_read(&ctx->reqs_available) >= ctx->nr_events - 1)
break;
@@ -568,6 +569,7 @@ static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm)
ring = kmap_atomic(ctx->ring_pages[0]);
ring->id = ctx->id;
kunmap_atomic(ring);
+ flush_dcache_page(ctx->ring_pages[0]);
return 0;
}
@@ -1032,6 +1034,7 @@ static long aio_read_events_ring(struct kioctx *ctx,
head = ring->head;
tail = ring->tail;
kunmap_atomic(ring);
+ flush_dcache_page(ctx->ring_pages[0]);
pr_debug("h%u t%u m%u\n", head, tail, ctx->nr_events);
next reply other threads:[~2013-11-15 22:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 22:05 Helge Deller [this message]
2013-11-15 22:42 ` [PATCH] aio: fix D-cache aliasing issues James Bottomley
2013-11-16 20:07 ` Simon Baatz
2013-11-16 20:09 ` Benjamin LaHaise
2013-11-17 21:23 ` Helge Deller
2013-11-17 21:49 ` James Bottomley
2013-11-17 23:47 ` Helge Deller
2013-11-18 0:52 ` James Bottomley
2013-11-18 1:15 ` John David Anglin
2013-11-18 1:50 ` James Bottomley
2013-11-18 1:03 ` John David Anglin
2013-11-18 10:54 ` Simon Baatz
2013-11-18 11:24 ` Aw: " Helge Deller
2013-11-16 22:06 ` James Bottomley
2013-11-16 22:32 ` John David Anglin
2013-11-16 22:37 ` James Bottomley
2013-11-16 22:49 ` John David Anglin
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=20131115220529.GA3160@ls3530.box \
--to=deller@gmx.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=bcrl@kvack.org \
--cc=linux-aio@kvack.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
/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