From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754227Ab3C2F1I (ORCPT ); Fri, 29 Mar 2013 01:27:08 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:45295 "EHLO e23smtp03.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892Ab3C2F1F (ORCPT ); Fri, 29 Mar 2013 01:27:05 -0400 From: "Aneesh Kumar K.V" To: Michal Hocko Cc: Naoya Horiguchi , linux-mm@kvack.org, Andrew Morton , Mel Gorman , Hugh Dickins , KOSAKI Motohiro , Andi Kleen , Hillf Danton , linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/10] soft-offline: use migrate_pages() instead of migrate_huge_page() In-Reply-To: <20130327135250.GI16579@dhcp22.suse.cz> References: <1363983835-20184-1-git-send-email-n-horiguchi@ah.jp.nec.com> <1363983835-20184-4-git-send-email-n-horiguchi@ah.jp.nec.com> <87boa69z6j.fsf@linux.vnet.ibm.com> <20130327135250.GI16579@dhcp22.suse.cz> User-Agent: Notmuch/0.15.1+22~gc34effa (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu) Date: Fri, 29 Mar 2013 10:56:00 +0530 Message-ID: <87li967p5j.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain x-cbid: 13032905-6102-0000-0000-0000033BF7FC Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michal Hocko writes: > On Tue 26-03-13 16:59:40, Aneesh Kumar K.V wrote: >> Naoya Horiguchi writes: > [...] >> > diff --git v3.9-rc3.orig/mm/memory-failure.c v3.9-rc3/mm/memory-failure.c >> > index df0694c..4e01082 100644 >> > --- v3.9-rc3.orig/mm/memory-failure.c >> > +++ v3.9-rc3/mm/memory-failure.c >> > @@ -1467,6 +1467,7 @@ static int soft_offline_huge_page(struct page *page, int flags) >> > int ret; >> > unsigned long pfn = page_to_pfn(page); >> > struct page *hpage = compound_head(page); >> > + LIST_HEAD(pagelist); >> > >> > /* >> > * This double-check of PageHWPoison is to avoid the race with >> > @@ -1482,12 +1483,20 @@ static int soft_offline_huge_page(struct page *page, int flags) >> > unlock_page(hpage); >> > >> > /* Keep page count to indicate a given hugepage is isolated. */ >> > - ret = migrate_huge_page(hpage, new_page, MPOL_MF_MOVE_ALL, >> > - MIGRATE_SYNC); >> > - put_page(hpage); >> > + list_move(&hpage->lru, &pagelist); >> >> we use hpage->lru to add the hpage to h->hugepage_activelist. This will >> break a hugetlb cgroup removal isn't it ? > > This particular part will not break removal because > hugetlb_cgroup_css_offline loops until hugetlb_cgroup_have_usage is 0. > > 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 -aneesh From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx126.postini.com [74.125.245.126]) by kanga.kvack.org (Postfix) with SMTP id 41F436B0002 for ; Fri, 29 Mar 2013 01:27:13 -0400 (EDT) Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 29 Mar 2013 15:16:25 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 770B7357804A for ; Fri, 29 Mar 2013 16:27:07 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2T5D2JV57802990 for ; Fri, 29 Mar 2013 16:13:03 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2T5QEp4000649 for ; Fri, 29 Mar 2013 16:26:15 +1100 From: "Aneesh Kumar K.V" Subject: Re: [PATCH 03/10] soft-offline: use migrate_pages() instead of migrate_huge_page() In-Reply-To: <20130327135250.GI16579@dhcp22.suse.cz> References: <1363983835-20184-1-git-send-email-n-horiguchi@ah.jp.nec.com> <1363983835-20184-4-git-send-email-n-horiguchi@ah.jp.nec.com> <87boa69z6j.fsf@linux.vnet.ibm.com> <20130327135250.GI16579@dhcp22.suse.cz> Date: Fri, 29 Mar 2013 10:56:00 +0530 Message-ID: <87li967p5j.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Naoya Horiguchi , linux-mm@kvack.org, Andrew Morton , Mel Gorman , Hugh Dickins , KOSAKI Motohiro , Andi Kleen , Hillf Danton , linux-kernel@vger.kernel.org Michal Hocko writes: > On Tue 26-03-13 16:59:40, Aneesh Kumar K.V wrote: >> Naoya Horiguchi writes: > [...] >> > diff --git v3.9-rc3.orig/mm/memory-failure.c v3.9-rc3/mm/memory-failure.c >> > index df0694c..4e01082 100644 >> > --- v3.9-rc3.orig/mm/memory-failure.c >> > +++ v3.9-rc3/mm/memory-failure.c >> > @@ -1467,6 +1467,7 @@ static int soft_offline_huge_page(struct page *page, int flags) >> > int ret; >> > unsigned long pfn = page_to_pfn(page); >> > struct page *hpage = compound_head(page); >> > + LIST_HEAD(pagelist); >> > >> > /* >> > * This double-check of PageHWPoison is to avoid the race with >> > @@ -1482,12 +1483,20 @@ static int soft_offline_huge_page(struct page *page, int flags) >> > unlock_page(hpage); >> > >> > /* Keep page count to indicate a given hugepage is isolated. */ >> > - ret = migrate_huge_page(hpage, new_page, MPOL_MF_MOVE_ALL, >> > - MIGRATE_SYNC); >> > - put_page(hpage); >> > + list_move(&hpage->lru, &pagelist); >> >> we use hpage->lru to add the hpage to h->hugepage_activelist. This will >> break a hugetlb cgroup removal isn't it ? > > This particular part will not break removal because > hugetlb_cgroup_css_offline loops until hugetlb_cgroup_have_usage is 0. > > 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 -aneesh -- 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: email@kvack.org