Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-05-09 Thread Naoya Horiguchi
On Tue, May 09, 2017 at 11:18:23AM +0200, Michal Hocko wrote: > On Mon 08-05-17 02:58:36, Naoya Horiguchi wrote: > > On Tue, May 02, 2017 at 08:55:07PM +0200, Michal Hocko wrote: > > > On Tue 02-05-17 16:59:30, Laurent Dufour wrote: > > > > On 28/04/2017 15:48, Michal Hocko wrote: > > > [...] > > >

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-05-09 Thread Michal Hocko
On Mon 08-05-17 02:58:36, Naoya Horiguchi wrote: > On Tue, May 02, 2017 at 08:55:07PM +0200, Michal Hocko wrote: > > On Tue 02-05-17 16:59:30, Laurent Dufour wrote: > > > On 28/04/2017 15:48, Michal Hocko wrote: > > [...] > > > > This is getting quite hairy. What is the expected page count of the >

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-05-08 Thread Balbir Singh
On Mon, 2017-05-08 at 12:42 +0200, Laurent Dufour wrote: > Sorry Balbir, > > You pointed this out since the beginning but I missed your comment. > My mistake. > No worries, as long as the right thing gets in Balbir Singh

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-05-08 Thread Laurent Dufour
On 04/05/2017 03:21, Balbir Singh wrote: >> @@ -5527,7 +5527,7 @@ static void uncharge_list(struct list_head *page_list) >> next = page->lru.next; >> >> VM_BUG_ON_PAGE(PageLRU(page), page); >> -VM_BUG_ON_PAGE(page_count(page), page); >> +VM_BUG_ON

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-05-07 Thread Naoya Horiguchi
On Tue, May 02, 2017 at 08:55:07PM +0200, Michal Hocko wrote: > On Tue 02-05-17 16:59:30, Laurent Dufour wrote: > > On 28/04/2017 15:48, Michal Hocko wrote: > [...] > > > This is getting quite hairy. What is the expected page count of the > > > hwpoison page? > > OK, so from the quick check of the

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-05-03 Thread Balbir Singh
> @@ -5527,7 +5527,7 @@ static void uncharge_list(struct list_head *page_list) > next = page->lru.next; > > VM_BUG_ON_PAGE(PageLRU(page), page); > - VM_BUG_ON_PAGE(page_count(page), page); > + VM_BUG_ON_PAGE(!PageHWPoison(page) && page_count(pag

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-05-03 Thread Laurent Dufour
On 02/05/2017 20:55, Michal Hocko wrote: > On Tue 02-05-17 16:59:30, Laurent Dufour wrote: >> On 28/04/2017 15:48, Michal Hocko wrote: > [...] >>> This is getting quite hairy. What is the expected page count of the >>> hwpoison page? > > OK, so from the quick check of the hwpoison code it seems th

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-05-02 Thread Michal Hocko
On Tue 02-05-17 16:59:30, Laurent Dufour wrote: > On 28/04/2017 15:48, Michal Hocko wrote: [...] > > This is getting quite hairy. What is the expected page count of the > > hwpoison page? OK, so from the quick check of the hwpoison code it seems that the ref count will be > 1 (from get_hwpoison_pa

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-05-02 Thread Laurent Dufour
On 28/04/2017 15:48, Michal Hocko wrote: > On Fri 28-04-17 11:17:34, Laurent Dufour wrote: >> On 28/04/2017 09:31, Michal Hocko wrote: >>> [CC Johannes and Vladimir - the patch is >>> http://lkml.kernel.org/r/1493130472-22843-2-git-send-email-lduf...@linux.vnet.ibm.com] >>> >>> On Fri 28-04-17 08:0

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-28 Thread Michal Hocko
On Fri 28-04-17 11:17:34, Laurent Dufour wrote: > On 28/04/2017 09:31, Michal Hocko wrote: > > [CC Johannes and Vladimir - the patch is > > http://lkml.kernel.org/r/1493130472-22843-2-git-send-email-lduf...@linux.vnet.ibm.com] > > > > On Fri 28-04-17 08:07:55, Michal Hocko wrote: > >> On Thu 27-04

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-28 Thread Laurent Dufour
On 26/04/2017 10:59, Balbir Singh wrote: > On Wed, 2017-04-26 at 04:46 +, Naoya Horiguchi wrote: >> On Wed, Apr 26, 2017 at 01:45:00PM +1000, Balbir Singh wrote: >> static int delete_from_lru_cache(struct page *p) >> { >> +if (memcg_kmem_enabled()) >> +

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-28 Thread Laurent Dufour
On 28/04/2017 09:31, Michal Hocko wrote: > [CC Johannes and Vladimir - the patch is > http://lkml.kernel.org/r/1493130472-22843-2-git-send-email-lduf...@linux.vnet.ibm.com] > > On Fri 28-04-17 08:07:55, Michal Hocko wrote: >> On Thu 27-04-17 13:51:23, Andi Kleen wrote: >>> Michal Hocko writes: >>

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-28 Thread Michal Hocko
[CC Johannes and Vladimir - the patch is http://lkml.kernel.org/r/1493130472-22843-2-git-send-email-lduf...@linux.vnet.ibm.com] On Fri 28-04-17 08:07:55, Michal Hocko wrote: > On Thu 27-04-17 13:51:23, Andi Kleen wrote: > > Michal Hocko writes: > > > > > On Tue 25-04-17 16:27:51, Laurent Dufour

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-27 Thread Michal Hocko
On Thu 27-04-17 13:51:23, Andi Kleen wrote: > Michal Hocko writes: > > > On Tue 25-04-17 16:27:51, Laurent Dufour wrote: > >> When page are poisoned, they should be uncharged from the root memory > >> cgroup. > >> > >> This is required to avoid a BUG raised when the page is onlined back: > >> BU

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-27 Thread Andi Kleen
Michal Hocko writes: > On Tue 25-04-17 16:27:51, Laurent Dufour wrote: >> When page are poisoned, they should be uncharged from the root memory >> cgroup. >> >> This is required to avoid a BUG raised when the page is onlined back: >> BUG: Bad page state in process mem-on-off-test pfn:7ae3b >> p

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-27 Thread Michal Hocko
On Tue 25-04-17 16:27:51, Laurent Dufour wrote: > When page are poisoned, they should be uncharged from the root memory > cgroup. > > This is required to avoid a BUG raised when the page is onlined back: > BUG: Bad page state in process mem-on-off-test pfn:7ae3b > page:f1eb8ec0 count:0 ma

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-26 Thread Balbir Singh
On Wed, 2017-04-26 at 04:46 +, Naoya Horiguchi wrote: > On Wed, Apr 26, 2017 at 01:45:00PM +1000, Balbir Singh wrote: > > > > > static int delete_from_lru_cache(struct page *p) > > > > > { > > > > > + if (memcg_kmem_enabled()) > > > > > + memcg_kmem_uncharge(p, 0); > > > > > +

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-25 Thread Naoya Horiguchi
On Wed, Apr 26, 2017 at 01:45:00PM +1000, Balbir Singh wrote: > > > > static int delete_from_lru_cache(struct page *p) > > > > { > > > > + if (memcg_kmem_enabled()) > > > > + memcg_kmem_uncharge(p, 0); > > > > + > > > > > > The changelog is not quite clear, so we are unchargi

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-25 Thread Balbir Singh
> > > static int delete_from_lru_cache(struct page *p) > > > { > > > + if (memcg_kmem_enabled()) > > > + memcg_kmem_uncharge(p, 0); > > > + > > > > The changelog is not quite clear, so we are uncharging a page using > > memcg_kmem_uncharge for a page in swap cache/page cache? > > Hi Bal

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-25 Thread Naoya Horiguchi
On Wed, Apr 26, 2017 at 11:54:58AM +1000, Balbir Singh wrote: > On Tue, 2017-04-25 at 16:27 +0200, Laurent Dufour wrote: > > When page are poisoned, they should be uncharged from the root memory > > cgroup. > > > > This is required to avoid a BUG raised when the page is onlined back: > > BUG: Bad

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-25 Thread Balbir Singh
On Tue, 2017-04-25 at 16:27 +0200, Laurent Dufour wrote: > When page are poisoned, they should be uncharged from the root memory > cgroup. > > This is required to avoid a BUG raised when the page is onlined back: > BUG: Bad page state in process mem-on-off-test pfn:7ae3b > page:f1eb8ec0 c

Re: [PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-25 Thread Naoya Horiguchi
On Tue, Apr 25, 2017 at 04:27:51PM +0200, Laurent Dufour wrote: > When page are poisoned, they should be uncharged from the root memory > cgroup. > > This is required to avoid a BUG raised when the page is onlined back: > BUG: Bad page state in process mem-on-off-test pfn:7ae3b > page:f1e

[PATCH v2 1/2] mm: Uncharge poisoned pages

2017-04-25 Thread Laurent Dufour
When page are poisoned, they should be uncharged from the root memory cgroup. This is required to avoid a BUG raised when the page is onlined back: BUG: Bad page state in process mem-on-off-test pfn:7ae3b page:f1eb8ec0 count:0 mapcount:0 mapping: (null) index:0x1 flags: 0x380