public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-pm@lists.linux-foundation.org
Subject: Re: Helping drivers to work without the freezer
Date: Mon, 10 Mar 2008 14:05:41 +0100	[thread overview]
Message-ID: <20080310130540.GA5040@ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0803082205270.10362-100000@netrider.rowland.org>

Hi!

> > Well, to me, rwsem sounds definitely better.  Still, I think it's better to
> > avoid locking it for too long, so we could use a variable protected by the
> > rwsem such that if it's 'true', unsleepable tasks checking it will put
> > themselves into a wait queue which will be woken up by the PM core
> > during resume.
> 
> Isn't that exactly what an rwsem does?  When it is locked for writing
> (your flag is "true"), tasks attempting to get a read lock will put 
> themselves into a wait queue which will be woken up when the write lock 
> is released (when the PM core sets the flag to "false" during resume).
> 
> In this case we could use something a little simpler than a
> general-purpose rwsem, since there will never be more than one task
> getting a write lock at any time -- i.e., never more than one task
> carrying out a system sleep.  It's not hard to design such a simplified
> rwsem in a way that exerts virtually no overhead on readers whenever no
> writer is present.

Just use generic rwsem... if we can see performance impact, we can
optimize it later.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

      reply	other threads:[~2008-03-10 13:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-08 16:49 Helping drivers to work without the freezer Alan Stern
2008-03-08 21:56 ` Rafael J. Wysocki
2008-03-08 22:57   ` Alan Stern
2008-03-09  0:55     ` Rafael J. Wysocki
2008-03-09  3:19       ` Alan Stern
2008-03-10 13:05         ` Pavel Machek [this message]

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=20080310130540.GA5040@ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=stern@rowland.harvard.edu \
    /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