Re: [RFC PATCH 05/11] mm/mempolicy: modify set_mempolicy_home_node to take a task argument

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

 



On Wed 22-11-23 16:11:54, Gregory Price wrote:
[...]
> +
> +	/*
> +	 * Behavior when task == current allows a task modifying itself
> +	 * to bypass the check in get_task_mm and acquire the mm directly
> +	 */
> +	if (task == current) {
> +		mm = task->mm;
> +		mmget(mm);
> +	} else
> +		mm = get_task_mm(task);

Similar question as in the previous patch. When is a kthread legit to do
manipulate borrowed mm memory policy?

> +
> +	if (!mm)
> +		return -ENODEV;

Is this an expected error? No mm means task dying and mm has been
already released. Should we simply return ESRCH wouldbe a better error
code IMO. This should never happen for the current task so it sould be
safe to add.

-- 
Michal Hocko
SUSE Labs




[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