Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2293160imc; Tue, 12 Mar 2019 10:45:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzS2t0RxWXvXO9czQnC39J5mJy0uX9fs1RWx5x3ovs+icfDrtTWJ6bVV9O9DHZAAWmlN5Xu X-Received: by 2002:a17:902:b708:: with SMTP id d8mr40000946pls.322.1552412707867; Tue, 12 Mar 2019 10:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552412707; cv=none; d=google.com; s=arc-20160816; b=orDquzXmCGBvtZ6HF0hFEnkk2bNR6+MFRpWLyZl4wm0YlCCTIvlw0/WwFCVGecGXC5 qX6IgdOy4HKslL4s/2gTfWwRIj7N5DRe1/gwZZa/zR7ZTtJ0GZKkQ5u1hPNN9BKM9ngB yh/7wCLUKkVovGb/WNlvHRCaapWnzFWrJlZl/imivl8GAWHBwNOj+RikYNy9OX1USSp1 ureLx1JwboVTmmZIhsj1r763Jkw91qQN+DwoRfgMTLPBOJlr3imv2FFZqQazLXEzr4lc bTtisyN+QDPDv933Bkn2nJPjx9XA5qtYQquyuMbRqBAMz95i+otghTts24VaMFtHIiE7 AOGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JJNmxFq4kvtgDMxGW5EQZmwTBHXCE8cD8UO0j6EqecE=; b=aW9lX+ck8qQVrR/+pC1IOO+tHYnooS56grtSH8xGBvl0nsx5RKdA+F9ljL9p0wrPX8 o4asy8VJDF3OVl8jLQLVUb2qsEJt4LZaBihxDkCeE0bcAJ2i/Hxo6ETOUrIoWc34ZEY3 jQm0DUqb2wamn+JiVToD6HZcOus+cbqy+L4MgYLx9oMR461C/vq1ZMASmUSt+DAqzpwG tD9m11nAujeuqPk+cvEcRvcmL0fImchnCkVtq2zuv33mkTvWIuVv+l4tto7JeseimGz6 1KU+ZztAMu+vP+OifPglt3MvztdAOgfDIEKslp95ovfVQWtYx2AHmNpK5L4/wO9/IKHb lAlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eICtM3WJ; 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 q1si6585438pgp.495.2019.03.12.10.44.52; Tue, 12 Mar 2019 10:45: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; dkim=pass header.i=@google.com header.s=20161025 header.b=eICtM3WJ; 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 S1729042AbfCLRmn (ORCPT + 99 others); Tue, 12 Mar 2019 13:42:43 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:35215 "EHLO mail-wm1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728909AbfCLRPz (ORCPT ); Tue, 12 Mar 2019 13:15:55 -0400 Received: by mail-wm1-f54.google.com with SMTP id y15so3508129wma.0 for ; Tue, 12 Mar 2019 10:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JJNmxFq4kvtgDMxGW5EQZmwTBHXCE8cD8UO0j6EqecE=; b=eICtM3WJdg7Bq7C7keVDYg0CrinSY8xGGeQG45rEmu59uiZfjFMczd9uA/UYhoAK+g hCH2sfdCvx95nRGUSuHYhXxnYObCMQL27F3dvIFV/nD0pkzS+RWsuLvO20H3uohxUK8Q bFWGc02dYBQDpx9KIr9IkMTpmmOLw6OjlJlPjDrBDeBbHlAJFaklVRj5VOu0U31Btj3D Y2PvQxG1UvzKcsj7by517lkcVQ00sM0No4sycN/PgwxHIT9WthtTO4uSpYByiS94nf9g UJ6r3xqwjS105/10FTzY8I8djkMo+4TPDnzH9B4ZzIGH0kaWVK0ouPit1AgkSDsEVjT0 4K0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JJNmxFq4kvtgDMxGW5EQZmwTBHXCE8cD8UO0j6EqecE=; b=NghbaTMhb5AqeRI5htT7nYTF8qtt8rg6TqsO078qkO1Br6c2jmeIxSVVHmyAbsRE3r 9/1EuPSWAhpjYywoEUW9S/9rGd2lMs2ELaNBv5sRothT5afPxn5tpWMc26zJE+oIyRB2 TscW0qKVW9wA267b/H4NZzMlybvaXcxFu/QAYt2TEmUxpMlBlESr865s2u4mqlafAme6 YxD5fImQ53ge58BZimldZ8b8rak5DZmY41EP46aClFs23o0JsGUMKeQj0aLrKiRFx+Ay G2fB2AJdG82Z4SKEw1Xl5P/tKcS4VyxpQr+GnFa0EQ2eEDqofYOjd7rWInEIoUmLysvM YX6w== X-Gm-Message-State: APjAAAXMSIT2Zz7xFsyl31KTFv3MSeWe1s07uf+aCr/L4/VkexVUi5JS Jor2hkfpMjEqu+6Qn1S2HrljPlxzklii6XRCK+cuMg== X-Received: by 2002:a05:600c:2115:: with SMTP id u21mr3406355wml.70.1552410952458; Tue, 12 Mar 2019 10:15:52 -0700 (PDT) MIME-Version: 1.0 References: <20190310203403.27915-1-sultan@kerneltoast.com> <20190311174320.GC5721@dhcp22.suse.cz> <20190311175800.GA5522@sultan-box.localdomain> <20190311204626.GA3119@sultan-box.localdomain> <20190312080532.GE5721@dhcp22.suse.cz> <20190312163741.GA2762@sultan-box.localdomain> <20190312165805.GF5721@dhcp22.suse.cz> In-Reply-To: <20190312165805.GF5721@dhcp22.suse.cz> From: Suren Baghdasaryan Date: Tue, 12 Mar 2019 10:15:40 -0700 Message-ID: Subject: Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android To: Michal Hocko Cc: Sultan Alsawaf , Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Ingo Molnar , Peter Zijlstra , LKML , devel@driverdev.osuosl.org, linux-mm , Tim Murray Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 12, 2019 at 9:58 AM Michal Hocko wrote: > > On Tue 12-03-19 09:37:41, Sultan Alsawaf wrote: > > I have not had a chance to look at PSI yet, but > > unless a PSI-enabled solution allows allocations to reach the same point as when > > the OOM killer is invoked (which is contradictory to what it sets out to do), LMK's job is to relieve memory pressure before we reach the boiling point at which OOM killer has to be invoked. If we wait that long it will definitely affect user experience. There might be usecases when you might not care about this but on interactive systems like Android it is important. > > then it cannot take advantage of all of the alternative memory-reclaim means > > employed in the slowpath, and will result in killing a process before it is > > _really_ necessary. I guess it's a matter of defining when is it _really_ necessary to kill. In Android case that should be when the user starts suffering from the delays caused by memory contention and that delay is exactly what PSI is measuring. > One more note. The above is true, but you can also hit one of the > thrashing reclaim behaviors and reclaim last few pages again and again > with the whole system really sluggish. That is what PSI is trying to > help with. > -- > Michal Hocko > SUSE Labs