[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230526075552.363524-8-mcgrof@kernel.org>
Date: Fri, 26 May 2023 00:55:51 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: hughd@...gle.com, akpm@...ux-foundation.org, willy@...radead.org,
brauner@...nel.org, djwong@...nel.org
Cc: p.raghav@...sung.com, da.gomez@...sung.com, rohan.puri@...sung.com,
rpuri.linux@...il.com, a.manzanares@...sung.com, dave@...olabs.net,
yosryahmed@...gle.com, keescook@...omium.org, hare@...e.de,
kbusch@...nel.org, mcgrof@...nel.org, patches@...ts.linux.dev,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [RFC v2 7/8] shmem: add high order page support
To support high order block sizes we want to support a high order
folios so to treat the larger block atomically. Add support for this
for tmpfs mounts.
Right now this produces no functional changes since we only allow one
single block size, matching the PAGE_SIZE and so the order is always 0.
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
mm/shmem.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index d347a5ba49f1..080864949fe5 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1623,9 +1623,15 @@ static struct folio *shmem_alloc_folio(gfp_t gfp,
{
struct vm_area_struct pvma;
struct folio *folio;
+ struct inode *inode = &info->vfs_inode;
+ struct super_block *i_sb = inode->i_sb;
+ int order = 0;
+
+ if (!(i_sb->s_flags & SB_KERNMOUNT))
+ order = i_sb->s_blocksize_bits - PAGE_SHIFT;
shmem_pseudo_vma_init(&pvma, info, index);
- folio = vma_alloc_folio(gfp, 0, &pvma, 0, false);
+ folio = vma_alloc_folio(gfp, order, &pvma, 0, false);
shmem_pseudo_vma_destroy(&pvma);
return folio;
--
2.39.2
Powered by blists - more mailing lists