From: Tejun Heo <tj@kernel.org>
To: Mukesh Ojha <quic_mojha@quicinc.com>
Cc: myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
cw00.choi@samsung.com, jstultz@google.com, tglx@linutronix.de,
sboyd@kernel.org, jiangshanlai@gmail.com,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: timer list corruption in devfreq
Date: Thu, 9 Nov 2023 09:08:39 -1000 [thread overview]
Message-ID: <ZU0uNy6l0ZuzBmlf@slm.duckdns.org> (raw)
In-Reply-To: <1699459797-21703-1-git-send-email-quic_mojha@quicinc.com>
Hello,
On Wed, Nov 08, 2023 at 09:39:57PM +0530, Mukesh Ojha wrote:
> We are facing an issue on 6.1 kernel while using devfreq framework
> and looks like the devfreq_monitor_stop()/devfreq_monitor_start is
> vulnerable if frequent governor change is being done from user space
> in a loop.
>
> echo simple_ondemand > /sys/class/devfreq/1d84000.ufshc/governor
> echo performance > /sys/class/devfreq/1d84000.ufshc/governor
>
> Here, we are using ufs device, but could be any device.
>
> Issue is because same instance of timer is being queued from two
> places one from devfreq_monitor() and one from devfreq_monitor_start() as
> cancel_delayed_work_sync() from devfreq_monitor_stop() was not
> able to delete the delayed work time completely due to which
> devfreq_monitor() work rearmed the same timer.
>
> But there looks to be issue in the timer framework where
> it was initially discussed in [1] and later fixed in [2]
> but not sure being whether is it issue in cancel_delayed_work_sync()
> where del_timer() inside try_to_grab_pending() need to be replaced
> with timer_delete[_sync]() or devfreq_monitor_stop() need to use
> this api's and then delete the work.
So, having shutdown can be more convenient in some cases and that'd be a
useful addition to workqueue both for immediate and delayed work items. That
said, that's usually not essential in fixing these issues - e.g. Can't you
just synchronize devfreq_monitor_start() and stop()?
Thanks.
--
tejun
next prev parent reply other threads:[~2023-11-09 19:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-08 16:09 Mukesh Ojha
2023-11-08 16:41 ` Mukesh Ojha
2023-11-09 19:08 ` Tejun Heo [this message]
2023-11-14 12:30 ` Mukesh Ojha
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=ZU0uNy6l0ZuzBmlf@slm.duckdns.org \
--to=tj@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=jiangshanlai@gmail.com \
--cc=jstultz@google.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=quic_mojha@quicinc.com \
--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®