From patchwork Fri Sep 27 07:00:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 11163881 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF06676 for ; Fri, 27 Sep 2019 07:01:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AC7DC2190F for ; Fri, 27 Sep 2019 07:01:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC7DC2190F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 120BA6B0006; Fri, 27 Sep 2019 03:01:03 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0D1EF6B0007; Fri, 27 Sep 2019 03:01:03 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDB6B6B0008; Fri, 27 Sep 2019 03:01:02 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id C7BF86B0006 for ; Fri, 27 Sep 2019 03:01:02 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 6334140E8 for ; Fri, 27 Sep 2019 07:01:02 +0000 (UTC) X-FDA: 75979803564.13.neck75_60500e91c405e X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,richardw.yang@linux.intel.com,:akpm@linux-foundation.org:aarcange@redhat.com:hughd@google.com:mike.kravetz@oracle.com::richardw.yang@linux.intel.com,RULES_HIT:30003:30054,0,RBL:192.55.52.120:@linux.intel.com:.lbl8.mailshell.net-62.18.0.100 64.95.201.95,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:26,LUA_SUMMARY:none X-HE-Tag: neck75_60500e91c405e X-Filterd-Recvd-Size: 2561 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Sep 2019 07:01:01 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2019 00:01:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,554,1559545200"; d="scan'208";a="389874313" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga005.fm.intel.com with ESMTP; 27 Sep 2019 00:00:58 -0700 From: Wei Yang To: akpm@linux-foundation.org, aarcange@redhat.com, hughd@google.com, mike.kravetz@oracle.com Cc: linux-mm@kvack.org, Wei Yang Subject: [PATCH v2 2/3] userfaultfd: remove unnecessary warn_on in __mcopy_atomic_hugetlb Date: Fri, 27 Sep 2019 15:00:31 +0800 Message-Id: <20190927070032.2129-2-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190927070032.2129-1-richardw.yang@linux.intel.com> References: <20190927070032.2129-1-richardw.yang@linux.intel.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- 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