All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 146/158] userfaultfd: remove unnecessary WARN_ON() in __mcopy_atomic_hugetlb()
@ 2019-12-01  1:57 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2019-12-01  1:57 UTC (permalink / raw)
  To: aarcange, akpm, hughd, linux-mm, mike.kravetz, mm-commits,
	richardw.yang, torvalds

From: Wei Yang <richardw.yang@linux.intel.com>
Subject: userfaultfd: remove unnecessary WARN_ON() in __mcopy_atomic_hugetlb()

These 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 these warnings will never be triggered.

Link: http://lkml.kernel.org/r/20190927070032.2129-2-richardw.yang@linux.intel.com
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/userfaultfd.c |    5 -----
 1 file changed, 5 deletions(-)

--- a/mm/userfaultfd.c~userfaultfd-remove-unnecessary-warn_on-in-__mcopy_atomic_hugetlb
+++ a/mm/userfaultfd.c
@@ -242,10 +242,6 @@ retry:
 		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.
 	 */
@@ -259,7 +255,6 @@ retry:
 		pte_t dst_pteval;
 
 		BUG_ON(dst_addr >= dst_start + len);
-		VM_BUG_ON(dst_addr & (vma_hpagesize - 1));
 
 		/*
 		 * Serialize via hugetlb_fault_mutex
_


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-01  1:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-01  1:57 [patch 146/158] userfaultfd: remove unnecessary WARN_ON() in __mcopy_atomic_hugetlb() akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.