# Re: \[PATCH v7 1/5\] mm/mempolicy: Add MPOL\_PREFERRED\_MANY for multiple preferred nodes

- From: Michal Hocko \<mhocko@suse.com\>
- Date: 2021-08-06 13:27:54 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2021/08/1470268
- Thread: https://ratatoskr.run/linux-mm/2021/08/1466061/t.md

```text
On Tue 03-08-21 13:59:18, Feng Tang wrote:
[...]
> @@ -1936,7 +1969,9 @@ unsigned int mempolicy_slab_node(void)
>  	case MPOL_INTERLEAVE:
>  		return interleave_nodes(policy);
>  
> -	case MPOL_BIND: {
> +	case MPOL_BIND:
> +	case MPOL_PREFERRED_MANY:
> +	{
>  		struct zoneref *z;

I guess this is ok for now but it would be great if slab maintainers
could have a look here. I suspect this will need some more changes. E.g.
I find it highly suspicious how fallback_alloc uses mempolicy_slab_node.
Let's say that the local node is not a part of the nodemask.
mempolicy_slab_node will switch to the first node in the order list
which is ok but fallback_alloc then iterates over the whole zonelist
without any policy node mask constrains. get_any_partial looks very
similar.


-- 
Michal Hocko
SUSE Labs
```
