Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3273337imm; Fri, 20 Jul 2018 13:21:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdt24mgQNPOO65eyo/YYoofdaHwlmOHPfM/Y0E2u4jfyEt4g2l1jEGY1djVz062p+CkNYQz X-Received: by 2002:a65:520d:: with SMTP id o13-v6mr3315746pgp.282.1532118061267; Fri, 20 Jul 2018 13:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532118061; cv=none; d=google.com; s=arc-20160816; b=UualFTtLBZKx/mMudJqYln7jBgVnKor1DL2dnCfAeqnOL3OBZEQWK3RSX7yTPsaM2i CdVw3KexOl3+hwTb9f6gDIFcbcGMO4THoUPC8MXFgEvhRiJlpnysYyyEOZquzWQNEgzw e5yZtcL4JgwWBhdACQ+bvkzjXVOvQebYztXqVUCyJFJpb2D/CjvxL+EYhkqqNhZb4UVC yKzfstsoQmUs4RYAJ362+2P5yAMFqdRFBmfJcGNlTTpEXuNLLylCG2sbzlCzJ6iK188a +7mLl7Cc7iJ8TwC9cNxPVDv8RjggS4o0q8kwUdP+Om97n2Q8COhCEbiLF+UWhEPr4qtt 9VYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Tnx9P5KGceNoyiA0P8tZAW3VLDN0abPVOLZ3EQElqFw=; b=YxTw+c6Rpg9UC/folPUReyQHe0KuHLH/UTSU1N6zvJzdS0FxhXX7PbY/xPKsGV+tAN VvLtV/WO7FNHr/JfLCpnD33ljEekbfrnZ/f8NuBs0i5LRhUwNIaW2Z1GpLxsTap6Yjfz QE8gyHOgpfHsgC8OMCBUHHZAhiJ2PFGEqHCfJR50dW7YXDNWrSyZ7fAKZSfuajNIJYYs t3Y7lQNQqF1BzhJdV6oetFh/NzmLnuKC4Gl7BZJQ7VKQ9DPFVR4rqQQz0bPXNZjJqP6k ov2k+fBETfoihH64J1Vez5hLTjdmZmXZ+hNBclCNYbLO1W344RAaWDBq1sZr3JR0mlRS vRhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="aKd/Q5pA"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20-v6si2559967pgl.594.2018.07.20.13.20.46; Fri, 20 Jul 2018 13:21:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="aKd/Q5pA"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728811AbeGTVJv (ORCPT + 99 others); Fri, 20 Jul 2018 17:09:51 -0400 Received: from mail-pl0-f46.google.com ([209.85.160.46]:45083 "EHLO mail-pl0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728329AbeGTVJv (ORCPT ); Fri, 20 Jul 2018 17:09:51 -0400 Received: by mail-pl0-f46.google.com with SMTP id 94-v6so5631773ple.12 for ; Fri, 20 Jul 2018 13:20:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=Tnx9P5KGceNoyiA0P8tZAW3VLDN0abPVOLZ3EQElqFw=; b=aKd/Q5pANHCJ18E/PS0V0st+ypnLynqCMIq+MVKmC6M4dblmcUSaWyX02ccP4mS5nT xA3DJjQTiPGZdsADiKuCwtGiFxlnEvHe+qLltsfDamhVZFspToZ7WQ7F4TSIbgdW/wXS xqQ9AsMwj13bViKNwLcqtdJF+BZYzHmwKdbvXF4EBEG92r6AaTc58sxyg1eJ3tdkKfVR FgAKnP8nIM2pKTIb9w+csxdyzptG9UuIlOr8i1WAB3l0DszlTkI+x2zkTs63br4SqXVZ /3wljpLmRN7KSZPDyfk0jAQF2almlU039AjV5ltOc4Dioke7UPpI0ukClKxr38WKGngz sTkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=Tnx9P5KGceNoyiA0P8tZAW3VLDN0abPVOLZ3EQElqFw=; b=SvcM2GME4zzDD/eL9ePmYcpdxSeXomK5BkCEcQe4djt0KBLQGb3x7oDq3I3sksXwSQ 1yvaSRt4GbKnx3OvFtTw2lZOt7gGQU/vLbg2IyQxqVDkelh2saxXExA3xyYmkdo46Uup ojW4AIIA7s/dfLYa0lmryEm3oOMsj7e3VYJ+muTU+UQTYVWtoc6vSn7Zfm6TqWjiHRRu TkeDD96Brd4eHkGYsxYgNl37dWM4JwaNkR4h8Dar9+J9agRLw3sHBweWCaDxZoMYLNPu h8Qb6Tfbad6GfGuOzEJD2N1ULz8TRoZamlopwmTL1CwhxH+lGw27UXbCiukecjB5y9GL ue6w== X-Gm-Message-State: AOUpUlFppn2dFBA0F9FtdXKyc49c8cnYgDoWNS/wMHrRZSN8568dL6PB gj6bxnTWjExqaot8IQOqkLfUFg== X-Received: by 2002:a17:902:9302:: with SMTP id bc2-v6mr3417611plb.280.1532118000312; Fri, 20 Jul 2018 13:20:00 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id n5-v6sm3439392pgr.24.2018.07.20.13.19.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jul 2018 13:19:59 -0700 (PDT) Date: Fri, 20 Jul 2018 13:19:59 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Tetsuo Handa cc: Andrew Morton , Michal Hocko , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch v3] mm, oom: fix unnecessary killing of additional processes In-Reply-To: <9ab77cc7-2167-0659-a2ad-9cec3b9440e9@i-love.sakura.ne.jp> Message-ID: References: <9ab77cc7-2167-0659-a2ad-9cec3b9440e9@i-love.sakura.ne.jp> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Jul 2018, Tetsuo Handa wrote: > > Absent oom_lock serialization, this is exactly working as intended. You > > could argue that once the thread has reached exit_mmap() and begins oom > > reaping that it should be allowed to finish before the oom reaper declares > > MMF_OOM_SKIP. That could certainly be helpful, I simply haven't > > encountered a usecase where it were needed. Or, we could restart the oom > > expiration when MMF_UNSTABLE is set and deem that progress is being made > > so it give it some extra time. In practice, again, we haven't seen this > > needed. But either of those are very easy to add in as well. Which would > > you prefer? > > I don't think we need to introduce user-visible knob interface (even if it is in > debugfs), for I think that my approach can solve your problem. Please try OOM lockup > (CVE-2016-10723) mitigation patch ( https://marc.info/?l=linux-mm&m=153112243424285&w=4 ) The issue I am fixing has nothing to do with contention on oom_lock, it has to do with the inability of the oom reaper to free memory for one or more of several reasons: mlock, blockable mmus, ptes, mm->mmap_sem contention, and then the setting of MMF_OOM_SKIP to choose another victim before the original victim even reaches exit_mmap(). Thus, removing oom_lock from exit_mmap() will not fix this issue. I agree that oom_lock can be removed from exit_mmap() and it would be helpful to do so, and may address a series of problems that we have yet to encounter, but this would not fix the almost immediate setting of MMF_OOM_SKIP that occurs with minimal memory freeing due to the oom reaper.