From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751809AbcFUVK3 (ORCPT ); Tue, 21 Jun 2016 17:10:29 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:36120 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751613AbcFUVK0 (ORCPT ); Tue, 21 Jun 2016 17:10:26 -0400 Date: Tue, 21 Jun 2016 13:14:36 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Ganesh Mahendran cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, arve@android.com, riandrews@android.com Subject: Re: [PATCH 3/3] staging: lowmemorykiller: select the task with maximum rss to kill In-Reply-To: <1466487018-5410-3-git-send-email-opensource.ganesh@gmail.com> Message-ID: References: <1466487018-5410-1-git-send-email-opensource.ganesh@gmail.com> <1466487018-5410-3-git-send-email-opensource.ganesh@gmail.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 21 Jun 2016, Ganesh Mahendran wrote: > Current task selecting logic in LMK does not fully aware of the memory > pressure. It may select the task with maximum score adj, but with > least tasksize. > > For example, if min_score_adj is 200, and there are 2 tasks in system: > task a: score adj 500, tasksize 200M > task b: score adj 1000, tasksize 1M > Current LMK logic will select *task b*. But now the system already have > much memory pressure. > > We should select the task with maximum task from all the tasks which > score adj >= min_score_adj. > Unfortunately, I'm not sure that we can get away with this although I agree that it is a better result (kill a large process, avoid lowmem or oom for longer). It changes the kill order for systems that have already fine-tuned their oom_score_adj settings and can regress because of this change. If systems really want task b to be killed above, this breaks and they have no immediate way of fixing it.