From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932366AbcE0GpP (ORCPT ); Fri, 27 May 2016 02:45:15 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35384 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754183AbcE0GpO (ORCPT ); Fri, 27 May 2016 02:45:14 -0400 Date: Fri, 27 May 2016 08:45:10 +0200 From: Michal Hocko To: Tetsuo Handa Cc: linux-mm@kvack.org, rientjes@google.com, oleg@redhat.com, vdavydov@parallels.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] mm, oom: do not loop over all tasks if there are no external tasks sharing mm Message-ID: <20160527064510.GA27686@dhcp22.suse.cz> References: <1464266415-15558-2-git-send-email-mhocko@kernel.org> <201605262330.EEB52182.OtMFOJHFLOSFVQ@I-love.SAKURA.ne.jp> <20160526145930.GF23675@dhcp22.suse.cz> <201605270025.IAC48454.QSHOOMFOLtFJFV@I-love.SAKURA.ne.jp> <20160526153532.GG23675@dhcp22.suse.cz> <201605270114.IEI48969.MFFtFOJLQOOHSV@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605270114.IEI48969.MFFtFOJLQOOHSV@I-love.SAKURA.ne.jp> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 27-05-16 01:14:35, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Fri 27-05-16 00:25:23, Tetsuo Handa wrote: > > > I think that remembering whether this mm might be shared between > > > multiple thread groups at clone() time (i.e. whether > > > clone(CLONE_VM without CLONE_SIGHAND) was ever requested on this mm) > > > is safe (given that that thread already got SIGKILL or is exiting). > > > > I was already playing with that idea but I didn't want to add anything > > to the fork path which is really hot. This patch is not really needed > > for the rest. It just felt like a nice optimization. I do not think it > > is worth deeper changes in the fast paths. > > "[PATCH 6/6] mm, oom: fortify task_will_free_mem" depends on [PATCH 1/6]. > You will need to update [PATCH 6/6]. > > It seems to me that [PATCH 6/6] resembles > http://lkml.kernel.org/r/201605250005.GHH26082.JOtQOSLMFFOFVH@I-love.SAKURA.ne.jp . > I think we will be happy if we can speed up mm_is_reapable() test using > "whether this mm might be shared between multiple thread groups" flag. > I don't think updating such flag at clone() is too heavy operation to add. It is still an operation which is not needed for 99% of situations. So if we do not need it for correctness then I do not think this is worth bothering. -- Michal Hocko SUSE Labs