Re: [PATCH 07/10] mm, oom: fortify task_will_free_mem

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

 



Michal Hocko wrote:
> +static inline bool __task_will_free_mem(struct task_struct *task)
> +{
> +	struct signal_struct *sig = task->signal;
> +
> +	/*
> +	 * A coredumping process may sleep for an extended period in exit_mm(),
> +	 * so the oom killer cannot assume that the process will promptly exit
> +	 * and release memory.
> +	 */
> +	if (sig->flags & SIGNAL_GROUP_COREDUMP)
> +		return false;
> +
> +	if (sig->flags & SIGNAL_GROUP_EXIT)
> +		return true;
> +
> +	if (thread_group_empty(task) && PF_EXITING)
> +		return true;

"thread_group_empty(task) && PF_EXITING" is wrong.

> +
> +	return false;
> +}
> +
> +/*
> + * Checks whether the given task is dying or exiting and likely to
> + * release its address space. This means that all threads and processes
> + * sharing the same mm have to be killed or exiting.
> + */
> +bool task_will_free_mem(struct task_struct *task)
> +{
> +	struct mm_struct *mm;
> +	struct task_struct *p;
> +	bool ret;
> +
> +	if (!__task_will_free_mem(p))
> +		return false;

mm/oom_kill.c: In function 'task_will_free_mem':
mm/oom_kill.c:758:27: warning: 'p' is used uninitialized in this function [-Wuninitialized]

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



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