linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] userfaultfd: remove one unnecessary warn_on in __mcopy_atomic_hugetlb
@ 2019-09-25 12:18 Wei Yang
  2019-09-25 12:18 ` [PATCH 2/2] userfaultfd: wrap the common dst_vma check into an inlined function Wei Yang
  2019-09-25 17:44 ` [PATCH 1/2] userfaultfd: remove one unnecessary warn_on in __mcopy_atomic_hugetlb Mike Kravetz
  0 siblings, 2 replies; 7+ messages in thread
From: Wei Yang @ 2019-09-25 12:18 UTC (permalink / raw)
  To: akpm, aarcange, hughd; +Cc: linux-mm, Wei Yang

The warning here is to make sure address(dst_addr) and length(len -
copied) are huge page size aligned.

While this is ensured by:

    dst_start and len is huge page size aligned
    dst_addr equals to dst_start and increase huge page size each time
    copied increase huge page size each time

This means this warning will never be triggered.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 mm/userfaultfd.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index c7ae74ce5ff3..7895c715000e 100644
--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -243,10 +243,6 @@ static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm,
 		vm_shared = dst_vma->vm_flags & VM_SHARED;
 	}
 
-	if (WARN_ON(dst_addr & (vma_hpagesize - 1) ||
-		    (len - copied) & (vma_hpagesize - 1)))
-		goto out_unlock;
-
 	/*
 	 * If not shared, ensure the dst_vma has a anon_vma.
 	 */
-- 
2.17.1



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

end of thread, other threads:[~2019-09-26 17:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 12:18 [PATCH 1/2] userfaultfd: remove one unnecessary warn_on in __mcopy_atomic_hugetlb Wei Yang
2019-09-25 12:18 ` [PATCH 2/2] userfaultfd: wrap the common dst_vma check into an inlined function Wei Yang
2019-09-25 17:44 ` [PATCH 1/2] userfaultfd: remove one unnecessary warn_on in __mcopy_atomic_hugetlb Mike Kravetz
2019-09-26  0:35   ` Wei Yang
2019-09-26  2:10     ` Mike Kravetz
2019-09-26  2:56       ` Wei Yang
2019-09-26 17:20         ` Mike Kravetz

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