From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933100AbbJHOEP (ORCPT ); Thu, 8 Oct 2015 10:04:15 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:34813 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932369AbbJHOEN (ORCPT ); Thu, 8 Oct 2015 10:04:13 -0400 Date: Thu, 8 Oct 2015 16:04:11 +0200 From: Michal Hocko To: Oleg Nesterov Cc: Tetsuo Handa , torvalds@linux-foundation.org, kwalker@redhat.com, cl@linux.com, akpm@linux-foundation.org, rientjes@google.com, hannes@cmpxchg.org, vdavydov@parallels.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, skozina@redhat.com Subject: Re: can't oom-kill zap the victim's memory? Message-ID: <20151008140411.GC426@dhcp22.suse.cz> References: <20150921153252.GA21988@redhat.com> <20150921161203.GD19811@dhcp22.suse.cz> <20150922160608.GA2716@redhat.com> <20150923205923.GB19054@dhcp22.suse.cz> <20151006184502.GA15787@redhat.com> <201510072003.DCC69259.tJOOFOFFMLQSVH@I-love.SAKURA.ne.jp> <20151007120016.GB20428@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151007120016.GB20428@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 07-10-15 14:00:16, Oleg Nesterov wrote: > On 10/07, Tetsuo Handa wrote: > > > > Oleg Nesterov wrote: > > > Anyway. Perhaps it makes sense to abort the for_each_vma() loop if > > > freed_enough_mem() == T. But it is absolutely not clear to me how we > > > should define this freed_enough_mem(), so I think we should do this > > > later. > > > > Maybe > > > > bool freed_enough_mem(void) { !atomic_read(&oom_victims); } > > > > if we change to call mark_oom_victim() on all threads which should be > > killed as OOM victims. > > Well, in this case > > if (atomic_read(&mm->mm_users) == 1) > break; > > makes much more sense. Plus we do not need to change mark_oom_victim(). > > Lets discuss this later? Yes I do not think this is that important if a kernel thread is going to reclaim the address space. It will effectively free memory on behalf of the victim so a longer scan shouldn't be such a big problem. At least not for the first implementation. -- Michal Hocko SUSE Labs