From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by kanga.kvack.org (Postfix) with ESMTP id 3139D6B0005 for ; Fri, 19 Feb 2016 10:10:46 -0500 (EST) Received: by mail-wm0-f43.google.com with SMTP id c200so80310727wme.0 for ; Fri, 19 Feb 2016 07:10:46 -0800 (PST) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com. [74.125.82.48]) by mx.google.com with ESMTPS id ji7si18381838wjb.247.2016.02.19.07.10.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Feb 2016 07:10:45 -0800 (PST) Received: by mail-wm0-f48.google.com with SMTP id b205so72293914wmb.1 for ; Fri, 19 Feb 2016 07:10:45 -0800 (PST) Date: Fri, 19 Feb 2016 16:10:43 +0100 From: Michal Hocko Subject: Re: [PATCH] mm,oom: kill duplicated oom_unkillable_task() checks. Message-ID: <20160219151043.GI12690@dhcp22.suse.cz> References: <1455892411-7611-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455892411-7611-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> Sender: owner-linux-mm@kvack.org List-ID: To: Tetsuo Handa Cc: rientjes@google.com, hannes@cmpxchg.org, vdavydov@virtuozzo.com, linux-mm@kvack.org On Fri 19-02-16 23:33:31, Tetsuo Handa wrote: > Currently, oom_unkillable_task() is called for twice for each thread, > once at oom_scan_process_thread() and again at oom_badness(). > > The reason oom_scan_process_thread() needs to call oom_unkillable_task() > is to skip TIF_MEMDIE test and oom_task_origin() test if that thread is > not OOM-killable. > > But there is a problem with this ordering, for oom_task_origin() == true > will unconditionally select that thread regardless of oom_score_adj. > When we merge the OOM reaper, the OOM reaper will mark already reaped > process as OOM-unkillable by updating oom_score_adj. In order to avoid > falling into infinite loop, oom_score_adj needs to be checked before > doing oom_task_origin() test. What would be the infinite loop? -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org