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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E6C8C43219 for ; Tue, 12 Apr 2022 11:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237802AbiDLLJV (ORCPT ); Tue, 12 Apr 2022 07:09:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242390AbiDLLCM (ORCPT ); Tue, 12 Apr 2022 07:02:12 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E112B32D; Tue, 12 Apr 2022 02:53:47 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id D85868061; Tue, 12 Apr 2022 09:51:13 +0000 (UTC) Date: Tue, 12 Apr 2022 12:53:45 +0300 From: Tony Lindgren To: Ivaylo Dimitrov Cc: Merlijn Wajer , linux-omap , phone-devel@vger.kernel.org, maemo-leste@lists.dyne.org, Pavel Machek , Sebastian Reichel , Dev Null , Andreas Kemnade , "H. Nikolaus Schaller" , Nitin Gupta , Charan Teja Reddy Subject: Re: Nokia N900 not hitting OFF mode since 5.9 is caused by proactive memory compaction Message-ID: References: <99e25c92-3d2d-0964-0068-651bf44cbf8a@wizzup.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org * Ivaylo Dimitrov [220103 14:45]: > Hi, > > On 10.12.21 г. 9:20 ч., Tony Lindgren wrote: > > Hi, > > > > * Merlijn Wajer [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