Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757616AbZALXP0 (ORCPT ); Mon, 12 Jan 2009 18:15:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752857AbZALXPL (ORCPT ); Mon, 12 Jan 2009 18:15:11 -0500 Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:52543 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752665AbZALXPK (ORCPT ); Mon, 12 Jan 2009 18:15:10 -0500 Date: Mon, 12 Jan 2009 17:14:52 -0600 From: Nathan Lynch To: Oren Laadan Cc: Andrew Morton , Linus Torvalds , containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, Thomas Gleixner , Serge Hallyn , Dave Hansen , Ingo Molnar , "H. Peter Anvin" , Alexander Viro , Mike Waychison Subject: Re: [RFC v12][PATCH 13/14] Checkpoint multiple processes Message-ID: <20090112231452.GC6850@localdomain> References: <1230542187-10434-1-git-send-email-orenl@cs.columbia.edu> <1230542187-10434-14-git-send-email-orenl@cs.columbia.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1230542187-10434-14-git-send-email-orenl@cs.columbia.edu> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Pobox-Relay-ID: DAEB6AD8-E0FE-11DD-9C06-5720C92D7133-04752483!a-sasl-fastnet.pobox.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 883 Lines: 27 > +/* count number of tasks in tree (and optionally fill pid's in array) */ > +static int cr_tree_count_tasks(struct cr_ctx *ctx) > +{ > + struct task_struct *root = ctx->root_task; > + struct task_struct *task = root; > + struct task_struct *parent = NULL; > + struct task_struct **tasks_arr = ctx->tasks_arr; > + int tasks_nr = ctx->tasks_nr; > + int nr = 0; > + > + read_lock(&tasklist_lock); > + > + /* count tasks via DFS scan of the tree */ > + while (1) { > + if (tasks_arr) { > + /* unlikely, but ... */ > + if (nr == tasks_nr) > + return -EBUSY; /* cleanup in cr_ctx_free() */ Returns without unlocking tasklist_lock? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/