Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5865806yba; Thu, 11 Apr 2019 07:23:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrMnr/tecCf8btQ9TjogWqp5P4/JKjWLQu1FeRnY049R80vSFOYGF42DiTEqmhywq5BgQ2 X-Received: by 2002:a17:902:8bc3:: with SMTP id r3mr51688226plo.53.1554992605292; Thu, 11 Apr 2019 07:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554992605; cv=none; d=google.com; s=arc-20160816; b=EAeHKVrJGKVBc3fG+qQKE66IeBHuq6JxueJiGWJ8S595sKQsvYwPzlZKL9beSS8bJc j4Z5IS6UdULNgvsFBUSglvz0ojvWMb2lPqrOIDmuufVOSJSRRMQCrwc0ARnnLCZzffii Qc1DwecmJaYrXWSZ2F7vKNgsp+FiaHV46bwSjWyBkWCREeaP0hWxk+G3m+O02Y+f9CPt ViSO32v5IpKVFngu0uyd3q+mezbNGq20BuDfKfwqRttp+Ds2iB6ONNw1jgx0xtDOErCi XKh0g8uW/WcbS1mmDUpUQYoVv41NBkmMbTp1zK+Y4LgdrkG8qtNjyQWRmWK9HUxsJI5s p1nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject; bh=dZ6CQuNPI9nTSmHeuYkaWUTcPzv7xLSC1PsgGO+RqxM=; b=kLIwOUMUuYu2YLO5oJR0PDctq+aRoR3/wvvYpl+n6qrS9mV8UOap+Ub1rLBKrLxKrP QqYNWCo4Rd8msnZ3fJgGY2ShXotZ6V8tbAe/AUWV3x2ywssjXq7UbwgmFnfedMBvFGg2 YrFscwajYqJ6iFe/XNnwBV+rptbYXgrBsJKzreVNpMgh4L/Psudy/JCU+7ykmcP56u0b +TAudSN/lIYF6H+yG8EZaT//UbVtGJRrO3mnvEosle5ldNAEBcdNLiyTl5QogB8VsKlR I7ZUO/Ss5FLXzt8uufLFG6z/Bq6oEjwTRHwqxgaBkU212WrSbBVMJ1V35eVlRoua2ZC7 +p3g== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si31433147pgh.516.2019.04.11.07.23.08; Thu, 11 Apr 2019 07:23:25 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbfDKOWe convert rfc822-to-8bit (ORCPT + 99 others); Thu, 11 Apr 2019 10:22:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44764 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfDKOWe (ORCPT ); Thu, 11 Apr 2019 10:22:34 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5010FC7910; Thu, 11 Apr 2019 14:22:28 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-47.bos.redhat.com [10.18.17.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52F6E61B60; Thu, 11 Apr 2019 14:22:23 +0000 (UTC) Subject: Re: [RFC PATCH 0/2] mm/memcontrol: Finer-grained memory control To: Chris Down Cc: Tejun Heo , Li Zefan , Johannes Weiner , Jonathan Corbet , Michal Hocko , Vladimir Davydov , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Roman Gushchin , Shakeel Butt , Kirill Tkhai References: <20190410191321.9527-1-longman@redhat.com> <20190410213824.GA13638@chrisdown.name> From: Waiman Long Openpgp: preference=signencrypt Autocrypt: addr=longman@redhat.com; prefer-encrypt=mutual; keydata= xsFNBFgsZGsBEAC3l/RVYISY3M0SznCZOv8aWc/bsAgif1H8h0WPDrHnwt1jfFTB26EzhRea XQKAJiZbjnTotxXq1JVaWxJcNJL7crruYeFdv7WUJqJzFgHnNM/upZuGsDIJHyqBHWK5X9ZO jRyfqV/i3Ll7VIZobcRLbTfEJgyLTAHn2Ipcpt8mRg2cck2sC9+RMi45Epweu7pKjfrF8JUY r71uif2ThpN8vGpn+FKbERFt4hW2dV/3awVckxxHXNrQYIB3I/G6mUdEZ9yrVrAfLw5M3fVU CRnC6fbroC6/ztD40lyTQWbCqGERVEwHFYYoxrcGa8AzMXN9CN7bleHmKZrGxDFWbg4877zX 0YaLRypme4K0ULbnNVRQcSZ9UalTvAzjpyWnlnXCLnFjzhV7qsjozloLTkZjyHimSc3yllH7 VvP/lGHnqUk7xDymgRHNNn0wWPuOpR97J/r7V1mSMZlni/FVTQTRu87aQRYu3nKhcNJ47TGY evz/U0ltaZEU41t7WGBnC7RlxYtdXziEn5fC8b1JfqiP0OJVQfdIMVIbEw1turVouTovUA39 Qqa6Pd1oYTw+Bdm1tkx7di73qB3x4pJoC8ZRfEmPqSpmu42sijWSBUgYJwsziTW2SBi4hRjU h/Tm0NuU1/R1bgv/EzoXjgOM4ZlSu6Pv7ICpELdWSrvkXJIuIwARAQABzR9Mb25nbWFuIExv bmcgPGxsb25nQHJlZGhhdC5jb20+wsF/BBMBAgApBQJYLGRrAhsjBQ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2NEJjJwwnRBStjJOGQX4lV1uhN1XsZjBbRHdKF2W9g weim8xU= Organization: Red Hat Message-ID: Date: Thu, 11 Apr 2019 10:22:22 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190410213824.GA13638@chrisdown.name> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 11 Apr 2019 14:22:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/10/2019 05:38 PM, Chris Down wrote: > Hi Waiman, > > Waiman Long writes: >> The current control mechanism for memory cgroup v2 lumps all the memory >> together irrespective of the type of memory objects. However, there >> are cases where users may have more concern about one type of memory >> usage than the others. > > I have concerns about this implementation, and the overall idea in > general. We had per-class memory limiting in the cgroup v1 API, and it > ended up really poorly, and resulted in a situation where it's really > hard to compose a usable system out of it any more. > > A major part of the restructure in cgroup v2 has been to simplify > things so that it's more easy to understand for service owners and > sysadmins. This was intentional, because otherwise the system overall > is hard to make into something that does what users *really* want, and > users end up with a lot of confusion, misconfiguration, and generally > an inability to produce a coherent system, because we've made things > too hard to piece together. > > In general, for purposes of resource control, I'm not convinced that > it makes sense to limit only one kind of memory based on prior > experience with v1. Can you give a production use case where this > would be a clear benefit, traded off against the increase in > complexity to the API? > As I said in my previous email on this thread, the customer considered pages cache as common goods not fully representing the "real" memory footprint used by an application.  Depending on actual mix of applications running on a system, there are certainly cases where their view is correct. In fact, what the customer is asking for is not even provided by the v1 API even with that many classes of memory that you can choose from. >> For simplicity, the limit is not hierarchical and applies to only tasks >> in the local memory cgroup. > > We've made an explicit effort to make all things hierarchical -- this > confuses things further. Even if we did have something like this, it > would have to respect the hierarchy, we really don't want to return to > the use_hierarchy days where users, sysadmins, and even ourselves are > confused by the resource control semantics that are supposed to be > achieved. I see your point. I am now suggesting that this new feature is limited to just leaf memory cgroup for now. We can extend it to full hierarchical support in the future if necessary. > >> We have customer request to limit memory consumption on anonymous memory >> only as they said the feature was available in other OSes like Solaris. > > What's the production use case where this is demonstrably providing > clear benefits in terms of resource control? How can it compose as > part of an easy to understand, resource controlling system? I'd like > to see a lot more information on why this is needed, and the usability > and technical tradeoffs considered. Simply put, the customers want to control and limit memory consumption based on the anonymous memory (RSS) that are used by the applications. This was what they were doing in the past and their tooling was based on this. They want to continue doing that after migrating to Linux. Adding page cache into the mix and they don't know how they should handle that. Cheers, Longman