Re: [PATCH 2/3] mm/mempolicy: refactor a read-once mechanism into a function for re-use

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

 



On Mon, Jan 15, 2024 at 12:13:06PM +0800, Huang, Ying wrote:
> Gregory Price <gourry.memverge@xxxxxxxxx> writes:
> 
> >  
> > +static unsigned int read_once_policy_nodemask(struct mempolicy *pol,
> > +					      nodemask_t *mask)
> 
> It may be more useful if we define this as memcpy_once().  That can be
> used not only for nodemask, but also other data structure.
>

Seemed better to do this is an entirely separate patch line to avoid
scope creep on reviews and such.

> > +	barrier();
> > +	__builtin_memcpy(mask, &pol->nodes, sizeof(nodemask_t));
> 
> We don't use __builtin_memcpy() in kernel itself directly.  Although it
> is used in kernel tools.  So, I think it's better to use memcpy() here.
> 

ack.

~Gregory




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux