Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031815AbbD2R1w (ORCPT ); Wed, 29 Apr 2015 13:27:52 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:11218 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966380AbbD2R1s (ORCPT ); Wed, 29 Apr 2015 13:27:48 -0400 To: mhocko@suse.cz, hannes@cmpxchg.org Cc: akpm@linux-foundation.org, aarcange@redhat.com, david@fromorbit.com, rientjes@google.com, vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/9] mm: improve OOM mechanism v2 From: Tetsuo Handa References: <201504281934.IIH81695.LOHJQMOFStFFVO@I-love.SAKURA.ne.jp> <20150428135535.GE2659@dhcp22.suse.cz> <201504290050.FDE18274.SOJVtFLOMOQFFH@I-love.SAKURA.ne.jp> <20150429125506.GB7148@cmpxchg.org> <20150429144031.GB31341@dhcp22.suse.cz> In-Reply-To: <20150429144031.GB31341@dhcp22.suse.cz> Message-Id: <201504300227.JCJ81217.FHOLSQVOFFJtMO@I-love.SAKURA.ne.jp> X-Mailer: Winbiff [Version 2.51 PL2] X-Accept-Language: ja,en,zh Date: Thu, 30 Apr 2015 02:27:44 +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 Content-Length: 1551 Lines: 27 Michal Hocko wrote: > On Wed 29-04-15 08:55:06, Johannes Weiner wrote: > > What we can do to mitigate this is tie the timeout to the setting of > > TIF_MEMDIE so that the wait is not 5s from the point of calling > > out_of_memory() but from the point of where TIF_MEMDIE was set. > > Subsequent allocations will then go straight to the reserves. > > That would deplete the reserves very easily. Shouldn't we rather > go other way around? Allow OOM killer context to dive into memory > reserves some more (ALLOC_OOM on top of current ALLOC flags and > __zone_watermark_ok would allow an additional 1/4 of the reserves) and > start waiting for the victim after that reserve is depleted. We would > still have some room for TIF_MEMDIE to allocate, the reserves consumption > would be throttled somehow and the holders of resources would have some > chance to release them and allow the victim to die. Does OOM killer context mean memory allocations which can call out_of_memory()? If yes, there is no guarantee that such memory reserve is used by threads which the OOM victim is waiting for, for they might do only !__GFP_FS allocations. Likewise, there is possibility that such memory reserve is used by threads which the OOM victim is not waiting for, for malloc() + memset() causes __GFP_FS allocations. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/