Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1975279ybh; Fri, 24 Jul 2020 00:56:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFR5yWfHOgLj0S9XDHzpiNIpL6kVER5GNmv2s+gDx5BmDM6oIXlWVCPgpuXWhc5pDUZ+OP X-Received: by 2002:a17:906:94c4:: with SMTP id d4mr7896067ejy.232.1595577383038; Fri, 24 Jul 2020 00:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595577383; cv=none; d=google.com; s=arc-20160816; b=SxWxH+i5jZOYm2DLFw6f7yMiPoxerKExi4ZGs80ZGnBsAY5IYiNcUOVwcTuKaeoCh2 kuCBAptsqHNKsx9gTxnGpRNSV+DdxuYqwlsX+S3W0xQ9STR09xP2Ogh6GPrY/djG+yN6 krZoWbwGlvcUqgdP11jKPCChNuyG69419bTb9Z9dy0kZ/cKOJVnQgfLtDL1XOl7FsHlp 9kMjKbmT65W5EsGoV8hsaYHTGro0cpSS8FiEWFrKZrz3VXbQVEd2VO282L/ybG4BmxoL JItyKXUQNfipvWxuQGoy00o+LN0iEAxt5nXe9Z1osJ8qsfzb7Ze3EB9NeIzZel1kfNFB EviA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=e70l9ba9mmLl+TWNFDLUgGIMDIu+o4DPfsM91eYhnXM=; b=efKTbfNQZN2gw4wpa6NbP4bx8xw7Wl4o0vj6Y/8ZERdy0AnBIwBfBVZezO72vdV7v8 N3FUYKWXPbm8xcxJO46GOjoxulh9rSnc7RcJ505/13g53cHv7QtYcVR+EnDOzLJpC7H8 6opwAKtxlxTe3xDmVJGjHCFEv6e1aLlaIAP9hNT5MSQ6CTMi4/VXEzvIQQXKEAUVwe0u gxNql3+teffDxnqV++hsKRqzXTNAQyLArtRoFCd1ozQdPNpoUr8Ux0M2KNhp9cVNKkiF opp51cMqpRR6CoyxzzvkAUiN1s9MzbDA7GkhAh6CW8gpzSh8/bXYwUnmldC8Kfo2qUvT UPkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p90si59814edd.468.2020.07.24.00.56.00; Fri, 24 Jul 2020 00:56:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726826AbgGXHzN (ORCPT + 99 others); Fri, 24 Jul 2020 03:55:13 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:40288 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726543AbgGXHzM (ORCPT ); Fri, 24 Jul 2020 03:55:12 -0400 Received: by mail-ed1-f67.google.com with SMTP id b13so3979978edz.7; Fri, 24 Jul 2020 00:55:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=e70l9ba9mmLl+TWNFDLUgGIMDIu+o4DPfsM91eYhnXM=; b=RehVI9sOPDqGaihTBK6zUKk3HigDD1jDXSWyvsME50oIf2lN7GnF1Lk2+mfkCffjV9 nQ9Ir30SQQMNlycksmbyYnrWLfY+VtfYkcD7eI98JjiEaQdGbChxQrBqDmH4JC51x5HB BgqBEEFLPdsdmTzKnRSVOLrm4I3bh5BmfuzuGXf9XbovtN30rVhCZmZoxVobPBwk98oH F6bczcSMSLjnPyouY6y8S8A/+uTErApKW6VOJX7qSiv2ngOd7gP5hFpxKwRHl4ILtDEj G2Qebb0++mTA1tmBSwupk0r8lx4GnEZUnAXEqM1HLACP68JyB8vK4gmwd2DyDMYUulg9 p/Uw== X-Gm-Message-State: AOAM532vddqNqKTqIRmWuWHB2TsoqXGiSE8dEjcMBGkm4Rmjme0/rzJX TReRi44MYG61xb8tzlfI7LE= X-Received: by 2002:a05:6402:543:: with SMTP id i3mr7593711edx.182.1595577309758; Fri, 24 Jul 2020 00:55:09 -0700 (PDT) Received: from localhost (ip-37-188-169-187.eurotel.cz. [37.188.169.187]) by smtp.gmail.com with ESMTPSA id v24sm177041eds.71.2020.07.24.00.55.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 00:55:08 -0700 (PDT) Date: Fri, 24 Jul 2020 09:55:08 +0200 From: Michal Hocko To: jingrui Cc: "tj@kernel.org" , Lizefan , "hannes@cmpxchg.org" , "vdavydov.dev@gmail.com" , "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "cgroups@vger.kernel.org" , "linux-kernel@vger.kernel.org" , caihaomin , "Weiwei (N)" Subject: Re: PROBLEM: cgroup cost too much memory when transfer small files to tmpfs Message-ID: <20200724075508.GF4061@dhcp22.suse.cz> References: <2E04DD7753BE0E4ABABF0B664610AD6F2620CAF7@dggeml528-mbx.china.huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2E04DD7753BE0E4ABABF0B664610AD6F2620CAF7@dggeml528-mbx.china.huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 21-07-20 11:19:52, jingrui wrote: [...] > systemd related issue: https://github.com/systemd/systemd/issues/16499 Well, I would be really careful with one-off and short lived cgroups. Firstly there are charges which cannot be easily reparented and secondly even if the memory footprint is reduced there would be still memcgs standing in the way. [...] > 1. Do we have any idea to descrease cgroup memory cost in this case? Others have already commented on this. > 2. When user remove cgroup directory, does it possible associated file memory to root cgroup? We used to do that in the past but removed it by b2052564e66d ("mm: memcontrol: continue cache reclaim from offlined groups"). Please read through the changelog for the reasoning behind. > 3. Can we provide an option that do not associate memory with cgroup in tmpfs? What is the reason to run under !root cgroup in those sessions if you do not care about accounting anyway? tmpfs is a persistent charge until the file is removed. So if those outlive the session then you either want them to be charged to somebody or you do not care about accounting at all, no? Or could you explain your usecase some more? -- Michal Hocko SUSE Labs