From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754753AbcFQHYy (ORCPT ); Fri, 17 Jun 2016 03:24:54 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34162 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750774AbcFQHYx (ORCPT ); Fri, 17 Jun 2016 03:24:53 -0400 Subject: Re: [PATCH v1 3/3] mm: per-process reclaim To: Johannes Weiner , Minchan Kim References: <1465804259-29345-1-git-send-email-minchan@kernel.org> <1465804259-29345-4-git-send-email-minchan@kernel.org> <20160613150653.GA30642@cmpxchg.org> Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Rik van Riel , Sangwoo Park From: Balbir Singh Message-ID: <0627865b-e261-d1ba-c9f2-56e8f4479d57@gmail.com> Date: Fri, 17 Jun 2016 17:24:46 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160613150653.GA30642@cmpxchg.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/06/16 01:06, Johannes Weiner wrote: > Hi Minchan, > > On Mon, Jun 13, 2016 at 04:50:58PM +0900, Minchan Kim wrote: >> These day, there are many platforms available in the embedded market >> and sometime, they has more hints about workingset than kernel so >> they want to involve memory management more heavily like android's >> lowmemory killer and ashmem or user-daemon with lowmemory notifier. >> >> This patch adds add new method for userspace to manage memory >> efficiently via knob "/proc//reclaim" so platform can reclaim >> any process anytime. > > Cgroups are our canonical way to control system resources on a per > process or group-of-processes level. I don't like the idea of adding > ad-hoc interfaces for single-use cases like this. > > For this particular case, you can already stick each app into its own > cgroup and use memory.force_empty to target-reclaim them. > > Or better yet, set the soft limits / memory.low to guide physical > memory pressure, once it actually occurs, toward the least-important > apps? We usually prefer doing work on-demand rather than proactively. > > The one-cgroup-per-app model would give Android much more control and > would also remove a *lot* of overhead during task switches, see this: > https://lkml.org/lkml/2014/12/19/358 Yes, I'd agree. cgroups can group many tasks, but the group size can be 1 as well. Could you try the same test with the recommended approach and see if it works as desired? Balbir Singh