From: Michal Hocko <mhocko@suse.cz>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mel@csn.ul.ie>, Hugh Dickins <hughd@google.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Andi Kleen <andi@firstfloor.org>, Hillf Danton <dhillf@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 03/10] soft-offline: use migrate_pages() instead of migrate_huge_page() (fwd)
Date: Fri, 29 Mar 2013 17:23:51 +0100 [thread overview]
Message-ID: <20130329162337.GA30407@dhcp22.suse.cz> (raw)
Forwarding off-list email
On Fri 29-03-13 18:24:01, Aneesh Kumar K.V wrote:
> Michal Hocko <mhocko@suse.cz> writes:
>
> > On Fri 29-03-13 10:56:00, Aneesh Kumar K.V wrote:
> >> Michal Hocko <mhocko@suse.cz> writes:
> > [...]
> >> > Little bit offtopic:
> >> > Btw. hugetlb migration breaks to charging even before this patchset
> >> > AFAICS. The above put_page should remove the last reference and then it
> >> > will uncharge it but I do not see anything that would charge a new page.
> >> > This is all because regula LRU pages are uncharged when they are
> >> > unmapped. But this a different story not related to this series.
> >>
> >>
> >> But when we call that put_page, we would have alreayd move the cgroup
> >> information to the new page. We have
> >>
> >> h_cg = hugetlb_cgroup_from_page(oldhpage);
> >> set_hugetlb_cgroup(oldhpage, NULL);
> >>
> >> /* move the h_cg details to new cgroup */
> >> set_hugetlb_cgroup(newhpage, h_cg);
> >>
> >>
> >> in hugetlb_cgroup_migrate
> >
> > Yes but the res counter charge would be missing for the newpage after
> > put_page
> >
>
> Moving this to private as i didn't get what you meant here.
>
> We unchage hugepage via
>
> __put_compound_page -> free_huge_page -> hugetlb_cgroup_uncharge_page
>
> That does
>
> h_cg = hugetlb_cgroup_from_page(page);
> if (unlikely(!h_cg))
> return;
>
> During migrate we do
> set_hugetlb_cgroup(oldhpage, NULL);
>
> /* move the h_cg details to new cgroup */
> set_hugetlb_cgroup(newhpage, h_cg);
>
> So when we do a put_page(oldhpage), we won't be finding any cgroup
> attached to it and hence won't be updating the cgroup res counter value.
>
> So not sure what you mean by res counter change would be missing for the
> newpage after put_page. I may be missing something here. Can you explain
> ?
Dang! You are right of course. I have missed the !h_cg check in
hugetlb_cgroup_uncharge_page.
Sorry about the confusion. I am so distracted by many issues these
days...
Thanks!
--
Michal Hocko
SUSE Labs
--
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:[~2013-03-29 16:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20130329162337.GA30407@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=dhillf@gmail.com \
--cc=hughd@google.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=n-horiguchi@ah.jp.nec.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;
as well as URLs for NNTP newsgroup(s).