From patchwork Wed May 25 10:26:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 12860945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCD20C433F5 for ; Wed, 25 May 2022 10:26:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6918B8D0003; Wed, 25 May 2022 06:26:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 640C78D0001; Wed, 25 May 2022 06:26:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 555F38D0003; Wed, 25 May 2022 06:26:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4856F8D0001 for ; Wed, 25 May 2022 06:26:38 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 234E6107A for ; Wed, 25 May 2022 10:26:38 +0000 (UTC) X-FDA: 79503886476.29.E56BEA5 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by imf12.hostedemail.com (Postfix) with ESMTP id 1DFB640031 for ; Wed, 25 May 2022 10:26:00 +0000 (UTC) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04357;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VENAbeB_1653474392; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VENAbeB_1653474392) by smtp.aliyun-inc.com(127.0.0.1); Wed, 25 May 2022 18:26:33 +0800 From: Baolin Wang To: mike.kravetz@oracle.com, akpm@linux-foundation.org, songmuchun@bytedance.com Cc: baolin.wang@linux.alibaba.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH] mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte() Date: Wed, 25 May 2022 18:26:24 +0800 Message-Id: <7cd55152c1a00910afda570d1543a97198b3665b.1653468078.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.131 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com X-Rspam-User: X-Stat-Signature: 3x341fqe6wjuwmxgur16suucc8wrh53x X-Rspamd-Queue-Id: 1DFB640031 X-Rspamd-Server: rspam01 X-HE-Tag: 1653474360-190744 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: There is no need to update the hugetlb access flags after just setting the hugetlb page table entry by set_huge_pte_at(), since the page table entry value has no changes. Thus remove the unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte(). Signed-off-by: Baolin Wang Reviewed-by: Muchun Song Reviewed-by: Mike Kravetz Reviewed-by: Anshuman Khandual --- mm/hugetlb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 7c468ac..3ad49bf 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6032,8 +6032,6 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, set_huge_pte_at(dst_mm, dst_addr, dst_pte, _dst_pte); - (void)huge_ptep_set_access_flags(dst_vma, dst_addr, dst_pte, _dst_pte, - dst_vma->vm_flags & VM_WRITE); hugetlb_count_add(pages_per_huge_page(h), dst_mm); /* No need to invalidate - it was non-present before */