mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Haofeng Li <920484857@qq.com>
To: tglx@linutronix.de
Cc: 13266079573@163.com, 920484857@qq.com, jstultz@google.com,
	lihaofeng@kylinos.cn, linux-kernel@vger.kernel.org,
	sboyd@kernel.org
Subject: Re: [PATCH WITHDRAWN] timekeeping: Move debug sleep time accounting outside spinlock
Date: Fri, 12 Sep 2025 18:33:23 +0800	[thread overview]
Message-ID: <tencent_8FAF92EC7B7BF79E6DA0101B3A52D6004E06@qq.com> (raw)
In-Reply-To: <871pofx302.ffs@tglx>


>How so exactly?

>I don't see how that would deadlock, but I might miss something. So
>please explain it properly instead of handwaving about it.

>Thanks,

>        tglx


Thank you for your detailed feedback and for pointing out the issues with my previous analysis. I sincerely apologize for the oversight and any confusion it may have caused. You were absolutely right to question the reasoning, and upon re-examining the code with a fresher perspective, I realize my initial explanation was incomplete and incorrect.

Regarding your specific questions:

Removal of touch_softlockup_watchdog():
I now understand that this change was unrelated to the problem at hand. The removal was mistakenly included in the context of addressing the potential deadlock issue, which was not justified. This line should not have been touched.

Potential Deadlock in tk_debug_account_sleep_time():
Your skepticism about the deadlock risk was entirely valid. After further analysis, I confirmed that the function tk_debug_account_sleep_time()—specifically, the pm_deferred_pr_dbg() macro and its underlying printk_deferred() implementation—does not acquire any locks that could cause a deadlock, even when called within a spinlock-protected context. The deferred printk mechanism is designed to be safe in such scenarios, as it avoids locking and instead uses per-CPU buffers to handle logging.

The confusion arose because I was referencing an older version of the codebase that lacked the commit 099f1c84c005 ("printk: introduce per-cpu safe_print seq buffer"). This commit introduced critical improvements to the deferred printk functionality, ensuring it remains lock-free and safe for use in contexts like this. In the older codebase, a similar scenario could indeed lead to deadlocks, but in the current code, the implementation is robust and free of such risks.

Again, I apologize for the oversight and the time spent addressing this. I greatly appreciate your patience and thorough review, which helped me correct my misunderstanding. 

Thank you for your guidance and for holding the code to a high standard.

Best regards,

	lihaofeng


  reply	other threads:[~2025-09-12 10:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 10:23 [PATCH] " Haofeng Li
2025-09-09 11:42 ` Thomas Gleixner
2025-09-09 11:46 ` Thomas Gleixner
2025-09-12 10:33   ` Haofeng Li [this message]
2025-09-10  3:12 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_8FAF92EC7B7BF79E6DA0101B3A52D6004E06@qq.com \
    --to=920484857@qq.com \
    --cc=13266079573@163.com \
    --cc=jstultz@google.com \
    --cc=lihaofeng@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®