All of lore.kernel.org
 help / color / mirror / Atom feed
* Nokia N900 not hitting OFF mode since 5.9 is caused by proactive memory compaction
@ 2021-12-10  0:39 Merlijn Wajer
  2021-12-10  7:20 ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Merlijn Wajer @ 2021-12-10  0:39 UTC (permalink / raw)
  To: linux-omap, phone-devel, maemo-leste, Tony Lindgren, Pavel Machek
  Cc: Sebastian Reichel, Ivaylo Dimitrov, Dev Null, Andreas Kemnade,
	H. Nikolaus Schaller

Hi,

I've spent the day bisecting what exact commit prevented the Nokia N900
from entering the OFF sleep state (between v5.8 and v5.9), and it this
commit:

> # first bad commit: [facdaa917c4d5a376d09d25865f5a863f906234a] mm: proactive compaction

The git tree prior to that commit can idle at about ~27mW in OFF mode,
and it will often remain in that mode for prolonged amounts of time
(easily 30 seconds, depending on running userspace). Which the above
commit applied, the Nokia N900 almost never hits OFF mode any more. This
would suggest at least to disable CONFIG_COMPACTION, perhaps in
omap2plus_defconfig? I suspect this might cause idle problems beyond the
Nokia N900, too.

Maybe nothing needs to be done here other than disable the config option
-- but I wanted to share this in case others are trying to figure out
what happened to their battery life. :-)

There seem be more power regressions since then (at least on 5.15 there
is more blocking proper idle), so I'll try to find those as well, but if
this commit is reverted (or CONFIG_COMPACTION=n is in .config - probably
easier) on top of v5.9 the system seems to idle fine.

> # grep ^core_pwrdm /sys/kernel/debug/pm_debug/count | cut -d',' -f2,
> OFF:16,RET:2

Hope this helps someone...

Regards,
Merlijn

PS: v5.10 seems to use another 19mW if panel_sony_acx565akm is loaded
even when display is not active (maybe it doesn't suspend or something?
- could be fixed later, just noticed it for v5.10). I load it initially
to idle the display, but until I rmmod the modules, the module uses
quite a bit more power. This problem is not present in v5.9, so that is
another thing to chase down I guess... And then v5.15 uses another 12mW
more, for not yet uncovered reasons)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Nokia N900 not hitting OFF mode since 5.9 is caused by proactive memory compaction
  2021-12-10  0:39 Nokia N900 not hitting OFF mode since 5.9 is caused by proactive memory compaction Merlijn Wajer
@ 2021-12-10  7:20 ` Tony Lindgren
  2021-12-10  9:47   ` Merlijn Wajer
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tony Lindgren @ 2021-12-10  7:20 UTC (permalink / raw)
  To: Merlijn Wajer
  Cc: linux-omap, phone-devel, maemo-leste, Pavel Machek,
	Sebastian Reichel, Ivaylo Dimitrov, Dev Null, Andreas Kemnade,
	H. Nikolaus Schaller, Nitin Gupta

Hi,

* Merlijn Wajer <merlijn@wizzup.org> [211210 00:34]:
> Hi,
> 
> I've spent the day bisecting what exact commit prevented the Nokia N900
> from entering the OFF sleep state (between v5.8 and v5.9), and it this
> commit:
> 
> > # first bad commit: [facdaa917c4d5a376d09d25865f5a863f906234a] mm: proactive compaction
> 
> The git tree prior to that commit can idle at about ~27mW in OFF mode,
> and it will often remain in that mode for prolonged amounts of time
> (easily 30 seconds, depending on running userspace). Which the above
> commit applied, the Nokia N900 almost never hits OFF mode any more. This
> would suggest at least to disable CONFIG_COMPACTION, perhaps in
> omap2plus_defconfig? I suspect this might cause idle problems beyond the
> Nokia N900, too.

Nice find, adding Nitin to Cc as well. Nitin, can we somehow avoid the
timers for CONFIG_COMPACTION on an idle system to prevent waking up the
system unnecessarily?

Not sure if sysctl -w vm.compaction_proactiveness=0 is enough to disable
compaction for idle, maybe also the HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500
at ms also causes extra wake-ups?

Regards,

Tony

