linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richardw.yang@linux.intel.com>
To: akpm@linux-foundation.org, aarcange@redhat.com, hughd@google.com,
	mike.kravetz@oracle.com
Cc: linux-mm@kvack.org, Wei Yang <richardw.yang@linux.intel.com>
Subject: [PATCH v2 2/3] userfaultfd: remove unnecessary warn_on in __mcopy_atomic_hugetlb
Date: Fri, 27 Sep 2019 15:00:31 +0800	[thread overview]
Message-ID: <20190927070032.2129-2-richardw.yang@linux.intel.com> (raw)
In-Reply-To: <20190927070032.2129-1-richardw.yang@linux.intel.com>

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 warning will never be triggered.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>

---
v2:
  * remove another related warning as suggested by Mike Kravetz
---
 mm/userfaultfd.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 01ad48621bb7..df11743f2196 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.
 	 */
@@ -262,7 +258,6 @@ static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm,
 		pte_t dst_pteval;
 
 		BUG_ON(dst_addr >= dst_start + len);
-		VM_BUG_ON(dst_addr & (vma_hpagesize - 1));
 
 		/*
 		 * Serialize via hugetlb_fault_mutex
-- 
2.17.1



  reply	other threads:[~2019-09-27  7:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27  7:00 [PATCH v2 1/3] userfaultfd: use vma_pagesize for all huge page size calculation Wei Yang
2019-09-27  7:00 ` Wei Yang [this message]
2019-09-27  7:00 ` [PATCH v2 3/3] userfaultfd: wrap the common dst_vma check into an inlined function Wei Yang
2019-09-27 22:10 ` [PATCH v2 1/3] userfaultfd: use vma_pagesize for all huge page size calculation Andrew Morton
2019-09-27 22:21   ` Mike Kravetz
2019-10-05  0:34     ` Wei Yang
2019-09-29  0:45   ` Wei Yang
2019-10-07 22:55     ` Mike Kravetz
2019-10-08  0:57       ` Wei Yang
2019-10-05  0:33   ` [PATCH] hugetlb: remove unused hstate in hugetlb_fault_mutex_hash() Wei Yang
2019-10-05  5:42     ` kbuild test robot
2019-10-05  5:43     ` kbuild test robot
2019-10-06  2:25     ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190927070032.2129-2-richardw.yang@linux.intel.com \
    --to=richardw.yang@linux.intel.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).