Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3292634imm; Fri, 20 Jul 2018 13:49:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfhIJvVIyUtlfn5waZW00z725+wnfFvNgZiZudlxSuHoGxt8yqkwwENji8nylUq3iPVD3+i X-Received: by 2002:a63:2ec3:: with SMTP id u186-v6mr3371037pgu.225.1532119747228; Fri, 20 Jul 2018 13:49:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532119747; cv=none; d=google.com; s=arc-20160816; b=o570tyooNGaLZObPAogxDQBtigGXgzvnma4wuXgCap5Slo2S9kBno3kkkxfP68L/in ij3k4O/er/c8s8GL8AmoshryRq0M1G6oNVdbQ0QPXrBYf4Avl/bQGNrZVSWa0lkCx6bk BehwVNdlRsQpldJcO1tpuUgIB9RgDTJoFEu52CHMt2ufml73IjYbqP+RtLsW0OXK2QrC O9fGGxsbyfWwWMOriFW3G/LC7MCu0jgSJIHXwzVovrV92woApV9ON5J0NS+gm9mcn2rs JPaFsdfP04WD3k6RLeiLnf+6w/yrrhpC/Fea04oQX4Moti0jQ+XezLdxzVA8ITcP0rPu F1rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=GEowCsjsQsKP3ImzYOM27kJhY9vh/kvFwuKWRHv7N4M=; b=dbAIp4orRpPDMMYK9PRWiwLCvYcybxsa9EUfL6DMsFy3y81sz/b0CkEzTPmRFuaGiT JvnSiPOy5wecxTqJQ4yBrrGhKt4jorA9pYIjzkWj7yjvO348ToRVqN78mmSSDuuJpW/K nwHhN4cyiPq1RWpNBE4+VLr6ClIas54taChjVS+44xP/i95VK/NAD6oODldujKvwsbOP GtEHcVO4NvuMq57ToiypdeeTd0xz5YA1kNMSVHCays1OsvTcXh3zNg59rNr2jGeQ3uIp 5A7aLyY4YYI9eAvBpe96TnG0MoV8ogDkj+hsZYOa+5jZFJE/REUqkL/GzfYA7GTsuGRP 3+tg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1-v6si2417314plb.204.2018.07.20.13.48.52; Fri, 20 Jul 2018 13:49:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728469AbeGTVhi (ORCPT + 99 others); Fri, 20 Jul 2018 17:37:38 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:36594 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728011AbeGTVhi (ORCPT ); Fri, 20 Jul 2018 17:37:38 -0400 Received: from fsav103.sakura.ne.jp (fsav103.sakura.ne.jp [27.133.134.230]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id w6KKlSdp016274; Sat, 21 Jul 2018 05:47:29 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav103.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav103.sakura.ne.jp); Sat, 21 Jul 2018 05:47:28 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav103.sakura.ne.jp) Received: from [192.168.1.8] (softbank126074194044.bbtec.net [126.74.194.44]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id w6KKlSjH016271 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 21 Jul 2018 05:47:28 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [patch v3] mm, oom: fix unnecessary killing of additional processes To: David Rientjes Cc: Andrew Morton , Michal Hocko , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <9ab77cc7-2167-0659-a2ad-9cec3b9440e9@i-love.sakura.ne.jp> From: Tetsuo Handa Message-ID: <569cf225-f1d3-f81b-5947-cff7bd21381f@i-love.sakura.ne.jp> Date: Sat, 21 Jul 2018 05:47:30 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/07/21 5:19, David Rientjes wrote: > 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. > Why [PATCH 2/2] in https://marc.info/?l=linux-mm&m=153119509215026&w=4 does not solve your problem?