From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753527AbbJGMDh (ORCPT ); Wed, 7 Oct 2015 08:03:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48559 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751349AbbJGMDg (ORCPT ); Wed, 7 Oct 2015 08:03:36 -0400 Date: Wed, 7 Oct 2015 14:00:16 +0200 From: Oleg Nesterov To: Tetsuo Handa Cc: mhocko@kernel.org, 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: <20151007120016.GB20428@redhat.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201510072003.DCC69259.tJOOFOFFMLQSVH@I-love.SAKURA.ne.jp> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Oleg.