Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2206494pxa; Fri, 7 Aug 2020 06:01:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHr2LyNz6OlWCNzwv3Zv0ySaeDk6+n1GqMZWJzXu+FPmdZ5DyETWHx/G8I4JeYVy6nska2 X-Received: by 2002:a17:906:b015:: with SMTP id v21mr9011250ejy.507.1596805260600; Fri, 07 Aug 2020 06:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596805260; cv=none; d=google.com; s=arc-20160816; b=xKC7EjjWqzPLooQgkSkPt7NA+Zl48+PuR2K7vMnDrsik/Pyb9odj4la4ySoGhMmhSI gw7+gdWwdZbKzmokPX9sqJGqzdT9evEndwxheNxHTSGHLt+Km1/vvzI4nGvcHRf1pJQL KT+8AqI6nUXOJ77H2cQMYpeClDNyr4xT3WMH8PqZwfxWRLk04i6ynO4c7RMYmTuUQoTy TiS9gUHrR721aEr3FVsXEH3Yonx/FPYrd51YF/+1m2367VpHKEANVzRJ3/9AoShYjfwb EOz2Vqrx6O5P3NwWLM9yencapeRj9nyGaCKBJ/vS/Z3GR5gd8GkiN2BmW7182FzM04JQ +txA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EJpiX5twwNq1/bCnTJVgk9REEVNsOlu4rjWGfcA22Ss=; b=WS3uIlf3oFqNwHAsKMuNnwuCfLTQBBkbrSUVPXRnB72wRruIjQuJFTWJ1BocNdtXA/ MNe+kKKj9JqKdqEvOCxNvpfg029NB1Z6s3NVHj0LR6EKN4/JZPQdba7YLQwh5EhicVUb PoLHkgeXXnk+Pl2Sd1+RuIOzuBowzS51QbiC04QD5Gbk/jLvavXn7AeASAhXcYfMZkJT CwmIa3gQ5MQWg2guVu8KMlQEatWKe1+OtZMe4aaYMtpe1c4lQhqu2f2R+CbDmxZEqyIN QglSyw+jd7z9wuAClj0zW3b1Ak1S6bg5I50F7YPWGnS9xluOxTOaOTsHYN1+gveibbvM ZIHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fubWBYGP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fy16si5321077ejb.15.2020.08.07.06.00.36; Fri, 07 Aug 2020 06:01:00 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fubWBYGP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725934AbgHGM7i (ORCPT + 99 others); Fri, 7 Aug 2020 08:59:38 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:43362 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725815AbgHGM7g (ORCPT ); Fri, 7 Aug 2020 08:59:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596805175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EJpiX5twwNq1/bCnTJVgk9REEVNsOlu4rjWGfcA22Ss=; b=fubWBYGPA192st1DKCXeHUOuz0GMo27KdUdl8lzhzLgkFDewyLhPy/EchH035KWVb/Hrz4 3492TDpQO0krAyOP8CIfpp7fc9ringodaxONXfWy3HT81vmnVHDaxOLpOMbw47Jm/G19as 4+U9i/oBLk6hmi6iiFYKcrFAdS81Uek= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-314-MLPTm4m5N8eJSj4s12nLTg-1; Fri, 07 Aug 2020 08:59:33 -0400 X-MC-Unique: MLPTm4m5N8eJSj4s12nLTg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B47B0800486; Fri, 7 Aug 2020 12:59:32 +0000 (UTC) Received: from localhost (ovpn-12-31.pek2.redhat.com [10.72.12.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD7D6756B3; Fri, 7 Aug 2020 12:59:31 +0000 (UTC) Date: Fri, 7 Aug 2020 20:59:28 +0800 From: Baoquan He To: Wei Yang Cc: mike.kravetz@oracle.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/10] mm/hugetlb: remove redundant huge_pte_alloc() in hugetlb_fault() Message-ID: <20200807125928.GQ14854@MiWiFi-R3L-srv> References: <20200807091251.12129-1-richard.weiyang@linux.alibaba.com> <20200807091251.12129-7-richard.weiyang@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200807091251.12129-7-richard.weiyang@linux.alibaba.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/07/20 at 05:12pm, Wei Yang wrote: > 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; Right, seems a relic from Mike's i_mmap_rwsem handling patches. Reviewed-by: Baoquan He > } > > /* > -- > 2.20.1 (Apple Git-117) > >