[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100324204259.GA6423@elf.ucw.cz>
Date: Wed, 24 Mar 2010 21:42:59 +0100
From: Pavel Machek <pavel@....cz>
To: Jiri Slaby <jslaby@...e.cz>
Cc: jirislaby@...il.com, linux-pm@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org,
Nigel Cunningham <ncunningham@...a.org.au>,
"Rafael J. Wysocki" <rjw@...k.pl>
Subject: Re: [RFC 09/15] PM / Hibernate: user, implement user_ops writer
Hi!
> Switch /dev/snapshot writer to sws_module_ops approach so that we
> can transparently rewrite the rest of the snapshot from pages pulling
> to their pushing through layers.
>
> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> Cc: Nigel Cunningham <ncunningham@...a.org.au>
> Cc: "Rafael J. Wysocki" <rjw@...k.pl>
> ---
> kernel/power/user.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++----
> 1 files changed, 105 insertions(+), 8 deletions(-)
>
> + if (test_bit(TODO_CLOSED, to_do_flags))
> + return -EIO;
> +
> + to_do_buf = buf;
> + wmb();
> + set_bit(TODO_WORK, to_do_flags);
> + wake_up_interruptible(&to_do_wait);
Uhuh, open-coded barriers... these need to be commented, and I guess
you just should not play this kind of trickery.
spnlocks? Normal locks?
> +
> + wait_event(to_do_done, !test_bit(TODO_WORK, to_do_flags) ||
> + (err = test_bit(TODO_CLOSED, to_do_flags)));
> +
> + return err ? -EIO : 0;
> +}
> +
> +static int put_user_writer(unsigned int flags, int error)
> +{
> + int err = 0;
> +
> + if (error)
> + set_bit(TODO_ERROR, to_do_flags);
> + set_bit(TODO_FINISH, to_do_flags);
> + wake_up_interruptible(&to_do_wait);
> +
> + wait_event(to_do_done, !test_bit(TODO_FINISH, to_do_flags) ||
> + (err = test_bit(TODO_CLOSED, to_do_flags)));
> +
> + if (!error && err)
> + error = -EIO;
> +
> + return error;
> +}
> +
> struct sws_module_ops user_ops = {
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists