From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754893AbdLGPoZ (ORCPT ); Thu, 7 Dec 2017 10:44:25 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:31816 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753676AbdLGPoY (ORCPT ); Thu, 7 Dec 2017 10:44:24 -0500 To: mhocko@kernel.org, rientjes@google.com Cc: akpm@linux-foundation.org, aarcange@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: Multiple oom_reaper BUGs: unmap_page_range racing with exit_mmap From: Tetsuo Handa References: <20171207113548.GG20234@dhcp22.suse.cz> In-Reply-To: <20171207113548.GG20234@dhcp22.suse.cz> Message-Id: <201712080044.BID56711.FFVOLMStJOQHOF@I-love.SAKURA.ne.jp> X-Mailer: Winbiff [Version 2.51 PL2] X-Accept-Language: ja,en,zh Date: Fri, 8 Dec 2017 00:44:11 +0900 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michal Hocko wrote: > David, could you test with this patch please? Even if this patch solved David's case, you need to update * tsk_is_oom_victim() cannot be set from under us * either because current->mm is already set to NULL * under task_lock before calling mmput and oom_mm is * set not NULL by the OOM killer only if current->mm * is found not NULL while holding the task_lock. part as well, for it is the explanation of why tsk_is_oom_victim() test was expected to work. Also, do we need to do set_bit(MMF_OOM_SKIP, &mm->flags); if mm_is_oom_victim(mm) == false? exit_mmap() is called means that nobody can reach this mm except ->signal->oom_mm, and mm_is_oom_victim(mm) == false means that this mm cannot be reached by ->signal->oom_mm . Then, I think we do not need to set MMF_OOM_SKIP on this mm at exit_mmap() if mm_is_oom_victim(mm) == false.