From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754095Ab3C0TVV (ORCPT ); Wed, 27 Mar 2013 15:21:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59787 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753823Ab3C0TVU (ORCPT ); Wed, 27 Mar 2013 15:21:20 -0400 Date: Wed, 27 Mar 2013 15:19:24 -0400 From: Naoya Horiguchi To: Michal Hocko Cc: "Aneesh Kumar K.V" , linux-mm@kvack.org, Andrew Morton , Mel Gorman , Hugh Dickins , KOSAKI Motohiro , Andi Kleen , Hillf Danton , linux-kernel@vger.kernel.org Message-ID: <1364411964-iukb7m94-mutt-n-horiguchi@ah.jp.nec.com> 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> Subject: Re: [PATCH 03/10] soft-offline: use migrate_pages() instead of migrate_huge_page() Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Mutt-References: <20130327135250.GI16579@dhcp22.suse.cz> X-Mutt-Fcc: ~/Maildir/sent/ User-Agent: Mutt 1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 27, 2013 at 02:52:50PM +0100, Michal Hocko wrote: > 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. Right. > 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. It seems to me that alloc_huge_page_node() needs to call hugetlb_cgroup_charge_cgroup() before dequeuing a new hugepage. Thanks, Naoya From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx196.postini.com [74.125.245.196]) by kanga.kvack.org (Postfix) with SMTP id 4164D6B0002 for ; Wed, 27 Mar 2013 15:19:40 -0400 (EDT) Date: Wed, 27 Mar 2013 15:19:24 -0400 From: Naoya Horiguchi Message-ID: <1364411964-iukb7m94-mutt-n-horiguchi@ah.jp.nec.com> 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> Subject: Re: [PATCH 03/10] soft-offline: use migrate_pages() instead of migrate_huge_page() Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: "Aneesh Kumar K.V" , linux-mm@kvack.org, Andrew Morton , Mel Gorman , Hugh Dickins , KOSAKI Motohiro , Andi Kleen , Hillf Danton , linux-kernel@vger.kernel.org On Wed, Mar 27, 2013 at 02:52:50PM +0100, Michal Hocko wrote: > 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. Right. > 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. It seems to me that alloc_huge_page_node() needs to call hugetlb_cgroup_charge_cgroup() before dequeuing a new hugepage. Thanks, Naoya -- 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