Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3049934pxk; Mon, 21 Sep 2020 04:06:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPgejaraDO4BCFsk3Sh4cDLPMOJsFZhVunximH6YG26hn3DKpiXeVyj2Pf866KeQRL1V7n X-Received: by 2002:a17:906:7f06:: with SMTP id d6mr48317274ejr.553.1600686412478; Mon, 21 Sep 2020 04:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600686412; cv=none; d=google.com; s=arc-20160816; b=kYeP7lwLkiwczTON5cSn8ddwblLjwbWGIx5WQ25XUo3RiADLP9cKiriETO400oyd68 l+crjYychrZbbGdA/NNbWM3y9sFM+Cp8WzyOOfV1WKC06H3wGXVohrBFcPppAFM7KukD J+5QRGuBdPm8+nQ0dzCIHx2A9mKrcC6+04Wtgfhy2hXfXVhXGOoGS/8LoMzEaKgiPFx2 DLug57Irl0oVfg0OcNLkWj8eaqsNDq38HP0KayjJnFET6D9midKtdjcM5xUS3m2Or7T5 Z0yrBxwu+3CAwY1VL29iAZko82ObL2AQP2NIrnWeBpwMxgOOYH1u/VLmiPcDMFw4CaLv Itmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JbHgBz0aomN5pIFfxuOnm8ox/XRaHVRuL/a8R/t+W4A=; b=Xd4/n85WtERuC9SEauvLhyXT0ZUEcEBZMgqW5Ye/b9u0mW5maEG1HG7PkiHljQGUFZ qR6ybYN6KEFoV9vpmIFk8C6Pl2MFV6x9FESHTTUy527GkXhal0JSaCwl0k4Wp/uqVg3c SJV+65573Lmig+uTYkcDFJyZQ18Y4W6lUgiYUUk9kikAfziiNJDKiebcusE1jopK7gQC I9FbxippYTbg3GKR+5yxY1bEtLBaWG6Olqjnti19lz1KpD2dtpONhnJhBK9NTeogL+0j nsokMzb5MIst7lEuH1Vm9rknTttRkK9Qd7RKe7Ht1xAzbtX0/iaAVKpZfyPsi0//gfj7 nlyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="eL+FH/xV"; 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=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gs18si9234907ejb.8.2020.09.21.04.06.28; Mon, 21 Sep 2020 04:06:52 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b="eL+FH/xV"; 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=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbgIULFI (ORCPT + 99 others); Mon, 21 Sep 2020 07:05:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:48524 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbgIULFI (ORCPT ); Mon, 21 Sep 2020 07:05:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1600686306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JbHgBz0aomN5pIFfxuOnm8ox/XRaHVRuL/a8R/t+W4A=; b=eL+FH/xVmyP8IdigcZ5a4u7kHJf6RwmLhlfQwsnfcss6tnGPYKb5I4tNsxdX5ShApxJwD4 PoNov/l7i+HWrjj4fhL8wEUmOToZ/ce5LA7BF7H9V+YAwudUts6p0uOo6Hor6UobHAXM0I BZqmvLSBzfoozCfUeXbV/WJmM/GA+7M= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 71CDBAC23; Mon, 21 Sep 2020 11:05:42 +0000 (UTC) Date: Mon, 21 Sep 2020 13:05:05 +0200 From: Michal Hocko To: Yafang Shao Cc: zangchunxin@bytedance.com, Johannes Weiner , Vladimir Davydov , Andrew Morton , Tejun Heo , lizefan@huawei.com, Jonathan Corbet , Alexei Starovoitov , Daniel Borkmann , kafai@fb.com, Song Liu , Yonghong Song , andriin@fb.com, john.fastabend@gmail.com, kpsingh@chromium.org, Cgroups , linux-doc@vger.kernel.org, Linux MM , LKML , netdev , bpf@vger.kernel.org Subject: Re: [PATCH] mm/memcontrol: Add the drop_cache interface for cgroup v2 Message-ID: <20200921110505.GH12990@dhcp22.suse.cz> References: <20200921080255.15505-1-zangchunxin@bytedance.com> <20200921081200.GE12990@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 21-09-20 18:55:40, Yafang Shao wrote: > On Mon, Sep 21, 2020 at 4:12 PM Michal Hocko wrote: > > > > 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 think we'd better add these comments above the function > mem_cgroup_force_empty() to explain why we don't want to expose this > interface in cgroup2, otherwise people will continue to send this > proposal without any strong reason. I do not mind people sending this proposal. "V1 used to have an interface, we need it in v2 as well" is not really viable without providing more reasoning on the specific usecase. _Any_ patch should have a proper justification. This is nothing really new to the process and I am wondering why this is coming as a surprise. -- Michal Hocko SUSE Labs