From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: Re: [RFC][PATCH 1/7] Factor out code to allocate pidmap page Date: Mon, 4 May 2009 11:27:43 -0700 Message-ID: <20090504182743.GA31892@linux.vnet.ibm.com> References: <12414250653025-git-send-email-sukadev@linux.vnet.ibm.com> <20090504182059.GN11734@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20090504182059.GN11734-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: Matt Helsley Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: containers.vger.kernel.org | OK, I'm having trouble not with your patch but the original code. This | test of map->page outside the spinlock looks like an incorrect fix to a | race. If map->page can be NULL right after we release the lock then it | can become NULL after this test just as easily. The map->page is not freed once allocated (free_pidmap() does not free the page). I guess the point is if you exceeded 32K pids (one page worth of pids) once, you would exceed it again; so no point freeing the page and reallocating the next time. Sukadev