[Devel] Re: [PATCH 1/3] c/r: call restore_notify_error for restart (not checkpoint !)

Dave Hansen dave at linux.vnet.ibm.com
Mon Dec 7 08:33:20 PST 2009


On Sun, 2009-12-06 at 15:08 -0500, Oren Laadan wrote:
> +static inline int ckpt_get_error(struct ckpt_ctx *ctx)
> +{
> +       /* errno is set after error flag: make sure we don't miss it */
> +       while (!ctx->errno)
> +               yield();
> +       return ctx->errno;
> +}

I would think that this would be a more proper place to use something
like a completion queue or a lock.  A yield loop seems a bit sketchy.

How about a r/w mutex?  The people waiting for the checkpoint to
complete attempt to acquire reads, and the guy setting ctx->errno
releases the write after it gets set.

-- Dave

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list