lkml.org 
[lkml]   [2017]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mm: fix list corruptions on shmem shrinklist
On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
>
> Where is this INIT_LIST_HEAD()?

I think it's this one:

list_del_init(&info->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 spin_lock(&sbinfo->shrinklist_lock)?

No, notice how shmem_unused_huge_shrink() does the

list_move(&info->shrinklist, &to_remove);

and

list_move(&info->shrinklist, &list);

to move to (two different) private lists under the shrinklist_lock,
but once it is on that private "list/to_remove" list, it is then
accessed outside the locked region.

Honestly, I don't love this situation, or the patch, but I think the
patch is likely the right thing to do.

Linus

\
 
 \ /
  Last update: 2017-08-04 01:26    [W:0.065 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site