From patchwork Mon Jul 20 06:26:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 11672911 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF2FE1392 for ; Mon, 20 Jul 2020 06:26:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7C59321775 for ; Mon, 20 Jul 2020 06:26:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iOQUzJ97" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C59321775 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 D5F8C6B0003; Mon, 20 Jul 2020 02:26:34 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CC7456B0007; Mon, 20 Jul 2020 02:26:34 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B8FEA8D0001; Mon, 20 Jul 2020 02:26:34 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0067.hostedemail.com [216.40.44.67]) by kanga.kvack.org (Postfix) with ESMTP id 976796B0003 for ; Mon, 20 Jul 2020 02:26:34 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5AEE18248047 for ; Mon, 20 Jul 2020 06:26:34 +0000 (UTC) X-FDA: 77057470308.21.root54_061539926f22 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 352F1183B30F3 for ; Mon, 20 Jul 2020 06:26:34 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,bhe@redhat.com,,RULES_HIT:30034:30054:30070:30090,0,RBL:205.139.110.61:@redhat.com:.lbl8.mailshell.net-66.10.201.10 62.18.0.100;04yf8uz4od1w1nm4mtqsstgafri3oypa7zi4eq3ezybtomaa8cxbnm1q9j4b394.s3jweyryyjz5p661ry45fe7abxm59943w93d1j8y8e1i9wfa9z6dedxbyxtt5xe.y-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: root54_061539926f22 X-Filterd-Recvd-Size: 5366 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Jul 2020 06:26:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595226393; 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=iOQUzJ97z6D1Hr24w1Pr0isOEQNTzdwvjl0rsW7ewGcFZ4yoYozuR2k/KsUmeS7S12TVOH 3UxlxG9C8U9XuOZxxNHQhwvu8ZajKq3xLjuaFXGU7ULs3ahmKgT1jSxESg5D0CPquEIIUi Ef9UWsVr5q7CqOhq/3NPgCQZVZoDNq8= 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 X-Rspamd-Queue-Id: 352F1183B30F3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: 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; }