Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751160AbWIKPsm (ORCPT ); Mon, 11 Sep 2006 11:48:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751311AbWIKPsm (ORCPT ); Mon, 11 Sep 2006 11:48:42 -0400 Received: from taganka54-host.corbina.net ([213.234.233.54]:45754 "EHLO mail.screens.ru") by vger.kernel.org with ESMTP id S1751160AbWIKPsm (ORCPT ); Mon, 11 Sep 2006 11:48:42 -0400 Date: Mon, 11 Sep 2006 19:48:33 +0400 From: Oleg Nesterov To: Cedric Le Goater Cc: "Eric W. Biederman" , Linux Kernel Mailing List , Andrew Morton , containers@lists.osdl.org Subject: Re: [patch -mm] update mq_notify to use a struct pid Message-ID: <20060911154833.GB82@oleg> References: <45019CC3.2030709@fr.ibm.com> <450537B6.1020509@fr.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <450537B6.1020509@fr.ibm.com> User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1659 Lines: 46 On 09/11, Cedric Le Goater wrote: > > Eric W. Biederman wrote: > > Cedric Le Goater writes: > > > >> message queues can signal a process waiting for a message. > >> > >> this patch replaces the pid_t value with a struct pid to avoid pid wrap > >> around problems. > >> > >> Signed-off-by: Cedric Le Goater > >> Cc: Eric Biederman > >> Cc: Andrew Morton > >> Cc: containers@lists.osdl.org > > > > Signed-off-by: Eric Biederman > > > > I was just about to send out this patch in a couple more hours. > > Well, you did the same with the usb/devio.c and friends :) > > > So expect the fact we wrote the same code is a good sign :) > > How does oleg feel about it ? I've seen some long thread on possible race > conditions with put_pid() and solutions with rcu. I didn't quite get all of > it ... it will need another run for me. I assume you are talking about this patch: http://marc.theaimsgroup.com/?l=linux-mm-commits&m=115773820415171 I think it's ok, info->notify_owner is always used under info->lock. This is simple. If, for example, mqueue_read_file() didn't take info->lock, then we have a problem: pid_nr() may read a freed memory in case when __do_notify()->put_pid() happens at the same time. In this context info->notify_owner is a usual refcounted object, no special attention is needed. Oleg. - 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/