lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1624262676-27548-1-git-send-email-wangqing@vivo.com>
Date:   Mon, 21 Jun 2021 16:04:36 +0800
From:   Wang Qing <wangqing@...o.com>
To:     Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org
Cc:     Wang Qing <wangqing@...o.com>
Subject: [PATCH RFC] hrtimer: support hrtimer suspend when CPU suspend

When the CPU suspend, in order to achieve a more power-saving effect,
it is hoped that the CPU sleeps as long as possible, but the timer is an 
important reason for the CPU to wake up. 

In some cases, when the CPU suspend, the timer doesn’t have to work either,
such as watchdog hrtimer. The maximum suspend time of the CPU is 4s if enable
lockup detector, which is unacceptable on some products, and in fact, watchdog
timer can suspend when the cpu suspend.

This is a patch for comments, I'm not sure if there any ill-considerations. 
If this feature is really needed, I will continue to develop.

Signed-off-by: Wang Qing <wangqing@...o.com>
---
 include/linux/hrtimer.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index bb5e7b0..6d8e4f3
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -112,6 +112,7 @@ enum hrtimer_restart {
  * @is_soft:	Set if hrtimer will be expired in soft interrupt context.
  * @is_hard:	Set if hrtimer will be expired in hard interrupt context
  *		even on RT.
+ * @allow_suspend:	Set if hrtimer will suspend when CPU suspend
  *
  * The hrtimer structure must be initialized by hrtimer_init()
  */
@@ -124,6 +125,7 @@ struct hrtimer {
 	u8				is_rel;
 	u8				is_soft;
 	u8				is_hard;
+	u8				allow_suspend;
 };
 
 /**
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