From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 538E7C433E0 for ; Mon, 18 Jan 2021 09:58:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D67202245C for ; Mon, 18 Jan 2021 09:58:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D67202245C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 307E28D000E; Mon, 18 Jan 2021 04:58:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B82B8D0002; Mon, 18 Jan 2021 04:58:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1808F8D000E; Mon, 18 Jan 2021 04:58:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id E7E008D0002 for ; Mon, 18 Jan 2021 04:58:14 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A4AD61804308F for ; Mon, 18 Jan 2021 09:58:14 +0000 (UTC) X-FDA: 77718445308.03.linen53_410970127548 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 8946128A4E9 for ; Mon, 18 Jan 2021 09:58:14 +0000 (UTC) X-HE-Tag: linen53_410970127548 X-Filterd-Recvd-Size: 3581 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Mon, 18 Jan 2021 09:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610963893; 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=KnKUnjqErniwYDMYTq1eIm9rgV9AkPDbych8r491pKyEVCDIUrC5/+/eq6trZbeP8ZMVzi 8qFV8nfKpbSxCcnkNHbJnIQcoujOOSlv1ylfecpOgDqs6+DFOHK1j2KQdUoToN3/tiTnBT +MA4PF9UL7OMzp1nu05JCmJXYAxQie4= 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 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: 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