linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mm: remove redundant check non_swap_entry()
@ 2020-06-15 17:54 Ralph Campbell
  2020-06-19 15:11 ` David Hildenbrand
  0 siblings, 1 reply; 2+ messages in thread
From: Ralph Campbell @ 2020-06-15 17:54 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: Jerome Glisse, John Hubbard, Christoph Hellwig, Jason Gunthorpe,
	Andrew Morton, Ralph Campbell

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.

Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
---

This is based on the linux 5.8.0-rc1 tree and is intended for Andrew's mm
tree. There is no rush so it could go into 5.9 but I think it is safe
enough to go into an rc after the patch is reviewed.

Changes since v1:
Updated the change log to be more clear.
Added Jason Gunthorpe's reviewed-by.
Rebased to 5.8.0-rc1

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

diff --git a/mm/memory.c b/mm/memory.c
index dc7f3543b1fd..bdbb4f97e7d0 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1098,7 +1098,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
 		}
 
 		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)) {
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] mm: remove redundant check non_swap_entry()
  2020-06-15 17:54 [PATCH v2] mm: remove redundant check non_swap_entry() Ralph Campbell
@ 2020-06-19 15:11 ` David Hildenbrand
  0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2020-06-19 15:11 UTC (permalink / raw)
  To: Ralph Campbell, linux-mm, linux-kernel
  Cc: Jerome Glisse, John Hubbard, Christoph Hellwig, Jason Gunthorpe,
	Andrew Morton

On 15.06.20 19:54, Ralph Campbell wrote:
> 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.
> 
> Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
> ---
> 
> This is based on the linux 5.8.0-rc1 tree and is intended for Andrew's mm
> tree. There is no rush so it could go into 5.9 but I think it is safe
> enough to go into an rc after the patch is reviewed.
> 
> Changes since v1:
> Updated the change log to be more clear.
> Added Jason Gunthorpe's reviewed-by.
> Rebased to 5.8.0-rc1
> 
>  mm/memory.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index dc7f3543b1fd..bdbb4f97e7d0 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1098,7 +1098,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
>  		}
>  
>  		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)) {
> 

Looks like 5.9 material. LGTM

Acked-by: David Hildenbrand <david@redhat.com>


-- 
Thanks,

David / dhildenb



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-19 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 17:54 [PATCH v2] mm: remove redundant check non_swap_entry() Ralph Campbell
2020-06-19 15:11 ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).