Re: [RFC] Getting rid of INFLIGHT_VICTIM

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

 



On 2018/06/05 22:31, Tetsuo Handa wrote:
> @@ -639,15 +618,18 @@ static int oom_reaper(void *unused)
>  
>  static void wake_oom_reaper(struct task_struct *tsk)
>  {
> -	/* tsk is already queued? */
> -	if (tsk == oom_reaper_list || tsk->oom_reaper_list)
> -		return;
> -
> -	get_task_struct(tsk);
> +	struct task_struct *p = oom_reaper_th;
>  
>  	spin_lock(&oom_reaper_lock);
> -	tsk->oom_reaper_list = oom_reaper_list;
> -	oom_reaper_list = tsk;
> +	while (p != tsk && p->oom_reaper_list)
> +		p = p->oom_reaper_list;
> +	if (p != tsk) {

Oops. This is "if (p == tsk) {".

> +		spin_unlock(&oom_reaper_lock);
> +		return;
> +	}
> +	p->oom_reaper_list = tsk;
> +	tsk->oom_reaper_list = NULL;
> +	get_task_struct(tsk);
>  	spin_unlock(&oom_reaper_lock);
>  	trace_wake_reaper(tsk->pid);
>  	wake_up(&oom_reaper_wait);




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

  Powered by Linux