Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1517292ybh; Sun, 19 Jul 2020 23:30:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHs6f48I08jQ3nl8vOnA59MTSxaDURlkkqJuvDXsG/ttrFAxDwrJVORHYOwKCHszkqHEvJ X-Received: by 2002:aa7:db06:: with SMTP id t6mr20290180eds.369.1595226648346; Sun, 19 Jul 2020 23:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595226648; cv=none; d=google.com; s=arc-20160816; b=qAmRCENgeII88Xb1SO+N7ocd+FKa/KMMi5/n6J5tKi10eLTrzWCAjerC2WtSazl2aA Z4JPMmzVKTBpCYPk9JMjnG0/DZnt5yAtLehnD1UriHh4gqyp/lB2CyIU+e1Hc6U64Mhm NNbzTG9dclnsN4Q0f4SKH2nvWA7BqZLS2q7wpm0TdEbvPzj/6jWlRTPC74BuQnVvwN/b Dcuiw0obYqluGs9jRGv83OLShM7j0dDsLnCkBlPGvlUYKVRnJAW86tl7tFEt22tFJoX4 4ngcuC9WlD/1jjrUovhfcA5Kse+e6TMAIrGh+ddEE5a+8rWvOiX7aODmfPwTkmaGjFzG MGgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Zyt3oU1PwvKyyQwBguqx/PgkPJhshO7+egL1SG4muyY=; b=cdg+IreLvqoOj/EsHL/w2zvwMN+SeCLq1NoPTrzpcFLIv4rOscnTSnI7nPwexOBR3v i3adTI+0T2rgl/c5fiN0NwC1CSfOAapYfOYDT/mfd5rfShqgUjODnLZRdb1FoStmks8L IbWmTCQ2BgRHy/P8Whf6UMIhVbvHG/o5sKf6g72xEZxosYmJwTj++bPMr8QjQ0tzy/E9 tqP3MTuCLC3X1zscsslPqyrBYjOjqaI2auQKbcE4hbcmpVH4+7GGmoF+jJsk8KzKs7zi geSXyXyxdNX+nT5lk8eIJNqoDLLS6JiPkWVWLtLlrhUcIuzMq1tXKazX6M0HbVznWbRd oZyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="K+1F/opQ"; 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 r6si9423678ejd.213.2020.07.19.23.30.25; Sun, 19 Jul 2020 23:30:48 -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="K+1F/opQ"; 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 S1726996AbgGTG0h (ORCPT + 99 others); Mon, 20 Jul 2020 02:26:37 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:57573 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725805AbgGTG0g (ORCPT ); Mon, 20 Jul 2020 02:26:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595226395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=Zyt3oU1PwvKyyQwBguqx/PgkPJhshO7+egL1SG4muyY=; b=K+1F/opQGiWAl6TncOlxcNAdUkNDrUhDmGMVLLiiarRJQh0Cuv5SfWIvZktmW22ZOp/n2x saxi8A0epaiMtATgMv05//B0f3zecKmQ1Aea34EyB4wji53K5t2Pi5BH5GT7prxm2vWzoi yEmThlOi7UIW60ewu4CkTfuyxHc3k+Q= 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-34-xk7XVNNwOJG2WQNrkNYSjw-1; Mon, 20 Jul 2020 02:26:30 -0400 X-MC-Unique: xk7XVNNwOJG2WQNrkNYSjw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8D01E107ACCA; Mon, 20 Jul 2020 06:26:29 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-150.pek2.redhat.com [10.72.12.150]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7AF37852B; Mon, 20 Jul 2020 06:26:27 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, mike.kravetz@oracle.com, akpm@linux-foundation.org, bhe@redhat.com Subject: [PATCH 1/5] mm/hugetlb.c: Fix typo of glb_reserve Date: Mon, 20 Jul 2020 14:26:19 +0800 Message-Id: <20200720062623.13135-2-bhe@redhat.com> In-Reply-To: <20200720062623.13135-1-bhe@redhat.com> References: <20200720062623.13135-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The local variable is for global reservation of region. Signed-off-by: Baoquan He --- mm/hugetlb.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f24acb3af741..191a585bb315 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3649,7 +3649,7 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma) struct resv_map *resv = vma_resv_map(vma); struct hugepage_subpool *spool = subpool_vma(vma); unsigned long reserve, start, end; - long gbl_reserve; + long glb_reserve; if (!resv || !is_vma_resv_set(vma, HPAGE_RESV_OWNER)) return; @@ -3664,8 +3664,8 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma) * Decrement reserve counts. The global reserve count may be * adjusted if the subpool has a minimum size. */ - gbl_reserve = hugepage_subpool_put_pages(spool, reserve); - hugetlb_acct_memory(h, -gbl_reserve); + glb_reserve = hugepage_subpool_put_pages(spool, reserve); + hugetlb_acct_memory(h, -glb_reserve); } kref_put(&resv->refs, resv_map_release); @@ -5054,7 +5054,7 @@ int hugetlb_reserve_pages(struct inode *inode, struct hugepage_subpool *spool = subpool_inode(inode); struct resv_map *resv_map; struct hugetlb_cgroup *h_cg = NULL; - long gbl_reserve, regions_needed = 0; + long glb_reserve, regions_needed = 0; /* This should never happen */ if (from > to) { @@ -5121,10 +5121,10 @@ int hugetlb_reserve_pages(struct inode *inode, /* * There must be enough pages in the subpool for the mapping. If * the subpool has a minimum size, there may be some global - * reservations already in place (gbl_reserve). + * reservations already in place (glb_reserve). */ - gbl_reserve = hugepage_subpool_get_pages(spool, chg); - if (gbl_reserve < 0) { + glb_reserve = hugepage_subpool_get_pages(spool, chg); + if (glb_reserve < 0) { ret = -ENOSPC; goto out_uncharge_cgroup; } @@ -5133,7 +5133,7 @@ int hugetlb_reserve_pages(struct inode *inode, * Check enough hugepages are available for the reservation. * Hand the pages back to the subpool if there are not */ - ret = hugetlb_acct_memory(h, gbl_reserve); + ret = hugetlb_acct_memory(h, glb_reserve); if (ret < 0) { goto out_put_pages; } @@ -5153,7 +5153,7 @@ int hugetlb_reserve_pages(struct inode *inode, add = region_add(resv_map, from, to, regions_needed, h, h_cg); if (unlikely(add < 0)) { - hugetlb_acct_memory(h, -gbl_reserve); + hugetlb_acct_memory(h, -glb_reserve); goto out_put_pages; } else if (unlikely(chg > add)) { /* @@ -5200,7 +5200,7 @@ long hugetlb_unreserve_pages(struct inode *inode, long start, long end, struct resv_map *resv_map = inode_resv_map(inode); long chg = 0; struct hugepage_subpool *spool = subpool_inode(inode); - long gbl_reserve; + long glb_reserve; /* * Since this routine can be called in the evict inode path for all @@ -5225,8 +5225,8 @@ long hugetlb_unreserve_pages(struct inode *inode, long start, long end, * If the subpool has a minimum size, the number of global * reservations to be released may be adjusted. */ - gbl_reserve = hugepage_subpool_put_pages(spool, (chg - freed)); - hugetlb_acct_memory(h, -gbl_reserve); + glb_reserve = hugepage_subpool_put_pages(spool, (chg - freed)); + hugetlb_acct_memory(h, -glb_reserve); return 0; } -- 2.17.2