Re: retiring laptop_mode? was Re: [PATCH] mm: vmscan: always allow writeback during memcg reclaim

From: Michal Hocko
Date: Wed Dec 17 2025 - 14:34:51 EST


On Tue 16-12-25 13:52:01, Johannes Weiner wrote:
> On Mon, Dec 15, 2025 at 11:41:07PM -0800, Christoph Hellwig wrote:
> > On Mon, Dec 15, 2025 at 03:08:38PM -0500, Johannes Weiner wrote:
> > > Debated whether to add some sort of deprecation sysctl handler, but at
> > > least systemd-sysctl just prints a warning and still applies other
> > > settings from the same config file.
> >
> > In general dropping sysctl will break things. So I think we'll need
> > a stub, at which point it might as well warn for a while.
>
> Fair enough, I added that.
>
> Jens, that change seemed small enough that I carried your Ack, but
> please let me know if you feel otherwise ;)
>
> > > Laptop mode was introduced to save battery, by delaying and
> > > consolidating writes and maximize the time rotating hard drives
> > > wouldn't have to spin. Needless to say, this is a scenario of the
> > > (in)glorious past.
> >
> > Maybe expand on this a bit by mentioning that reclaim now never does
> > file system writeback, and fs writeback is already very lumpy by
> > design. And of cours that hard disk with their high spinup latency
> > and extra power draw are a thing of the past in laptops or other mobile
> > devices.
>
> Sounds good. Can you take a look at the new version below?
>
> Andrew, absent any further objections, would you be able to take this
> through the -mm tree?
>
> Thanks!
>
> >From 087f10b8046864f71ebc3a3f3316b097932cbded Mon Sep 17 00:00:00 2001
> From: Johannes Weiner <hannes@xxxxxxxxxxx>
> Date: Mon, 15 Dec 2025 12:57:53 -0500
> Subject: [PATCH] mm/block/fs: remove laptop_mode
>
> Laptop mode was introduced to save battery, by delaying and
> consolidating writes and thereby maximize the time rotating hard
> drives wouldn't have to spin.
>
> Luckily, rotating hard drives, with their high spin-up times and power
> draw, are a thing of the past for battery-powered devices. Reclaim has
> also since changed to not write single filesystem pages anymore, and
> regular filesystem writeback is lumpy by design.
>
> The juice doesn't appear worth the squeeze anymore. The footprint of
> the feature is small, but nevertheless it's a complicating factor in
> mm, block, filesystems. Developers don't think about it, and it likely
> hasn't been tested with new reclaim and writeback changes in years.
>
> Let's sunset it. Keep the sysctl with a deprecation warning around for
> a few more cycles, but remove all functionality behind it.
>
> Suggested-by: Christoph Hellwig <hch@xxxxxxxxxxxxx>
> Message-ID: <aT-xv1BNYabnZB_n@xxxxxxxxxxxxx>
> Acked-by: Jens Axboe <axboe@xxxxxxxxx>
> Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx>

Acked-by: Michal Hocko <mhocko@xxxxxxxx>

Thanks!
--
Michal Hocko
SUSE Labs