linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: roy.qing.li@gmail.com
To: cgroups@vger.kernel.org, linux-mm@kvack.org
Cc: hannes@cmpxchg.org, mhocko@kernel.org, vdavydov@virtuozzo.com
Subject: [PATCH][RFC] mm: memcontrol: fix a unbalance uncharged count
Date: Tue, 31 May 2016 17:38:32 +0800	[thread overview]
Message-ID: <1464687512-10695-1-git-send-email-roy.qing.li@gmail.com> (raw)

From: Li RongQing <roy.qing.li@gmail.com>

I see the number of page of hpage_nr_pages(page) is charged if page is
transparent huge or hugetlbfs pages; but when uncharge a huge page,
(1<<compound_order) page is uncharged, and maybe hpage_nr_pages(page) is
not same as 1<<compound_order.

And remove VM_BUG_ON_PAGE(!PageTransHuge(page), page); since
PageTransHuge(page) always is true, when this VM_BUG_ON_PAGE is called.

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 mm/memcontrol.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 12aaadd..28c0137 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5453,8 +5453,7 @@ static void uncharge_list(struct list_head *page_list)
 		}
 
 		if (PageTransHuge(page)) {
-			nr_pages <<= compound_order(page);
-			VM_BUG_ON_PAGE(!PageTransHuge(page), page);
+			nr_pages = hpage_nr_pages(page);
 			nr_huge += nr_pages;
 		}
 
-- 
2.1.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2016-05-31  9:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31  9:38 roy.qing.li [this message]
2016-05-31  9:50 ` Michal Hocko

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=1464687512-10695-1-git-send-email-roy.qing.li@gmail.com \
    --to=roy.qing.li@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=vdavydov@virtuozzo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox