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=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 6C4B8C43465 for ; Mon, 21 Sep 2020 10:43:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D870A214F1 for ; Mon, 21 Sep 2020 10:43:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="O11nMcko" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D870A214F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EE7DE6B00C5; Mon, 21 Sep 2020 06:43:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E98996B00C6; Mon, 21 Sep 2020 06:43:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D8B6E6B00C7; Mon, 21 Sep 2020 06:43:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0136.hostedemail.com [216.40.44.136]) by kanga.kvack.org (Postfix) with ESMTP id C3B4D6B00C5 for ; Mon, 21 Sep 2020 06:43:00 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7A107181AC9CC for ; Mon, 21 Sep 2020 10:43:00 +0000 (UTC) X-FDA: 77286730920.18.vest03_1e0f42827144 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 514B9100EC662 for ; Mon, 21 Sep 2020 10:43:00 +0000 (UTC) X-HE-Tag: vest03_1e0f42827144 X-Filterd-Recvd-Size: 4301 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Mon, 21 Sep 2020 10:42:59 +0000 (UTC) Received: by mail-wr1-f49.google.com with SMTP id m6so12218590wrn.0 for ; Mon, 21 Sep 2020 03:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mzDmB01mMTFr74qOHeLrNegprGQDAJ8oYYgiRLXCsfc=; b=O11nMckorO8RMfFQjnz4Yfr97uv13nR1YIQqRQMKzLSmqJpsduBq1wuChdnYF707Mt f/+wj7eFGyW12GAkCjm1muhOnRzjr3f5wjz14zI1gA1i+jm88cGKWNawNgUyFfmCT2kU 8fNAJ+9t7L+udORk1K93NKpZp7DBuwsh4+SiY= 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:user-agent; bh=mzDmB01mMTFr74qOHeLrNegprGQDAJ8oYYgiRLXCsfc=; b=gP5uidvZzyGxSn40LHHrbi0tCIrFMd4TGDpeshGRbsFIXimWTGnoOv3O1E2v4fmSm3 hnrHzqudPzWwMCfnKoqwsqXsJ5OkoHDSTUaCv+R3W+BrKZ7bw7kD1z49gSlAvg1/CYIr fCbFOTu9H9LK24+osS3rrXY5OKDUY7if9+k+fh0tOdcifeWEjcoqzRH/sXRlxCXkimx7 QTiexlfLfnV/7RICGNHc55xUfkRLoRaJGUzPz0zTb+IbDfsnRJeCA0a4KjJTjAqhZdYu J6FUXZLFo+pLbZX1tpAxmYCKSMLqRudrlxbSuyV53y1f6iF8R/khzvg2K9DBK3LuWP4F tPvg== X-Gm-Message-State: AOAM531WAzOPZwOwPyRHtRGNwV6CWWwIlLmg2ypl4wVsd1J+lS1AlepX EdVDG0SQGivhDnmr0vs5ViI6KA== X-Google-Smtp-Source: ABdhPJwiFnqrJc0lvNPEfKhVyaRyAOigEBoDGEEBcLdtcns0TD0AiK7aaXUyjI+kL+G3Jmo+frNDCQ== X-Received: by 2002:a5d:61c2:: with SMTP id q2mr55645381wrv.25.1600684978631; Mon, 21 Sep 2020 03:42:58 -0700 (PDT) Received: from localhost ([2a01:4b00:8432:8a00:fa59:71ff:fe7e:8d21]) by smtp.gmail.com with ESMTPSA id g12sm19938335wro.89.2020.09.21.03.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 03:42:58 -0700 (PDT) Date: Mon, 21 Sep 2020 11:42:57 +0100 From: Chris Down To: Michal Hocko Cc: zangchunxin@bytedance.com, hannes@cmpxchg.org, vdavydov.dev@gmail.com, akpm@linux-foundation.org, tj@kernel.org, lizefan@huawei.com, corbet@lwn.net, ast@kernel.org, daniel@iogearbox.net, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com, john.fastabend@gmail.com, kpsingh@chromium.org, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH] mm/memcontrol: Add the drop_cache interface for cgroup v2 Message-ID: <20200921104257.GA632859@chrisdown.name> References: <20200921080255.15505-1-zangchunxin@bytedance.com> <20200921081200.GE12990@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200921081200.GE12990@dhcp22.suse.cz> User-Agent: Mutt/1.14.7 (2020-08-29) 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: Michal Hocko writes: >On Mon 21-09-20 16:02:55, zangchunxin@bytedance.com wrote: >> From: Chunxin Zang >> >> In the cgroup v1, we have 'force_mepty' interface. This is very >> useful for userspace to actively release memory. But the cgroup >> v2 does not. >> >> This patch reuse cgroup v1's function, but have a new name for >> the interface. Because I think 'drop_cache' may be is easier to >> understand :) > >This should really explain a usecase. Global drop_caches is a terrible >interface and it has caused many problems in the past. People have >learned to use it as a remedy to any problem they might see and cause >other problems without realizing that. This is the reason why we even >log each attempt to drop caches. > >I would rather not repeat the same mistake on the memcg level unless >there is a very strong reason for it. I agree with Michal. We already have ways to do best-effort memory release on cgroup v2, primarily with memory.high. Singling out a category of memory for reclaim has historically proved to be a fool's errand.