lkml.org 
[lkml]   [2021]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC v2 26/43] mm: shmem: specify the mm to use when inserting pages
Date
Explicitly specify the mm to pass to shmem_insert_page() when
the pkram_stream is initialized rather than use the mm of the
current thread. This will allow for multiple kernel threads to
target the same mm when inserting pages in parallel.

Signed-off-by: Anthony Yznaga <anthony.yznaga@oracle.com>
---
mm/shmem_pkram.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/shmem_pkram.c b/mm/shmem_pkram.c
index 904b1b861ce5..8682b0c002c0 100644
--- a/mm/shmem_pkram.c
+++ b/mm/shmem_pkram.c
@@ -225,7 +225,7 @@ int shmem_save_pkram(struct super_block *sb)
return err;
}

-static int load_file_content(struct pkram_stream *ps, struct address_space *mapping)
+static int load_file_content(struct pkram_stream *ps, struct address_space *mapping, struct mm_struct *mm)
{
PKRAM_ACCESS(pa, ps, pages);
unsigned long index;
@@ -237,7 +237,7 @@ static int load_file_content(struct pkram_stream *ps, struct address_space *mapp
if (!page)
break;

- err = shmem_insert_page(current->mm, mapping->host, index, page);
+ err = shmem_insert_page(mm, mapping->host, index, page);
put_page(page);
cond_resched();
} while (!err);
@@ -291,7 +291,7 @@ static int load_file(struct dentry *parent, struct pkram_stream *ps,
inode->i_ctime = ns_to_timespec64(hdr.ctime);
i_size_write(inode, hdr.size);

- err = load_file_content(ps, inode->i_mapping);
+ err = load_file_content(ps, inode->i_mapping, current->mm);
out_unlock:
inode_unlock(d_inode(parent));
out:
--
1.8.3.1
\
 
 \ /
  Last update: 2021-03-30 23:29    [W:0.203 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site