> Maybe nothing needs to be done here other than disable the config option
> -- but I wanted to share this in case others are trying to figure out
> what happened to their battery life. :-)
> 
> There seem be more power regressions since then (at least on 5.15 there
> is more blocking proper idle), so I'll try to find those as well, but if
> this commit is reverted (or CONFIG_COMPACTION=n is in .config - probably
> easier) on top of v5.9 the system seems to idle fine.
> 
> > # grep ^core_pwrdm /sys/kernel/debug/pm_debug/count | cut -d',' -f2,
> > OFF:16,RET:2
> 
> Hope this helps someone...
> 
> Regards,
> Merlijn
> 
> PS: v5.10 seems to use another 19mW if panel_sony_acx565akm is loaded
> even when display is not active (maybe it doesn't suspend or something?
> - could be fixed later, just noticed it for v5.10). I load it initially
> to idle the display, but until I rmmod the modules, the module uses
> quite a bit more power. This problem is not present in v5.9, so that is
> another thing to chase down I guess... And then v5.15 uses another 12mW
> more, for not yet uncovered reasons)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Nokia N900 not hitting OFF mode since 5.9 is caused by proactive memory compaction
  2021-12-10  7:20 ` Tony Lindgren
@ 2021-12-10  9:47   ` Merlijn Wajer
  2021-12-16 15:23   ` Merlijn Wajer
  2022-01-03 14:44   ` Ivaylo Dimitrov
  2 siblings, 0 replies; 6+ messages in thread
From: Merlijn Wajer @ 2021-12-10  9:47 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap, phone-devel, maemo-leste, Pavel Machek,
	Sebastian Reichel, Ivaylo Dimitrov, Dev Null, Andreas Kemnade,
	H. Nikolaus Schaller, Nitin Gupta

Hi,

On 10/12/2021 08:20, Tony Lindgren wrote:
> 
> Not sure if sysctl -w vm.compaction_proactiveness=0 is enough to disable
> compaction for idle, maybe also the HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500
> at ms also causes extra wake-ups?

I remember trying setting vm.compaction_proactiveness to 0 and it didn't
help with idling, and my thought was also that the check-interval was
still active.

Cheers,
Merlijn

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Nokia N900 not hitting OFF mode since 5.9 is caused by proactive memory compaction
  2021-12-10  7:20 ` Tony Lindgren
  2021-12-10  9:47   ` Merlijn Wajer
@ 2021-12-16 15:23   ` Merlijn Wajer
  2022-01-03 14:44   ` Ivaylo Dimitrov
  2 siblings, 0 replies; 6+ messages in thread
From: Merlijn Wajer @ 2021-12-16 15:23 UTC (permalink / raw)
  To: Tony Lindgren, Nitin Gupta
  Cc: linux-omap, phone-devel, maemo-leste, Pavel Machek,
	Sebastian Reichel, Ivaylo Dimitrov, Dev Null, Andreas Kemnade,
	H. Nikolaus Schaller, linux-mm

Hi Nitin, linux-mm list,

Any ideas or comments on the problem I encountered and on the question
from Tony below? Is it possible to have CONFIG_COMPACTION not wake up
systems unnecessarily, or should it perhaps be disabled for systems
where power consumption is an issue?

Thanks,
Regards,
Merlijn

PS: I already earlier noted in this thread that setting "sysctl -w
vm.compaction_proactiveness=0" does not solve the problem, as the system
stills is kept awake by CONFIG_COMPACTION.

