Re: [PATCH] mm/mempolicy: fix a race between offset_il_node and mpol_rebind_task

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 14, 2021 at 12:40:53AM +0800, yanghui wrote:
> +++ b/mm/mempolicy.c
> @@ -193,7 +193,7 @@ static int mpol_new_interleave(struct mempolicy *pol, const nodemask_t *nodes)
>  {
>  	if (nodes_empty(*nodes))
>  		return -EINVAL;
> -	pol->nodes = *nodes;
> +	WRITE_ONCE(pol->nodes, *nodes);

typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;

If MAX_NUMNODES is large enough, is WRITE_ONCE going to work?  It could
be 128 bits, and few architectures have an atomic 128-bit store
instruction.





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux