Re: [PATCH v1 2/2] osdep: support mempolicy for preallocation in os_mem_prealloc

2021-12-07 Thread David Hildenbrand
On 07.12.21 14:58, Daniil Tatianin wrote: > I believe you're right. Looking at the implementation of > shmem_alloc_page, it uses the inode policy, which is set via > vma->set_policy (from the mbind() call in this case). set_mempolicy is > both useless and redundant here, as thread's > policy is onl

Re: [PATCH v1 2/2] osdep: support mempolicy for preallocation in os_mem_prealloc

2021-12-07 Thread Daniil Tatianin
I believe you're right. Looking at the implementation of shmem_alloc_page, it uses the inode policy, which is set viavma->set_policy (from the mbind() call in this case). set_mempolicy is both useless and redundant here, as thread'spolicy is only ever used in case vma->get_policy returns NULL (whic

Re: [PATCH v1 2/2] osdep: support mempolicy for preallocation in os_mem_prealloc

2021-12-07 Thread David Hildenbrand
On 07.12.21 08:06, Daniil Tatianin wrote: > This is needed for cases where we want to make sure that a shared memory > region gets allocated from a specific NUMA node. This is impossible to do > with mbind(2) because it ignores the policy for memory mapped with > MAP_SHARED. We work around this by

[PATCH v1 2/2] osdep: support mempolicy for preallocation in os_mem_prealloc

2021-12-06 Thread Daniil Tatianin
This is needed for cases where we want to make sure that a shared memory region gets allocated from a specific NUMA node. This is impossible to do with mbind(2) because it ignores the policy for memory mapped with MAP_SHARED. We work around this by calling set_mempolicy from prealloc threads instea