From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oren Laadan Subject: Re: [RFC v2][PATCH 01/10] Infrastructure for work postponed to the end of checkpoint/restart Date: Mon, 13 Apr 2009 11:49:57 -0400 Message-ID: <49E35F25.5070501@cs.columbia.edu> References: <1239107503-21941-1-git-send-email-orenl@cs.columbia.edu> <1239107503-21941-2-git-send-email-orenl@cs.columbia.edu> <20090413153504.GA15846@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090413153504.GA15846-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: "Serge E. Hallyn" Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Dave Hansen List-Id: containers.vger.kernel.org Serge E. Hallyn wrote: > Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org): >> --- a/checkpoint/Makefile >> +++ b/checkpoint/Makefile >> @@ -2,8 +2,8 @@ >> # Makefile for linux checkpoint/restart. >> # >> >> -obj-$(CONFIG_CHECKPOINT) += sys.o objhash.o \ >> +obj-$(CONFIG_CHECKPOINT) += sys.o objhash.o deferqueue.o \ >> checkpoint.o restart.o \ >> ckpt_task.o rstr_task.o \ >> ckpt_mem.o rstr_mem.o \ >> - ckpt_file.o rstr_file.o >> + ckpt_file.o rstr_file.o \ > > ? > >> +int cr_deferqueue_add(struct cr_ctx *ctx, cr_deferqueue_func_t function, >> + unsigned int flags, void *data, int size) >> +{ >> + struct cr_deferqueue *wq; >> + >> + wq = kmalloc(sizeof(wq) + size, GFP_KERNEL); >> + if (!wq) >> + return -ENOMEM; >> + >> + wq->function = function; >> + wq->flags = flags; >> + memcpy(wq->data, data, size); >> + >> + cr_debug("adding work %p function %p\n", wq, wq->function); >> + list_add_tail(&ctx->deferqueue, &wq->list); >> + return 0; >> +} > > Shouldn't the deferqueue be protected by a spinlock here? Not until we implement concurrent checkpoint/restart. At the moment it's one task at a time the can access it. Oren.