Re: [PATCH RFC] fs: drop_caches: introduce per-node drop_caches interface

Andrew Morton
2026-04-09T15:16:25Z

On Thu, 9 Apr 2026 16:08:37 +0800 Kefeng Wang <wangkefeng.wang@huawei.com> wrote:

> > Quite honestly drop_caches is not the best interface to build any new
> > functionality on top of. It has backfired a lot in the past and we have
> > tried to make it extra clear that this should be used for debugging
> > purposes only. Extending it further sounds like a bad step.
>
>
> I am not clear about this history of this interface, but some of our
> products do use this interface :(

I added it more than 20 years ago (before debugfs existed) as a way of
exercising cold-cache testing fs/pagecache code. My stress-testing
code was previously using umount/mount but this was inconvenient for
some reason.

But the damn thing because so popular! Mainly because our caching code
has always been problematic in various ways and people found that
drop_caches was an effective workaround :(

So it's an unhappy story. Caching causes people problems, caching code
doesn't get fixed, people get stuck on using a stupid debug thing which
I guess I should have just kept local in my tree.