On 10/12/2021 08:20, Tony Lindgren wrote:
> Hi,
> 
> * Merlijn Wajer <merlijn@wizzup.org> [211210 00:34]:
>> Hi,
>>
>> I've spent the day bisecting what exact commit prevented the Nokia N900
>> from entering the OFF sleep state (between v5.8 and v5.9), and it this
>> commit:
>>
>>> # first bad commit: [facdaa917c4d5a376d09d25865f5a863f906234a] mm: proactive compaction
>>
>> The git tree prior to that commit can idle at about ~27mW in OFF mode,
>> and it will often remain in that mode for prolonged amounts of time
>> (easily 30 seconds, depending on running userspace). Which the above
>> commit applied, the Nokia N900 almost never hits OFF mode any more. This
>> would suggest at least to disable CONFIG_COMPACTION, perhaps in
>> omap2plus_defconfig? I suspect this might cause idle problems beyond the
>> Nokia N900, too.
> 
> Nice find, adding Nitin to Cc as well. Nitin, can we somehow avoid the
> timers for CONFIG_COMPACTION on an idle system to prevent waking up the
> system unnecessarily?
> 
> Not sure if sysctl -w vm.compaction_proactiveness=0 is enough to disable
> compaction for idle, maybe also the HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500
> at ms also causes extra wake-ups?
> 
> Regards,
> 
> Tony
> 
>> Maybe nothing needs to be done here other than disable the config option
>> -- but I wanted to share this in case others are trying to figure out
>> what happened to their battery life. :-)
>>
>> There seem be more power regressions since then (at least on 5.15 there
>> is more blocking proper idle), so I'll try to find those as well, but if
>> this commit is reverted (or CONFIG_COMPACTION=n is in .config - probably
>> easier) on top of v5.9 the system seems to idle fine.
>>
>>> # grep ^core_pwrdm /sys/kernel/debug/pm_debug/count | cut -d',' -f2,
>>> OFF:16,RET:2
>>
>> Hope this helps someone...
>>
>> Regards,
>> Merlijn
>>
>> PS: v5.10 seems to use another 19mW if panel_sony_acx565akm is loaded
>> even when display is not active (maybe it doesn't suspend or something?
>> - could be fixed later, just noticed it for v5.10). I load it initially
>> to idle the display, but until I rmmod the modules, the module uses
>> quite a bit more power. This problem is not present in v5.9, so that is
>> another thing to chase down I guess... And then v5.15 uses another 12mW
>> more, for not yet uncovered reasons)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Nokia N900 not hitting OFF mode since 5.9 is caused by proactive memory compaction
  2021-12-10  7:20 ` Tony Lindgren
  2021-12-10  9:47   ` Merlijn Wajer
  2021-12-16 15:23   ` Merlijn Wajer
@ 2022-01-03 14:44   ` Ivaylo Dimitrov
  2022-04-12  9:53     ` Tony Lindgren
  2 siblings, 1 reply; 6+ messages in thread
From: Ivaylo Dimitrov @ 2022-01-03 14:44 UTC (permalink / raw)
  To: Tony Lindgren, Merlijn Wajer
  Cc: linux-omap, phone-devel, maemo-leste, Pavel Machek,
	Sebastian Reichel, Dev Null, Andreas Kemnade,
	H. Nikolaus Schaller, Nitin Gupta

Hi,

On 10.12.21 г. 9:20 ч., Tony Lindgren wrote:
> Hi,
> 
> * Merlijn Wajer <merlijn@wizzup.org> [211210 00:34]:
>> Hi,
>>
>> I've spent the day bisecting what exact commit prevented the Nokia N900
>> from entering the OFF sleep state (between v5.8 and v5.9), and it this
>> commit:
>>
>>> # first bad commit: [facdaa917c4d5a376d09d25865f5a863f906234a] mm: proactive compaction
>>
>> The git tree prior to that commit can idle at about ~27mW in OFF mode,
>> and it will often remain in that mode for prolonged amounts of time
>> (easily 30 seconds, depending on running userspace). Which the above
>> commit applied, the Nokia N900 almost never hits OFF mode any more. This
>> would suggest at least to disable CONFIG_COMPACTION, perhaps in
>> omap2plus_defconfig? I suspect this might cause idle problems beyond the
>> Nokia N900, too.
> 
> Nice find, adding Nitin to Cc as well. Nitin, can we somehow avoid the
> timers for CONFIG_COMPACTION on an idle system to prevent waking up the
> system unnecessarily?
> 
> Not sure if sysctl -w vm.compaction_proactiveness=0 is enough to disable
> compaction for idle, maybe also the HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500
> at ms also causes extra wake-ups?
> 

This doesn't seem to affect Nokia N900 only, waking-up twice a second 
will have negative effect on power usage of every device this runs on. 
Could we have some discussion on how to avoid that?

Regards,
Ivo

> Regards,
> 
> Tony
> 
>> Maybe nothing needs to be done here other than disable the config option
>> -- but I wanted to share this in case others are trying to figure out
>> what happened to their battery life. :-)
>>
>> There seem be more power regressions since then (at least on 5.15 there
>> is more blocking proper idle), so I'll try to find those as well, but if
>> this commit is reverted (or CONFIG_COMPACTION=n is in .config - probably
>> easier) on top of v5.9 the system seems to idle fine.
>>
>>> # grep ^core_pwrdm /sys/kernel/debug/pm_debug/count | cut -d',' -f2,
>>> OFF:16,RET:2
>>
>> Hope this helps someone...
>>
>> Regards,
>> Merlijn
>>
>> PS: v5.10 seems to use another 19mW if panel_sony_acx565akm is loaded
>> even when display is not active (maybe it doesn't suspend or something?
>> - could be fixed later, just noticed it for v5.10). I load it initially
>> to idle the display, but until I rmmod the modules, the module uses
>> quite a bit more power. This problem is not present in v5.9, so that is
>> another thing to chase down I guess... And then v5.15 uses another 12mW
>> more, for not yet uncovered reasons)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Nokia N900 not hitting OFF mode since 5.9 is caused by proactive memory compaction
  2022-01-03 14:44   ` Ivaylo Dimitrov
