[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230703-freifahrt-dachwohnung-49d858588e88@brauner>
Date: Mon, 3 Jul 2023 12:16:57 +0200
From: Christian Brauner <brauner@...nel.org>
To: Andrew Yang <andrew.yang@...iatek.com>, linux-mm@...ck.org
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
wsd_upstream@...iatek.com, casper.li@...iatek.com,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH] fs: drop_caches: draining pages before dropping caches
Really more suitable for -mm to review.
On Fri, Jun 30, 2023 at 05:22:02PM +0800, Andrew Yang wrote:
> We expect a file page access after dropping caches should be a major
> fault, but sometimes it's still a minor fault. That's because a file
> page can't be dropped if it's in a per-cpu pagevec. Draining all pages
> from per-cpu pagevec to lru list before trying to drop caches.
>
> Signed-off-by: Andrew Yang <andrew.yang@...iatek.com>
> ---
> fs/drop_caches.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/drop_caches.c b/fs/drop_caches.c
> index e619c31b6bd9..b9575957a7c2 100644
> --- a/fs/drop_caches.c
> +++ b/fs/drop_caches.c
> @@ -10,6 +10,7 @@
> #include <linux/writeback.h>
> #include <linux/sysctl.h>
> #include <linux/gfp.h>
> +#include <linux/swap.h>
> #include "internal.h"
>
> /* A global variable is a bit ugly, but it keeps the code simple */
> @@ -59,6 +60,7 @@ int drop_caches_sysctl_handler(struct ctl_table *table, int write,
> static int stfu;
>
> if (sysctl_drop_caches & 1) {
> + lru_add_drain_all();
> iterate_supers(drop_pagecache_sb, NULL);
> count_vm_event(DROP_PAGECACHE);
> }
> --
> 2.18.0
>
Powered by blists - more mailing lists