# Re: \[PATCH RFC\] pm\_qos\_requirement might sleep

- From: Steven Rostedt \<rostedt@goodmis.org\>
- Date: 2008-08-29 14:29:53 
- List: linux-rt-users
- Page: https://ratatoskr.run/linux-rt-users/2008/08/1145559
- Thread: https://ratatoskr.run/linux-rt-users/2008/08/1134835/t.md

```text


On Fri, 29 Aug 2008, John Kacur wrote:
> 
> Hi Andrew
> 
> The purpose of the patch is to remove the spin_lock around the read in
> the function pm_qos_requirement - since spinlocks can sleep in -rt and
> this function is called from idle. I did propose a patch, that simply
> removed the spinlock, since Peter Zilstra and others (yourself) point
> out, the lock isn't needed to read a single word from memory. Although
> the patch worked fine, Arjan objected to it, because it was not
> symmetric. A reader of the code might wonder why it was locked in
> other functions but not here. He suggested changing it to an atomic
> type might be less confusing. The alternative which I like better
> actually is to simply remove the lock in pm_qos_requirement and add a
> comment for readers of the code.

This is a much better changelog, and is what should have been written in 
the first place ;-)

-- Steve
```
