Re: [Update][PATCH] PM / Hibernate: Fix s2disk regression related to unlock_system_sleep()

From: Tejun Heo
Date: Wed Jan 18 2012 - 11:58:47 EST


Hello,

On Wed, Jan 18, 2012 at 8:54 AM, Srivatsa S. Bhat
<srivatsa.bhat@xxxxxxxxxxxxxxxxxx> wrote:
> +       /*
> +        * Don't use freezer_count() because we don't want the call to
> +        * try_to_freeze() here.
> +        *
> +        * Reason:
> +        * unlock_system_sleep() gets called in snapshot_read() and
> +        * snapshot_write() when the freezing condition is still in effect.
> +        * Which means, if we use try_to_freeze() here, it would make them
> +        * enter the refrigerator, thus causing suspend-to-disk to lockup.
> +        */

Yeap, much better but wouldn't it be better if the description was
higher level? ie. Explain why try_to_freeze() doesn't make sense for
this operation semantically and then, optionally, give an example of
breakage. It usually is lack of proper rationale / reasoning that
confuses people reading the code.

Thank you.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/