[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180926210856.7895-5-josef@toxicpanda.com>
Date: Wed, 26 Sep 2018 17:08:51 -0400
From: Josef Bacik <josef@...icpanda.com>
To: kernel-team@...com, linux-kernel@...r.kernel.org,
hannes@...xchg.org, tj@...nel.org, linux-fsdevel@...r.kernel.org,
akpm@...ux-foundation.org, riel@...hat.com, linux-mm@...ck.org,
linux-btrfs@...r.kernel.org
Cc: Johannes Weiner <jweiner@...com>
Subject: [PATCH 4/9] mm: drop mmap_sem for swap read IO submission
From: Johannes Weiner <jweiner@...com>
We don't need to hold the mmap_sem while we're doing the IO, simply drop
it and retry appropriately.
Signed-off-by: Johannes Weiner <jweiner@...com>
Signed-off-by: Josef Bacik <josef@...icpanda.com>
---
mm/page_io.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/mm/page_io.c b/mm/page_io.c
index aafd19ec1db4..bf21b56a964e 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -365,6 +365,20 @@ int swap_readpage(struct page *page, bool synchronous)
goto out;
}
+ /*
+ * XXX:
+ *
+ * Propagate mm->mmap_sem into this function. Then:
+ *
+ * get_file(sis->swap_file)
+ * up_read(mm->mmap_sem)
+ * submit io request
+ * fput
+ *
+ * After mmap_sem is dropped, sis is no longer valid. Go
+ * through swap_file->blah->bdev.
+ */
+
if (sis->flags & SWP_FILE) {
struct file *swap_file = sis->swap_file;
struct address_space *mapping = swap_file->f_mapping;
--
2.14.3
Powered by blists - more mailing lists