Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1474197imc; Mon, 11 Mar 2019 14:47:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAomVjLTIus1B0fNARm3sqfKyrxHxMcZvHTvBt5NULypNwZWdm19alNnOpS+1tIvi8gJla X-Received: by 2002:a63:f412:: with SMTP id g18mr32087959pgi.444.1552340866624; Mon, 11 Mar 2019 14:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552340866; cv=none; d=google.com; s=arc-20160816; b=FiKNTrvHXq6F0wSFIS2W0D3vP8eEOrEAqwPkdw8+JoZfzB7tE7v2wCYLWm/y3CTAe/ /oA4ap6LtKmwWW+o0qlak0vM4VK5IANt6l/A0zMaqoUDKf5P0eVwwVVKyujDoJFE0hJq WcOMUA+N/JrLDG5qME0MCNqjkAXahXM9TV4M1ivP3cSCBaEi83HnTPIDShq+TjBNGWio a2C2Zs26soaGktUhFVn66eMc7NP/+3ESGQUvtoU3qzhxku9FPi7/8C+2FnNCaRkk5bCT LOVPPgP+KaQJTkatusZodHNpk4Rda+1oVDjC2uAMgOHNimUM4O/mDOUGf9HHB9YOf6lZ 0XaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=v68UaAN+XF/lpO/ZYPx+cxL/Cwdo0hNkZMg52MNN2wQ=; b=hMWNXAlhjttgoydDsV52XLXmaYYBmYzd+Ycyq4kUtH8wOjSPGGpC1k+pKBCkrn7ltq 5SX4auyv2tb6adPNPfo7e7MaTDTgUYqXMN6C4GcxjkjhLQD1fzVTwiUqE6BTLWTJEBUa 3VDxVM2OWd8YLbNLfI1lSNWxqP7xxyjxnrVdBpqfQPDkFjrMnfDQgUGQXRGRwOZUrT9k JBNHvCje0g2C7J/VmO1MfkiGzqtlrxdBoNzEBY/ahGyMc4uZCVUjsYZnoRkPFOvq9Avb uGIrUajO1jv8dhX+VVd35ayFEEdbOZonvH0EHkkA37dbdtqYoXm16J+/WJ61sRBKqEsM 0plw== 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 y10si6161672pll.142.2019.03.11.14.47.30; Mon, 11 Mar 2019 14:47:46 -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 S1727904AbfCKVq5 (ORCPT + 99 others); Mon, 11 Mar 2019 17:46:57 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:38784 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727027AbfCKVq5 (ORCPT ); Mon, 11 Mar 2019 17:46:57 -0400 Received: by mail-pg1-f193.google.com with SMTP id m2so131686pgl.5 for ; Mon, 11 Mar 2019 14:46:56 -0700 (PDT) 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:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=v68UaAN+XF/lpO/ZYPx+cxL/Cwdo0hNkZMg52MNN2wQ=; b=l4y3HBHSVl8JJPjc5Dh2GXJH5EbMo5p44ShTc6AgjrygJiednfsOd20qiHAnN6TCgM luOuJK8m7/6HpryxoZFVMp+czPPIdoU7W3H1DwWf6kpcJfGlqgArcUVkqj6Lz9TSjIft Xi/UP6igJ1ed8504dXC/zf/N4juw/qg8THSzM41G/hFn1MidwJHcAjs8/8MsQz5clQsm z6k4lMIZDAzdi61zL41Qujxr4Zk0hzFqJAzPxUJSzpegBcxVNUEPPbzKotCp+iVJTtVY zYGBWjEy4ZysOzT2oMiDXFW3ODo+kepGu08BOpri3+p8wWu9zNV75RJ2zH0QVlXgf3wd du4A== X-Gm-Message-State: APjAAAWRLpzvVingOzXQSfoIhvozWZmK0VzhncXezINdj1ZcKE9bCCvD SMSGLXjlu8ELRqfof/V8f/Q= X-Received: by 2002:a17:902:9a95:: with SMTP id w21mr35838273plp.118.1552340816219; Mon, 11 Mar 2019 14:46:56 -0700 (PDT) Received: from sultan-box.localdomain (campus-007-074.ucdavis.edu. [168.150.7.74]) by smtp.gmail.com with ESMTPSA id s18sm9312788pfh.71.2019.03.11.14.46.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Mar 2019 14:46:55 -0700 (PDT) Date: Mon, 11 Mar 2019 14:46:51 -0700 From: Sultan Alsawaf To: Joel Fernandes Cc: Suren Baghdasaryan , Michal Hocko , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Christian Brauner , Ingo Molnar , Peter Zijlstra , LKML , devel@driverdev.osuosl.org, linux-mm , Tim Murray Subject: Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android Message-ID: <20190311214651.GA882@sultan-box.localdomain> References: <20190310203403.27915-1-sultan@kerneltoast.com> <20190311174320.GC5721@dhcp22.suse.cz> <20190311175800.GA5522@sultan-box.localdomain> <20190311204626.GA3119@sultan-box.localdomain> <20190311211125.GA127617@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190311211125.GA127617@google.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 11, 2019 at 05:11:25PM -0400, Joel Fernandes wrote: > But the point is that a transient temporary memory spike should not be a > signal to kill _any_ process. The reaction to kill shouldn't be so > spontaneous that unwanted tasks are killed because the system went into > panic mode. It should be averaged out which I believe is what PSI does. In my patch from the first email, I implemented the decision to kill a process at the same time that the existing kernel OOM killer decides to kill a process. If the kernel's OOM killer were susceptible to killing processes due to transient memory spikes, then I think there would have been several complaints about this behavior regardless of which userspace or architecture is in use. I think the existing OOM killer has this done right. The decision to kill a process occurs after the page allocator has tried _very_ hard to satisfy a page allocation via alternative means, such as utilizing compaction, flushing file-backed pages to disk via kswapd, and direct reclaim. Once all of those means have failed, it is quite reasonable to kill a process to free memory. Trying to wait out the memory starvation at this point would be futile. Thanks, Sultan