Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2292282pxb; Mon, 18 Jan 2021 13:43:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJynoqxtKa80qTyBJj1wPw68UtuDDh/etJzAQK7HdhrV33Y2NSqDATo4vJL3MUUMBEBBpHar X-Received: by 2002:a05:6402:4389:: with SMTP id o9mr1084342edc.164.1611006203973; Mon, 18 Jan 2021 13:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611006203; cv=none; d=google.com; s=arc-20160816; b=n/zSG+5j3Lb3wMl2CsDnqCsHGf4Yt+Gtzu3HzlK37H+YvkjuCPLHov9ZYlJOeMvN7A fLLJpIjgMmVclRvjxJiO0z6uYUju4L7A21gxgyxCJieyNrby3BolBhVtZ3YZxCfs4Nhn NzA04BKhZMeUofhhUd2QxjtK71019gV1sL9htP82xbPgg/XcyZY/DRfUDzvJPwAet7do Gqi5JrgWUXaCcsgArpVUJ1qXQtXOSxQ65EV5mMp83wbsNnXPMYLsp855kU1sePA0jCnf yWtM4Zp8ehOWaprd8smnyPmDUMK7m5AEQyo27pHTbFrDi+/lToQYx19jUr85RmanjEXi eZtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=+kcNifTiiJT73LLmGdVsxYP8+/HWLaO459BHqgyZfYI=; b=ndAWSJvdpOt+RZzjAM6xt3tnr8bYrrfoDRjCBr+gsFKUI0MysSgTiTDCZzi+dphrFI Zf5MvqIpwBUHbIQlXL1w9QSMlZ5scpIh5yn6g5qSbxM7unITl0Wg4J7wHBN4yRDyOXVS ztfNP8xUFxMMyzdBjM8oTVpdDGbuMQNJKxRyVS9h9DCQbZFxmO8h1WfsxaemhDNbxesU +75moyw1T4vX4aaQ/E6Gu3pc4ei/bJtpp2px9uuGQEY3qcyr3VyqYoHjg4hGcI7po/v0 ohs8G1iirLBzwZNaKEOaMqRh7TP/t2xlqhC0QBaBJtHWhs77O1aXol/IFShPMayw4UuE /r8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZWHuXqH6; 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 k13si1602784edk.387.2021.01.18.13.43.00; Mon, 18 Jan 2021 13:43:23 -0800 (PST) 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=ZWHuXqH6; 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 S2438134AbhARVkr (ORCPT + 99 others); Mon, 18 Jan 2021 16:40:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60477 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388730AbhARKAW (ORCPT ); Mon, 18 Jan 2021 05:00:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610963895; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+kcNifTiiJT73LLmGdVsxYP8+/HWLaO459BHqgyZfYI=; b=ZWHuXqH6+klfVlQEYSHFM64Zf10+EwIvk8drGkWanh3g/1b8M/hBQMyuwZ5Hft3ba0saNA DS0+iV6XD1ju21cKwrhwTNh+nsOaiA5cuJR1A4CUHNuOVMU0d84gJctGm5O8QgevsncEk2 eb6US6XGEpAV1jcwWTKJ8FlS7G9pzNg= 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-81-3GIrPRjjN5OKo0sxsfb_aw-1; Mon, 18 Jan 2021 04:58:11 -0500 X-MC-Unique: 3GIrPRjjN5OKo0sxsfb_aw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7454610054FF; Mon, 18 Jan 2021 09:58:10 +0000 (UTC) Received: from [10.36.112.158] (ovpn-112-158.ams2.redhat.com [10.36.112.158]) by smtp.corp.redhat.com (Postfix) with ESMTP id 983135D9CD; Mon, 18 Jan 2021 09:58:09 +0000 (UTC) Subject: Re: [PATCH] hugetlbfs: remove meaningless variable avoid_reserve To: Miaohe Lin , mike.kravetz@oracle.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210116092644.42697-1-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <5076218b-19f2-fdeb-21b7-d5ce1fcabc24@redhat.com> Date: Mon, 18 Jan 2021 10:58:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210116092644.42697-1-linmiaohe@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16.01.21 10:26, Miaohe Lin wrote: > The variable avoid_reserve is meaningless because we never changed its > value and just passed it to alloc_huge_page(). So remove it to make code > more clear that in hugetlbfs_fallocate, we never avoid reserve when alloc > hugepage yet. > > Signed-off-by: Miaohe Lin > --- > fs/hugetlbfs/inode.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c > index 88751e35e69d..23ad6ed8b75f 100644 > --- a/fs/hugetlbfs/inode.c > +++ b/fs/hugetlbfs/inode.c > @@ -680,7 +680,6 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, > */ > struct page *page; > unsigned long addr; > - int avoid_reserve = 0; > > cond_resched(); > > @@ -717,7 +716,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, > } > > /* Allocate page and add to page cache */ > - page = alloc_huge_page(&pseudo_vma, addr, avoid_reserve); > + page = alloc_huge_page(&pseudo_vma, addr, 0); > hugetlb_drop_vma_policy(&pseudo_vma); > if (IS_ERR(page)) { > mutex_unlock(&hugetlb_fault_mutex_table[hash]); > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb