Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-04 Thread Cong Wang
On Thu, Aug 3, 2017 at 4:25 PM, Linus Torvalds wrote: > On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton > wrote: >> >> Where is this INIT_LIST_HEAD()? > > I think it's this one: > > list_del_init(>shrinklist); > > in

Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-04 Thread Cong Wang
On Thu, Aug 3, 2017 at 4:25 PM, Linus Torvalds wrote: > On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton > wrote: >> >> Where is this INIT_LIST_HEAD()? > > I think it's this one: > > list_del_init(>shrinklist); > > in shmem_unused_huge_shrink(). Yes, this is correct. Sorry about

Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-04 Thread Cong Wang
On Thu, Aug 3, 2017 at 4:53 PM, Andrew Morton wrote: > On Thu, 3 Aug 2017 16:25:46 -0700 Linus Torvalds > wrote: > >> On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton >> wrote: >> > >> > Where is this

Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-04 Thread Cong Wang
On Thu, Aug 3, 2017 at 4:53 PM, Andrew Morton wrote: > On Thu, 3 Aug 2017 16:25:46 -0700 Linus Torvalds > wrote: > >> On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton >> wrote: >> > >> > Where is this INIT_LIST_HEAD()? >> >> I think it's this one: >> >> list_del_init(>shrinklist); >> >>

Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-04 Thread Kirill A. Shutemov
On Thu, Aug 03, 2017 at 04:53:07PM -0700, Andrew Morton wrote: > On Thu, 3 Aug 2017 16:25:46 -0700 Linus Torvalds > wrote: > > > On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton > > wrote: > > > > > > Where is this INIT_LIST_HEAD()? > >

Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-04 Thread Kirill A. Shutemov
On Thu, Aug 03, 2017 at 04:53:07PM -0700, Andrew Morton wrote: > On Thu, 3 Aug 2017 16:25:46 -0700 Linus Torvalds > wrote: > > > On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton > > wrote: > > > > > > Where is this INIT_LIST_HEAD()? > > > > I think it's this one: > > > >

Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-03 Thread Andrew Morton
On Thu, 3 Aug 2017 16:25:46 -0700 Linus Torvalds wrote: > On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton > wrote: > > > > Where is this INIT_LIST_HEAD()? > > I think it's this one: > > list_del_init(>shrinklist); > > in

Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-03 Thread Andrew Morton
On Thu, 3 Aug 2017 16:25:46 -0700 Linus Torvalds wrote: > On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton > wrote: > > > > Where is this INIT_LIST_HEAD()? > > I think it's this one: > > list_del_init(>shrinklist); > > in shmem_unused_huge_shrink(). OK. > > I'm not sure I'm

Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-03 Thread Linus Torvalds
On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton wrote: > > Where is this INIT_LIST_HEAD()? I think it's this one: list_del_init(>shrinklist); in shmem_unused_huge_shrink(). > I'm not sure I'm understanding this. AFAICT all the list operations to > which you

Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-03 Thread Linus Torvalds
On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton wrote: > > Where is this INIT_LIST_HEAD()? I think it's this one: list_del_init(>shrinklist); in shmem_unused_huge_shrink(). > I'm not sure I'm understanding this. AFAICT all the list operations to > which you refer are synchronized under

Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-03 Thread Andrew Morton
On Wed, 2 Aug 2017 22:46:30 -0700 Cong Wang wrote: > We saw many list corruption warnings on shmem shrinklist: > > ... > > The problem is that shmem_unused_huge_shrink() moves entries > from the global sbinfo->shrinklist to its local lists and then > releases the

Re: [PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-03 Thread Andrew Morton
On Wed, 2 Aug 2017 22:46:30 -0700 Cong Wang wrote: > We saw many list corruption warnings on shmem shrinklist: > > ... > > The problem is that shmem_unused_huge_shrink() moves entries > from the global sbinfo->shrinklist to its local lists and then > releases the spinlock. However, a parallel

[PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-02 Thread Cong Wang
We saw many list corruption warnings on shmem shrinklist: [45480.300911] [ cut here ] [45480.305558] WARNING: CPU: 18 PID: 177 at lib/list_debug.c:59 __list_del_entry+0x9e/0xc0 [45480.313622] list_del corruption. prev->next should be 9ae5694b82d8, but was

[PATCH] mm: fix list corruptions on shmem shrinklist

2017-08-02 Thread Cong Wang
We saw many list corruption warnings on shmem shrinklist: [45480.300911] [ cut here ] [45480.305558] WARNING: CPU: 18 PID: 177 at lib/list_debug.c:59 __list_del_entry+0x9e/0xc0 [45480.313622] list_del corruption. prev->next should be 9ae5694b82d8, but was