[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5ef2a902-7abb-a0a9-f478-dcccbb393893@linux.alibaba.com>
Date: Tue, 19 Mar 2019 18:06:26 -0700
From: Yang Shi <yang.shi@...ux.alibaba.com>
To: David Rientjes <rientjes@...gle.com>
Cc: chrubis@...e.cz, vbabka@...e.cz, kirill@...temov.name,
osalvador@...e.de, akpm@...ux-foundation.org,
stable@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: mempolicy: make mbind() return -EIO when
MPOL_MF_STRICT is specified
On 3/19/19 5:49 PM, David Rientjes wrote:
> On Wed, 20 Mar 2019, Yang Shi wrote:
>
>> When MPOL_MF_STRICT was specified and an existing page was already
>> on a node that does not follow the policy, mbind() should return -EIO.
>> But commit 6f4576e3687b ("mempolicy: apply page table walker on
>> queue_pages_range()") broke the rule.
>>
>> And, commit c8633798497c ("mm: mempolicy: mbind and migrate_pages
>> support thp migration") didn't return the correct value for THP mbind()
>> too.
>>
>> If MPOL_MF_STRICT is set, ignore vma_migratable() to make sure it reaches
>> queue_pages_to_pte_range() or queue_pages_pmd() to check if an existing
>> page was already on a node that does not follow the policy. And,
>> non-migratable vma may be used, return -EIO too if MPOL_MF_MOVE or
>> MPOL_MF_MOVE_ALL was specified.
>>
>> Tested with https://github.com/metan-ucw/ltp/blob/master/testcases/kernel/syscalls/mbind/mbind02.c
>>
>> Fixes: 6f4576e3687b ("mempolicy: apply page table walker on queue_pages_range()")
>> Reported-by: Cyril Hrubis <chrubis@...e.cz>
>> Cc: Vlastimil Babka <vbabka@...e.cz>
>> Cc: stable@...r.kernel.org
>> Suggested-by: Kirill A. Shutemov <kirill@...temov.name>
>> Signed-off-by: Yang Shi <yang.shi@...ux.alibaba.com>
>> Signed-off-by: Oscar Salvador <osalvador@...e.de>
> Acked-by: David Rientjes <rientjes@...gle.com>
>
> Thanks. I think this needs stable for 4.0+, can you confirm?
Thanks. Yes, this needs stable for 4.0+.
Yang
Powered by blists - more mailing lists