@ 2022-04-12  9:53     ` Tony Lindgren
  0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2022-04-12  9:53 UTC (permalink / raw)
  To: Ivaylo Dimitrov
  Cc: Merlijn Wajer, linux-omap, phone-devel, maemo-leste,
	Pavel Machek, Sebastian Reichel, Dev Null, Andreas Kemnade,
	H. Nikolaus Schaller, Nitin Gupta, Charan Teja Reddy

* Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> [220103 14:45]:
> Hi,
> 
> On 10.12.21 г. 9:20 ч., Tony Lindgren wrote:
> > Hi,
> > 
> > * Merlijn Wajer <merlijn@wizzup.org> [211210 00:34]:
> > > Hi,
> > > 
> > > I've spent the day bisecting what exact commit prevented the Nokia N900
> > > from entering the OFF sleep state (between v5.8 and v5.9), and it this
> > > commit:
> > > 
> > > > # first bad commit: [facdaa917c4d5a376d09d25865f5a863f906234a] mm: proactive compaction
> > > 
> > > The git tree prior to that commit can idle at about ~27mW in OFF mode,
> > > and it will often remain in that mode for prolonged amounts of time
> > > (easily 30 seconds, depending on running userspace). Which the above
> > > commit applied, the Nokia N900 almost never hits OFF mode any more. This
> > > would suggest at least to disable CONFIG_COMPACTION, perhaps in
> > > omap2plus_defconfig? I suspect this might cause idle problems beyond the
> > > Nokia N900, too.
> > 
> > Nice find, adding Nitin to Cc as well. Nitin, can we somehow avoid the
> > timers for CONFIG_COMPACTION on an idle system to prevent waking up the
> > system unnecessarily?
> > 
> > Not sure if sysctl -w vm.compaction_proactiveness=0 is enough to disable
> > compaction for idle, maybe also the HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500
> > at ms also causes extra wake-ups?
> > 
> 
> This doesn't seem to affect Nokia N900 only, waking-up twice a second will
> have negative effect on power usage of every device this runs on. Could we
> have some discussion on how to avoid that?

Just following up on this as I had it tagged in my inbox.

There's kernel commit 65d759c8f9f5 ("mm: compaction: support triggering of
proactive compaction by user") that should fix this issue.

It seems to require the the following to disable compaction:

# echo 0 > /proc/sys/vm/compaction_proactiveness

Merlijn, care to check if this fixes the issue you're seeing? Or are threre
possibly other bugs too preventing n900 from properly idling?

Regards,

Tony

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-12 11:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10  0:39 Nokia N900 not hitting OFF mode since 5.9 is caused by proactive memory compaction Merlijn Wajer
2021-12-10  7:20 ` Tony Lindgren
2021-12-10  9:47   ` Merlijn Wajer
2021-12-16 15:23   ` Merlijn Wajer
2022-01-03 14:44   ` Ivaylo Dimitrov
2022-04-12  9:53     ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.