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.8 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 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 377DFC433B4 for ; Tue, 6 Apr 2021 14:39:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A27FF613C4 for ; Tue, 6 Apr 2021 14:39:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A27FF613C4 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 235B76B0070; Tue, 6 Apr 2021 10:39:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BF886B0080; Tue, 6 Apr 2021 10:39:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 037E46B0083; Tue, 6 Apr 2021 10:39:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0110.hostedemail.com [216.40.44.110]) by kanga.kvack.org (Postfix) with ESMTP id D77256B0070 for ; Tue, 6 Apr 2021 10:39:34 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 90AA22489 for ; Tue, 6 Apr 2021 14:39:34 +0000 (UTC) X-FDA: 78002200668.17.52A7775 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf15.hostedemail.com (Postfix) with ESMTP id 43213A00039B for ; Tue, 6 Apr 2021 14:39:33 +0000 (UTC) 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=1617719971; h=from:from:reply-to: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=gS9jCgSahAIGFQk7iYdYYP7eMAC4KzLikaNfz8sceyk=; b=HBxD5VgCgiTqyzWzCDWj1rPP7yrKtwwI3GctubUobBynv2nNUwptN5/9RFIpobMSSrU+g+ or+snQX5xw7HcGmRtKNLWSXHvrFmEIFHaVUoRP63AVWV++ewuzzPlcdCtYobRi1mEe8izp OkTIMwlXiMls62hoD9Nu7aIUwqGCbC0= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 24DE9B1C3; Tue, 6 Apr 2021 14:39:31 +0000 (UTC) Date: Tue, 6 Apr 2021 16:39:30 +0200 From: Michal Hocko To: Neil Sun Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/vmscan.c: drop_slab_node with task's memcg Message-ID: References: <1617359934-7812-1-git-send-email-neilsun@yunify.com> <4dba277d-e497-5c34-0e68-fd2283585de2@yunify.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 43213A00039B X-Stat-Signature: yibfhy17srin59qkqy1fn1pmriuj41mj Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf15; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617719973-25477 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 06-04-21 22:34:02, Neil Sun wrote: > > > On 2021/4/6 19:39, Michal Hocko wrote: > > On Tue 06-04-21 19:30:22, Neil Sun wrote: > > > On 2021/4/6 15:21, Michal Hocko wrote: > > > > > > > > You are changing semantic of the existing user interface. This knob has > > > > never been memcg aware and it is supposed to have a global impact. I do > > > > not think we can simply change that without some users being surprised > > > > or even breaking them. > > > > > > Yes, do you think add new interface to sysfs is a good way? such as > > > /sys/fs/cgroup/memory/lxc/i-vbe1u8o7/memory.kmem.drop_caches > > > > There were other attempts to add a memcg specific alternative to > > drop_caches. A lack of a strong usecase has been a reason that no such > > attempt has been merged until now. drop_caches is a problematic > > interface because it is really coarse and people have learned to (ab)use > > it to workaround problem rather than fix them properly. > > > > What is your usecase? > > > > We have some lxc containers running on the server, when mysqld running > backup jobs in the container, page cache will grow up and eat up all unused > memory in the container, then some new jobs come, we can see that tasks are > busy on allocing memory with reclaiming, so we want to drop page cache after > mysql backup job for individual container, it will speed up allocing memory > when new jobs come. > > This patch only drop slab cache but not page cache, this can be the > first step if people really need this interface. Have you considered using high limit for the pro-active memory reclaim? It really seems odd to drop a certain category of memory without aging information we already do have. I do understand the start time overhead concern but it seems to be a much better approach to drop old objects rather than hammer a very specific type of memory. -- Michal Hocko SUSE Labs