From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA961C433DF for ; Fri, 24 Jul 2020 07:55:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A54742068F for ; Fri, 24 Jul 2020 07:55:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A54742068F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2D9CF8D002B; Fri, 24 Jul 2020 03:55:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 288328D0027; Fri, 24 Jul 2020 03:55:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 178BC8D002B; Fri, 24 Jul 2020 03:55:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0137.hostedemail.com [216.40.44.137]) by kanga.kvack.org (Postfix) with ESMTP id 020428D0027 for ; Fri, 24 Jul 2020 03:55:11 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6F34E8248047 for ; Fri, 24 Jul 2020 07:55:11 +0000 (UTC) X-FDA: 77072208822.30.base48_3f09b5526f45 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 3825418012C12 for ; Fri, 24 Jul 2020 07:55:11 +0000 (UTC) X-HE-Tag: base48_3f09b5526f45 X-Filterd-Recvd-Size: 3906 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Fri, 24 Jul 2020 07:55:10 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id d16so6333214edz.12 for ; 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=gAbNwN357cV7YSbRy94ghpVObqgdATs1XGSJhkWBHyypAym3fRm+yZRX0stYw4VIzp IFyP/9Cg7clf2xYkt8EyFfvG9lzCHnMumpbNsPUaBK17TlApIplrpXzFcI+BfJ4Ft+vw LVW80qYuJL9O60pqvNrjS3B+eCMZZOgZJ6f8rwPGF546Y/4AjHIZmMtVE+hlCpa4JR/3 YTOhNlp47A028bCA4KDsLR096uzyLwLWJea887bZVTBpu5rGdxhYE0Ufy/dXgXZQltr8 vSTxr4DlnKdm5PUa/RI1VJ8ykiwpnWAFBzSeFhvd6KjzsJOQLvO+swLV6UXoQZw7yeUo BsUw== X-Gm-Message-State: AOAM530/YYUaybsrOzbCBmMr3TNBa/blndc/LAGDpyRxQ/eHiAOWxAEO zE6ifZ+9Y9cwccOlSY1Nboo= X-Google-Smtp-Source: ABdhPJzkk92oCWYAtda9S7hO0B5/oUAWrHAG7N5UefVeITgPKIDsZZG4CdNxAhZpGy+FhhxcWLljmQ== 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> X-Rspamd-Queue-Id: 3825418012C12 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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