From: Baoquan He <bhe@redhat.com>
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 [thread overview]
Message-ID: <20200720062623.13135-2-bhe@redhat.com> (raw)
In-Reply-To: <20200720062623.13135-1-bhe@redhat.com>
The local variable is for global reservation of region.
Signed-off-by: Baoquan He <bhe@redhat.com>
---
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
next prev parent reply other threads:[~2020-07-20 6:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-20 6:26 [PATCH 0/5] mm/hugetlb: Small cleanup and improvement Baoquan He
2020-07-20 6:26 ` Baoquan He [this message]
2020-07-20 22:32 ` [PATCH 1/5] mm/hugetlb.c: Fix typo of glb_reserve Mike Kravetz
2020-07-21 9:17 ` Baoquan He
2020-07-20 6:26 ` [PATCH 2/5] mm/hugetlb.c: make is_hugetlb_entry_hwpoisoned return bool Baoquan He
2020-07-20 22:34 ` Mike Kravetz
2020-07-21 9:56 ` David Hildenbrand
2020-07-20 6:26 ` [PATCH 3/5] mm/hugetlb.c: Remove the unnecessary non_swap_entry() Baoquan He
2020-07-20 22:44 ` Mike Kravetz
2020-07-21 9:56 ` David Hildenbrand
2020-07-20 6:26 ` [PATCH 4/5] doc/vm: fix typo in in the hugetlb admin documentation Baoquan He
2020-07-20 22:55 ` Mike Kravetz
2020-07-21 9:56 ` David Hildenbrand
2020-07-20 6:26 ` [PATCH 5/5] mm/hugetl.c: warn out if expected count of huge pages adjustment is not achieved Baoquan He
2020-07-21 0:38 ` Mike Kravetz
2020-07-21 9:55 ` Baoquan He
2020-07-22 8:49 ` Baoquan He
2020-07-22 16:15 ` Mike Kravetz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200720062623.13135-2-bhe@redhat.com \
--to=bhe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.