linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: remove unneeded PageAnon check in restore_exclusive_pte()
@ 2022-07-16  8:18 Miaohe Lin
  2022-07-18 13:03 ` David Hildenbrand
  0 siblings, 1 reply; 2+ messages in thread
From: Miaohe Lin @ 2022-07-16  8:18 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, linmiaohe

When code reaches here, the page must be !PageAnon. There's no need to
check PageAnon again. Remove it.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index f671b2dce1fe..d98f89cee3e9 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -753,7 +753,7 @@ static void restore_exclusive_pte(struct vm_area_struct *vma,
 		 * Currently device exclusive access only supports anonymous
 		 * memory so the entry shouldn't point to a filebacked page.
 		 */
-		WARN_ON_ONCE(!PageAnon(page));
+		WARN_ON_ONCE(1);
 
 	set_pte_at(vma->vm_mm, address, ptep, pte);
 
-- 
2.23.0



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

* Re: [PATCH] mm: remove unneeded PageAnon check in restore_exclusive_pte()
  2022-07-16  8:18 [PATCH] mm: remove unneeded PageAnon check in restore_exclusive_pte() Miaohe Lin
@ 2022-07-18 13:03 ` David Hildenbrand
  0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2022-07-18 13:03 UTC (permalink / raw)
  To: Miaohe Lin, akpm; +Cc: linux-mm, linux-kernel

On 16.07.22 10:18, Miaohe Lin wrote:
> When code reaches here, the page must be !PageAnon. There's no need to
> check PageAnon again. Remove it.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/memory.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index f671b2dce1fe..d98f89cee3e9 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -753,7 +753,7 @@ static void restore_exclusive_pte(struct vm_area_struct *vma,
>  		 * Currently device exclusive access only supports anonymous
>  		 * memory so the entry shouldn't point to a filebacked page.
>  		 */
> -		WARN_ON_ONCE(!PageAnon(page));
> +		WARN_ON_ONCE(1);
>  
>  	set_pte_at(vma->vm_mm, address, ptep, pte);
>  

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

-- 
Thanks,

David / dhildenb



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

end of thread, other threads:[~2022-07-18 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-16  8:18 [PATCH] mm: remove unneeded PageAnon check in restore_exclusive_pte() Miaohe Lin
2022-07-18 13:03 ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox