Re: [RFC 09/15] PM / Hibernate: user, implement user_ops writer

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jiri Slaby
Date: Friday, March 26, 2010 - 2:34 am

On 03/25/2010 11:14 PM, Rafael J. Wysocki wrote:

That's it, I don't think a lock is appropriate here (I didn't even think
of that) -- I don't know what to lock (OK, I see it, but it's not that
clear). There is no potential for race per se, I only need to disable
reordering (which locks do as a side-effect). I need the steps to be
done in the A-B order where there is a barrier appropriate. Here, A is
store to to_do_buf, B is set_bit. It's I set to_do_buf, flag that it may
be used, the consumer will see the flag and use to_do_buf, in this order.

Above that if I introduce locks the wait_event on the other side will
grow into an unreadable mess. I would need to hold a lock when checking
the condition and hold it until I reach to_do_buf use, but also unlock
it on all paths that do not reach that point. Yeah, it's indeed doable,
but I don't think, it will improve things.

I also don't think completion is appropriate here, as I have a condition
to check for and it differs over wake_up sites.

thanks,
-- 
js
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC 09/15] PM / Hibernate: user, implement user_ops w ..., Rafael J. Wysocki, (Thu Mar 25, 3:14 pm)
Re: [RFC 09/15] PM / Hibernate: user, implement user_ops w ..., Jiri Slaby, (Fri Mar 26, 2:34 am)
Re: [RFC 09/15] PM / Hibernate: user, implement user_ops w ..., Rafael J. Wysocki, (Fri Mar 26, 3:04 pm)