Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp557867imc; Sun, 10 Mar 2019 14:04:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvd7XYlzlwkmb5CHivYZan2TvHAlSnGcaQkOmkWfvg1R+Rl+qXeigXFhx0gcL7XwZnN3RQ X-Received: by 2002:a17:902:6b08:: with SMTP id o8mr30235180plk.105.1552251860126; Sun, 10 Mar 2019 14:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552251860; cv=none; d=google.com; s=arc-20160816; b=hwUCkrZXk9URwewULgfbOwM/fSDGsyuvb80ZCQiu+MjRWEvXvEnlUVPYFV+ABqeKrx 20pNJGRygjDW5GTKtHIBPH8WTM80ag8t4muCXfXlunDmOdyrLMHgTfNutPnca5sJmPgL 00r/TrmdiXMtvsgTMFsd5n10vnXrXNPxBugCJZU4bTVAByBsDP7TYSPie82n/liLpTXj B6/Na8APJlwBBK0FhnMgfIkhCUv0rC7eARpFNb8gycUYyMWdpkBTI/yoRbNDGWzPGId2 n1IzO3arkoDdePNpU12Tx1ld18h7NV/VqJtDOhZZlTjAgZSSzJueiJJS/OtBacg3rzbR fvzQ== 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:dkim-signature; bh=oScQXXzn/QCgZCgzcut/WM/f5LNzl/KH38WofbO0suI=; b=G7iDLiJpKypy7WBUUJ36m7bBa69lSSqXqEwJxTc2VEWwv4GeLuGtt+U1wPm4TF4ysf mmJCX7u9TD0zxigtKs6k4ZioiCAvsmo477hx/Tio7ReZLwD6+epWZPGMTlVWUrMgB5T4 aLIjy09Vbtiul3LsBF2tQa7umLdzhA6zf/YdSNEpBcThsGGGdAALmesLJH+n47Td96k1 sVc/Q7m66Db6105kkU4BLVcEe+5fEGzBjSjg6EIAwLMH8UC8gg01gnYoSZ0JIXY5dqXk KTvaEvLmQleaoWGroKexapxxvjb64OznIPgdV7ToDNv0339tDZFq/rHvbs2SsDvAw/0r NUnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w0J12NO7; 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 a16si3338441pgw.75.2019.03.10.14.04.04; Sun, 10 Mar 2019 14:04:20 -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=@kernel.org header.s=default header.b=w0J12NO7; 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 S1726687AbfCJVDp (ORCPT + 99 others); Sun, 10 Mar 2019 17:03:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:38816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725770AbfCJVDo (ORCPT ); Sun, 10 Mar 2019 17:03:44 -0400 Received: from localhost (unknown [104.153.224.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EB108206BA; Sun, 10 Mar 2019 21:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552251823; bh=q0PUVwOut6IVrnZMVAnvSVuPugbFv1l0jGrQRBXv2MY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=w0J12NO7pJBumbfQjHBiN3c7+guKb1CsNQER8w6nokTEfrC3lHAyuqSc6KiDMXPSO vxgIkAy0avn0LAFTGqfqezpRqDKfvPbTGUIe4UZIlB2GG6GugnIxTWg/gs+LhAxkfm 0jEf+AO0gd6VPsDh/wC81p9mKudaiP+LJ8KgydGk= Date: Sun, 10 Mar 2019 22:03:35 +0100 From: Greg Kroah-Hartman To: Sultan Alsawaf Cc: Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-mm@kvack.org, Suren Baghdasaryan , Tim Murray Subject: Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android Message-ID: <20190310210335.GA5504@kroah.com> References: <20190310203403.27915-1-sultan@kerneltoast.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190310203403.27915-1-sultan@kerneltoast.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 Sun, Mar 10, 2019 at 01:34:03PM -0700, Sultan Alsawaf wrote: > From: Sultan Alsawaf > > This is a complete low memory killer solution for Android that is small > and simple. It kills the largest, least-important processes it can find > whenever a page allocation has completely failed (right after direct > reclaim). Processes are killed according to the priorities that Android > gives them, so that the least important processes are always killed > first. Killing larger processes is preferred in order to free the most > memory possible in one go. > > Simple LMK is integrated deeply into the page allocator in order to > catch exactly when a page allocation fails and exactly when a page is > freed. Failed page allocations that have invoked Simple LMK are placed > on a queue and wait for Simple LMK to satisfy them. When a page is about > to be freed, the failed page allocations are given priority over normal > page allocations by Simple LMK to see if they can immediately use the > freed page. > > Additionally, processes are continuously killed by failed small-order > page allocations until they are satisfied. > > Signed-off-by: Sultan Alsawaf Wait, why? We just removed the in-kernel android memory killer, we don't want to add another one back again, right? Android Go devices work just fine with the userspace memory killer code, and those are "low memory" by design. Why do we need kernel code here at all? thanks, greg k-h