[094/163] mm: remove redundant check non_swap_entry()
diff mbox series

Message ID 20200807062221.EfR5XGPgf%akpm@linux-foundation.org
State New
Headers show
Series
  • [001/163] mm/memory.c: avoid access flag update TLB flush for retried page fault
Related show

Commit Message

Andrew Morton Aug. 7, 2020, 6:22 a.m. UTC
From: Ralph Campbell <rcampbell@nvidia.com>
Subject: mm: remove redundant check non_swap_entry()

In zap_pte_range(), the check for non_swap_entry() and
is_device_private_entry() is unnecessary since the latter is sufficient to
determine if the page is a device private page.  Remove the test for
non_swap_entry() to simplify the code and for clarity.

Link: http://lkml.kernel.org/r/20200615175405.4613-1-rcampbell@nvidia.com
Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

--- a/mm/memory.c~mm-remove-redundant-check-non_swap_entry
+++ a/mm/memory.c
@@ -1098,7 +1098,7 @@  again:
 		}
 
 		entry = pte_to_swp_entry(ptent);
-		if (non_swap_entry(entry) && is_device_private_entry(entry)) {
+		if (is_device_private_entry(entry)) {
 			struct page *page = device_private_entry_to_page(entry);
 
 			if (unlikely(details && details->check_mapping)) {