[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220127085608.306306-3-rppt@kernel.org>
Date: Thu, 27 Jan 2022 10:56:07 +0200
From: Mike Rapoport <rppt@...nel.org>
To: linux-mm@...ck.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Andy Lutomirski <luto@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ira Weiny <ira.weiny@...el.com>,
Kees Cook <keescook@...omium.org>,
Mike Rapoport <rppt@...nel.org>,
Mike Rapoport <rppt@...ux.ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
Rick Edgecombe <rick.p.edgecombe@...el.com>,
Vlastimil Babka <vbabka@...e.cz>, linux-kernel@...r.kernel.org,
x86@...nel.org
Subject: [RFC PATCH 2/3] mm/secretmem: use __GFP_UNMAPPED to allocate pages
From: Mike Rapoport <rppt@...ux.ibm.com>
Currently secertmem explicitly removes allocated pages from the direct map.
This fragments direct map because allocated pages may reside in different
pageblocks.
Use __GFP_UNMAPPED to utilize caching of unmapped pages done by the page
allocator.
Signed-off-by: Mike Rapoport <rppt@...ux.ibm.com>
---
mm/secretmem.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/mm/secretmem.c b/mm/secretmem.c
index 22b310adb53d..878ef004d7a7 100644
--- a/mm/secretmem.c
+++ b/mm/secretmem.c
@@ -63,16 +63,10 @@ static vm_fault_t secretmem_fault(struct vm_fault *vmf)
retry:
page = find_lock_page(mapping, offset);
if (!page) {
- page = alloc_page(gfp | __GFP_ZERO);
+ page = alloc_page(gfp | __GFP_ZERO | __GFP_UNMAPPED);
if (!page)
return VM_FAULT_OOM;
- err = set_direct_map_invalid_noflush(page);
- if (err) {
- put_page(page);
- return vmf_error(err);
- }
-
__SetPageUptodate(page);
err = add_to_page_cache_lru(page, mapping, offset, gfp);
if (unlikely(err)) {
--
2.34.1
Powered by blists - more mailing lists