Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3679546yba; Tue, 7 May 2019 05:28:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzg8kNMj0SQ6NTiLBlflb74/5ycSqtBY0WHQrL84Xj2rlAMNMnEPoCHdYRB466D/Kwg2uTA X-Received: by 2002:a65:6205:: with SMTP id d5mr39696230pgv.61.1557232086614; Tue, 07 May 2019 05:28:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557232086; cv=none; d=google.com; s=arc-20160816; b=NwUXgtzkOcYM6OcgPaRe3gKLRQbSp9/WWmxUNsuH/pWut80Jj7+v1VRJI8mpkCgHpj sMhrYvYqj5ZNtZez02++pKqAib++PTg9bb0RGI1PF6ZcMNlo6gH1Tmcx6pa1w1NxFwOW 5q4KaMYxd7HUqZPd7H7Vnz2Hm5K737/To7KHKnFoAhr4qs8++b+twxnxqRe1hKsOvH+2 57tCPH+4lse1T5M3pcwq2IksMFL/1s32FmAl+/jBwyYc3lVpi8jyjRRqbZmutNTolwJI rROnqAXk+TSXqWVtoujIdwKTOR6DP1hJ32id0gRBaUBT4TQP6sMH5d9VjDmQlHhcJ5Xs z+yg== 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=TQJGh89jqr7YwcON0kZF1qO2P0193iEg9GyRYpzZSEo=; b=yAkx4q+j0Y3nj3mP9BwzrBNqAZ2NU/xTqj9e6UUa0qu3vnA9yIPPH11jJ3gwsoWtpH OFi2Ni7qXyjwkWjoysNE4ffWJpLM8sgFnwtRHziz0JcEV8Ghv+9PKIfNjWEwas+J/GdQ ll2w/6FRLPQ0Xv+xje7pNHVhvT8ZJW6hVaKkKPiuw/8LIMMzX8ql0Yr9jilLDuMZ62qP dtKVC3kUc6MqXw3CQJTv33fswzDHOm37IxJkRWLEONmsCoxIJYBwVykOlffeZxo4ChN6 9Sho7MRpyAjf/lW1IKod+QslSo9hzXRBwghSu0EB3vEHxEz2Gc3fLyZasRy8zKT3XlCZ vErQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d137si8870212pga.23.2019.05.07.05.27.50; Tue, 07 May 2019 05:28:06 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726667AbfEGM0S (ORCPT + 99 others); Tue, 7 May 2019 08:26:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:54678 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726404AbfEGM0S (ORCPT ); Tue, 7 May 2019 08:26:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DEFD9AC3B; Tue, 7 May 2019 12:26:16 +0000 (UTC) Date: Tue, 7 May 2019 14:26:15 +0200 From: Michal Hocko To: Sultan Alsawaf Cc: Christian Brauner , Daniel Colascione , Suren Baghdasaryan , Steven Rostedt , Tim Murray , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Ingo Molnar , Peter Zijlstra , LKML , "open list:ANDROID DRIVERS" , linux-mm , kernel-team , Oleg Nesterov , Andy Lutomirski , "Serge E. Hallyn" , Kees Cook , Joel Fernandes Subject: Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android Message-ID: <20190507122615.GQ31017@dhcp22.suse.cz> References: <20190317015306.GA167393@google.com> <20190317114238.ab6tvvovpkpozld5@brauner.io> <20190318002949.mqknisgt7cmjmt7n@brauner.io> <20190318235052.GA65315@google.com> <20190319221415.baov7x6zoz7hvsno@brauner.io> <20190319231020.tdcttojlbmx57gke@brauner.io> <20190320015249.GC129907@google.com> <20190507021622.GA27300@sultan-box.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190507021622.GA27300@sultan-box.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 06-05-19 19:16:22, Sultan Alsawaf wrote: > This is a complete low memory killer solution for Android that is small > and simple. Processes are killed according to the priorities that > Android gives them, so that the least important processes are always > killed first. Processes are killed until memory deficits are satisfied, > as observed from kswapd struggling to free up pages. Simple LMK stops > killing processes when kswapd finally goes back to sleep. > > The only tunables are the desired amount of memory to be freed per > reclaim event and desired frequency of reclaim events. Simple LMK tries > to free at least the desired amount of memory per reclaim and waits > until all of its victims' memory is freed before proceeding to kill more > processes. Why do we need something like that in the kernel? I really do not like an idea of having two OOM killer implementations in the kernel. As already pointed out newer kernels can do PSI and older kernels can live with an out of tree code to achieve what they need. I do not see why we really need this code in the upstream kernel. -- Michal Hocko SUSE Labs