Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5931289yba; Thu, 11 Apr 2019 08:36:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8cF+0lBXCBLMiCkLBJ8Bi7nQ8mQLbTTlXo03Gh3tP6K/ApR+1BBVPE8bhx95onKCD9ImH X-Received: by 2002:a63:6503:: with SMTP id z3mr42325068pgb.113.1554996997877; Thu, 11 Apr 2019 08:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554996997; cv=none; d=google.com; s=arc-20160816; b=sn+eSZkd2cAUkwXefgT1uTxRsZBDom46rMrbZ/IzDoqjbVYtOZe4G1DyVXNHJRaACp UU5a1hFc/5hK2c8u8/Mfr3sGX8IPngBvi+c2pUpETAESMajIfV/XS+URxo28C/mQYsfZ q/hAaHbVJG2+pEt27GvOzTE4XPfuVll0YRDarQPrSJYxd/Yj743XMBnr6YX+AJSAdMOa m3mSod4+LHOm/5UozJK/EBw641dknpinclebewdNni0eZXtr1DdcbOcUCwnQTVs/W1bt +8VKd7SPVWngKV8H3K2i0mFTI2Bl91PmiLcKojphGUPoypqGacBPqUwzZGyDjQxx3ieI l1RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=wA/Cn3a1KpWMhrPejnVrHrnQhy/DaRHrDxTRg9jzhL0=; b=kgde9j6Nn4lMgW/urhfD9Ozu3b75YGgszn/K5YrdWg66Fy/kzWPa6yxSgZy2aAN/BN YzlmGmQpIJHkmjUNGSrCuJ9BTq0fH5af/Eil+KKz4ssC1jknIluD1B8kni6Ue3W7Ta8F 8mgMrWNXP1xkV5V6EX1Qa+SMDcfHPZakzkDx93SwvcxNl6vDYkJTOZNVNDgqcgu+1E1z MP2FFHj91ZH8G+Lr2ppQf6ZH/+0yI9RDDfioaUmI4fUpBGVMIYrXUinprxE/ZvQsdUry n8g4pEasxoY8D81+JUz5Aue9rD0murJ6kHPMC9Sjk1/xHspKwVRSl5zG4p9J6Ddy+RyX LkPQ== 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=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si34312025pgc.225.2019.04.11.08.36.21; Thu, 11 Apr 2019 08:36:37 -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=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726968AbfDKPfL (ORCPT + 99 others); Thu, 11 Apr 2019 11:35:11 -0400 Received: from relay.sw.ru ([185.231.240.75]:42926 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbfDKPfL (ORCPT ); Thu, 11 Apr 2019 11:35:11 -0400 Received: from [172.16.25.169] by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1hEbjA-0003Qf-Fc; Thu, 11 Apr 2019 18:35:00 +0300 Subject: Re: [RFC PATCH 0/2] mm/memcontrol: Finer-grained memory control To: Waiman Long , Tejun Heo , Li Zefan , Johannes Weiner , Jonathan Corbet , Michal Hocko , Vladimir Davydov Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Roman Gushchin , Shakeel Butt , aryabinin@virtuozzo.com References: <20190410191321.9527-1-longman@redhat.com> <1b6ee304-6176-15a0-c3fa-0b59cdd60085@virtuozzo.com> From: Kirill Tkhai Message-ID: Date: Thu, 11 Apr 2019 18:35:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11.04.2019 17:55, Waiman Long wrote: > On 04/11/2019 10:37 AM, Kirill Tkhai wrote: >> On 10.04.2019 22:13, Waiman Long wrote: >>> 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. >>> >>> We have customer request to limit memory consumption on anonymous memory >>> only as they said the feature was available in other OSes like Solaris. >>> >>> To allow finer-grained control of memory, this patchset 2 new control >>> knobs for memory controller: >>> - memory.subset.list for specifying the type of memory to be under control. >>> - memory.subset.high for the high limit of memory consumption of that >>> memory type. >>> >>> For simplicity, the limit is not hierarchical and applies to only tasks >>> in the local memory cgroup. >>> >>> Waiman Long (2): >>> mm/memcontrol: Finer-grained control for subset of allocated memory >>> mm/memcontrol: Add a new MEMCG_SUBSET_HIGH event >>> >>> Documentation/admin-guide/cgroup-v2.rst | 35 +++++++++ >>> include/linux/memcontrol.h | 8 ++ >>> mm/memcontrol.c | 100 +++++++++++++++++++++++- >>> 3 files changed, 142 insertions(+), 1 deletion(-) >> CC Andrey. >> >> In Virtuozzo kernel we have similar functionality for limitation of page cache in a cgroup: >> >> https://github.com/OpenVZ/vzkernel/commit/8ceef5e0c07c7621fcb0e04ccc48a679dfeec4a4 > > It will be helpful to know the use case where you want to limit page > cache usage. I have anonymous memory in mind when I compose this patch, > but I make the mechanism more generic so that it can apply to other use > cases as well. We have distributed storage, and there are its daemons on every host. There are replication factor 1:N, so the same block may be duplicated on different hosts. They produce a lot of pagecache, but it is reused not often (because of the above 1:N). So, we want to limit pagecache, but do not limit anon memory. This prevents global reclaim, and we found this improves our performance tests. Kirill