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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31E10C433EF for ; Wed, 20 Jul 2022 15:02:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 783F86B0071; Wed, 20 Jul 2022 11:02:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 733BE6B0073; Wed, 20 Jul 2022 11:02:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D6036B0074; Wed, 20 Jul 2022 11:02:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 4B76E6B0071 for ; Wed, 20 Jul 2022 11:02:41 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1FD641C0376 for ; Wed, 20 Jul 2022 15:02:41 +0000 (UTC) X-FDA: 79707794922.19.A9C52D1 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf12.hostedemail.com (Postfix) with ESMTP id C247E40095 for ; Wed, 20 Jul 2022 15:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tsZFbCOwOTa4oL/6rESxgKwXoLmWNvHKzpr9YmtZRaE=; b=qEp4AJK/ZMf2KCQNeSIMBOFd+r MvznfKwn6C4jvzlfMfVXM3sprf0yDb4V0L1LL90AxHGUTk228C8mq6jkL5GhSbqyPOrl54GdBdRlJ mPUy7x8FH+mM5e6Y+piFeWpmNUfUB/MCkae2iU+WAoElccNFkGQS/d/ADd2t1idqR71GhY1alOLfk UgjBwLO/w1b+bKgTB2ogiF1TeQkTJ6txDrTuZv0EBYnHB1dER8gTpPqd/PhxEfUT04UqoIuRQSmGe kVb0tfmk6vacAajpHhPNzQbqOgJxeuWoL/bkIyYoKvNhZuIE8pZdvcae4fzuFF9ORJqOtUa1jbr+n EgHu4xiQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEBDA-00EYbB-PB; Wed, 20 Jul 2022 15:02:04 +0000 Date: Wed, 20 Jul 2022 16:02:04 +0100 From: Matthew Wilcox To: CGEL Cc: viro@zeniv.linux.org.uk, hughd@google.com, akpm@linux-foundation.org, hch@infradead.org, hsiangkao@linux.alibaba.com, yang.yang29@zte.com.cn, axboe@kernel.dk, yangerkun@huawei.com, johannes.thumshirn@wdc.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ran Xiaokai Subject: Re: [PATCH] fs: drop_caches: skip dropping pagecache which is always dirty Message-ID: References: <20220720022118.1495752-1-yang.yang29@zte.com.cn> <62d79a79.1c69fb81.e4cba.37f5@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62d79a79.1c69fb81.e4cba.37f5@mx.google.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658329360; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tsZFbCOwOTa4oL/6rESxgKwXoLmWNvHKzpr9YmtZRaE=; b=0680lLqJubDEoh1UzmEJhEyrR4VntOGhWP/zcim3aFCKEG7stNIdtipwVf7/1IrIs/T1YT dNZ5IETsxiACj6HjQVIjU+DmAayovsEoF61ko36IVC1gK4CVFtvTnhIM82Y/4m07oyhDms Urq+LJykWUemTdxbFUDTN3muZqHtJ4E= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658329360; a=rsa-sha256; cv=none; b=xzhCPTLaAXXGpQH9pVAKzAb5LUHXM0VmKsb1D+LFSvQUY3piGZt14Eo2GlW962vxE32KBo 7kIoCR8mpResgYBNOFb6w8kpIrsXVHxTvEr34Okqq5SbZ3RjMCSCKnpEI4ZleNAZX5SpOv kuM0wDqYERKUB7rkvdgl3RgZaM0CUzE= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="qEp4AJK/"; dmarc=none; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Queue-Id: C247E40095 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="qEp4AJK/"; dmarc=none; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam12 X-Rspam-User: X-Stat-Signature: pzkcfi85wj1mi11ht5oaj8ott6j4stec X-HE-Tag: 1658329359-941331 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 Wed, Jul 20, 2022 at 06:02:32AM +0000, CGEL wrote: > On Wed, Jul 20, 2022 at 04:02:40AM +0100, Matthew Wilcox wrote: > > On Wed, Jul 20, 2022 at 02:21:19AM +0000, cgel.zte@gmail.com wrote: > > > From: Yang Yang > > > > > > Pagecache of some kind of fs has PG_dirty bit set once it was > > > allocated, so it can't be dropped. These fs include ramfs and > > > tmpfs. This can make drop_pagecache_sb() more efficient. > > > > Why do we want to make drop_pagecache_sb() more efficient? > > Some users may use drop_caches besides testing or debugging. This is a terrible reason. > For example, some systems will create a lot of pagecache when boot up > while reading bzImage, ramdisk, docker images etc. Most of this pagecache > is useless after boot up. It may has a longterm negative effects for the > workload when trigger page reclaim. It is especially harmful when trigger > direct_reclaim or we need allocate pages in atomic context. So users may > chose to drop_caches after boot up. If that's actually a problem, work on fixing that.