Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2071184pxa; Fri, 7 Aug 2020 02:17:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwifgN4JQauUSx3AI2UUS/f/Lm5wUvfaknSzOlzEGM7EULD1Mj1IvW/DtTmwQKlibfEsndh X-Received: by 2002:a17:906:bb0e:: with SMTP id jz14mr1589105ejb.525.1596791834157; Fri, 07 Aug 2020 02:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596791834; cv=none; d=google.com; s=arc-20160816; b=vTK9u8VPeQMBnCEnlHjBUI9I0DFBYpQ8CW0PAmtTlbB+M4PwOwBVSEEkyKFNeMqj5y U0diDbsvxEmp5Xo35Vh0y0x3+lrQ//N8SCZDL/Qva9cqD+ZZsmRnbJWv+8hmZKEfgMEJ GmV3DsHa74URYDWi2hyF9q0KyQECrtkUUgGBMSzvyxFf2tTDRf9gH2GgkdsKof02IDkm QgBufg4kH9rRcWV0otwpRznwRrxI0k5/s/La1TR9XreYpUF1S0ZstV025vNW9cL35yRC mlhHYAQ18KkcX2y4Le+1cRppH6ioebNaSRV+9au+R8tOudswm1G0XnGCTCzmD3ISbIas M1EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KYxmpwwQw1K18Lz9K/b68eYpEEqgx412u1tSJknKz50=; b=uiimujVnfzqCcS9gaqzofh/gA5mebvgVT6eIt61NzhUsP+3IXlvAI/15CnzH8sj7Lg sYn5s2uB9sAYKyVeDeTe32vKSdXhDwNdLF4V6Oqf9NIz6Z8fre24jyKW/hzVQyArtU1c R6cJ63MxvpsfgeKTEWaMo06eknXzB/eWjVFYzSYuk57rQpqzz+PN3BomG2+fWhdsv0iw 1YQtpNQ9mfXXsuB0T/FDYvB0GZa2Y1IRKNzlRwe/NOAs4GIAea916dtzuWWUj5CvpJGi oaiqxgnCQUMrT4nl9fvYhWNRYEY4fHp9kHRz8hHqqkmcF7YCy6/x44Gp8QhQA1XaTd7x CBKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si4797380edv.475.2020.08.07.02.16.50; Fri, 07 Aug 2020 02:17:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbgHGJNp (ORCPT + 99 others); Fri, 7 Aug 2020 05:13:45 -0400 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:60383 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727801AbgHGJNV (ORCPT ); Fri, 7 Aug 2020 05:13:21 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07425;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0U5.0C2k_1596791598; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U5.0C2k_1596791598) by smtp.aliyun-inc.com(127.0.0.1); Fri, 07 Aug 2020 17:13:19 +0800 From: Wei Yang To: mike.kravetz@oracle.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 06/10] mm/hugetlb: remove redundant huge_pte_alloc() in hugetlb_fault() Date: Fri, 7 Aug 2020 17:12:47 +0800 Message-Id: <20200807091251.12129-7-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200807091251.12129-1-richard.weiyang@linux.alibaba.com> References: <20200807091251.12129-1-richard.weiyang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Before proper processing, huge_pte_alloc() would be called un-conditionally. It is not necessary to do this when ptep is NULL. Signed-off-by: Wei Yang --- mm/hugetlb.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f5f04e89000d..fb09e5a83c39 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4534,10 +4534,6 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, } else if (unlikely(is_hugetlb_entry_hwpoisoned(entry))) return VM_FAULT_HWPOISON_LARGE | VM_FAULT_SET_HINDEX(hstate_index(h)); - } else { - ptep = huge_pte_alloc(mm, haddr, huge_page_size(h)); - if (!ptep) - return VM_FAULT_OOM; } /* -- 2.20.1 (Apple Git-117)