Re: [PATCH] mm, memcg: add a helper function to check may oom condition

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

 



On Mon, 9 Sep 2013, Qiang Huang wrote:

> diff --git a/include/linux/oom.h b/include/linux/oom.h
> index da60007..d061c63 100644
> --- a/include/linux/oom.h
> +++ b/include/linux/oom.h
> @@ -82,6 +82,11 @@ static inline void oom_killer_enable(void)
>  	oom_killer_disabled = false;
>  }
> 
> +static inline bool may_oom(gfp_t gfp_mask)

Makes sense, but I think the name should be more specific to gfp flags to 
make it clear what it's using to determine eligibility, maybe oom_gfp_allowed()? 
We usually prefix oom killer functions with "oom".

Nice taste.

> +{
> +	return (gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY);
> +}
> +
>  extern struct task_struct *find_lock_task_mm(struct task_struct *p);
> 
>  /* sysctls */

--
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]