Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1698012

Re: [PATCH 2/2] mm: replace TIF_MEMDIE checks by tsk_is_oom_victim

From Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] mm: replace TIF_MEMDIE checks by tsk_is_oom_victim
Date 2017-07-27 16:10 +0200
Message-ID <u7REe-767-7@gated-at.bofh.it> (permalink)
References <u7MXU-4d2-17@gated-at.bofh.it> <u7N7z-4g8-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Michal Hocko wrote:
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 544d47e5cbbd..86a48affb938 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1896,7 +1896,7 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask,
>  	 * bypass the last charges so that they can exit quickly and
>  	 * free their memory.
>  	 */
> -	if (unlikely(test_thread_flag(TIF_MEMDIE) ||
> +	if (unlikely(tsk_is_oom_victim(current) ||
>  		     fatal_signal_pending(current) ||
>  		     current->flags & PF_EXITING))
>  		goto force;

Did we check http://lkml.kernel.org/r/20160909140508.GO4844@dhcp22.suse.cz ?

> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index c9f3569a76c7..65cc2f9aaa05 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -483,7 +483,7 @@ static bool __oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
>  	 *				[...]
>  	 *				out_of_memory
>  	 *				  select_bad_process
> -	 *				    # no TIF_MEMDIE task selects new victim
> +	 *				    # no TIF_MEMDIE, selects new victim
>  	 *  unmap_page_range # frees some memory
>  	 */
>  	mutex_lock(&oom_lock);

This comment is wrong. No MMF_OOM_SKIP mm selects new victim.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] mm, oom: do not grant oom victims full memory reserves access Michal Hocko <mhocko@kernel.org> - 2017-07-27 11:10 +0200
  [PATCH 1/2] mm, oom: do not rely on TIF_MEMDIE for memory reserves access Michal Hocko <mhocko@kernel.org> - 2017-07-27 11:10 +0200
  [PATCH 2/2] mm: replace TIF_MEMDIE checks by tsk_is_oom_victim Michal Hocko <mhocko@kernel.org> - 2017-07-27 11:20 +0200
    Re: [PATCH 2/2] mm: replace TIF_MEMDIE checks by tsk_is_oom_victim Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-07-27 16:10 +0200
    Re: [PATCH 2/2] mm: replace TIF_MEMDIE checks by tsk_is_oom_victim Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-07-27 16:10 +0200
      Re: [PATCH 2/2] mm: replace TIF_MEMDIE checks by tsk_is_oom_victim Michal Hocko <mhocko@kernel.org> - 2017-07-27 16:20 +0200
      Re: [PATCH 2/2] mm: replace TIF_MEMDIE checks by tsk_is_oom_victim Michal Hocko <mhocko@kernel.org> - 2017-07-27 16:50 +0200
    Re: [PATCH 2/2] mm: replace TIF_MEMDIE checks by tsk_is_oom_victim Michal Hocko <mhocko@kernel.org> - 2017-07-31 08:50 +0200

csiph-web