From kingsley@sw.oz.au Thu Jun 16 18:46:44 2005 Received: with ECARTIS (v1.0.0; list pagg); Thu, 16 Jun 2005 18:46:47 -0700 (PDT) Received: from smtp.sw.oz.au (alt.aurema.com [203.217.18.57]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id j5H1keH9011686 for ; Thu, 16 Jun 2005 18:46:43 -0700 Received: from kingsley.sw.oz.au (kingsley.sw.oz.au [192.41.203.97]) by smtp.sw.oz.au with ESMTP id j5H1jGhP028352; Fri, 17 Jun 2005 11:45:16 +1000 (EST) Received: from kingsley.sw.oz.au (localhost.localdomain [127.0.0.1]) by kingsley.sw.oz.au (8.13.1/8.12.10) with ESMTP id j5H1jFMA010342; Fri, 17 Jun 2005 11:45:16 +1000 Received: (from kingsley@localhost) by kingsley.sw.oz.au (8.13.1/8.13.1/Submit) id j5H1jCPw010340; Fri, 17 Jun 2005 11:45:12 +1000 Date: Fri, 17 Jun 2005 11:45:12 +1000 From: Kingsley Cheung To: Erik Jacobson Cc: pagg@oss.sgi.com, tonyt@aurema.com Subject: [patch] Minor PAGG attach/detach semantic change for 2.6.11 Message-ID: <20050617014512.GA10285@aurema.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="AqsLC8rIMeq19msA" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Scanned-By: MIMEDefang 2.48 on 192.41.203.35 X-archive-position: 93 X-ecartis-version: Ecartis v1.0.0 Sender: pagg-bounce@oss.sgi.com Errors-to: pagg-bounce@oss.sgi.com X-original-sender: kingsley@aurema.com Precedence: bulk X-list: pagg --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Erik, While testing the propagation of pagg_attach errors to fork() I noticed that the detach callback is called again for the client responsible for the error. Perhaps you may have a different opinion on this, but IMHO this is unnecessary as the client passing the failure error up should have already cleaned up any data in its pagg structure during its attach callback. I've atttached a patch that applies (with some fuzz) correctly to 2.6.11 that avoids this unncessary call to the client's detach callback. Please consider applying. Thanks, -- Kingsley --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pagg.patch" Index: kernel/fork.c =================================================================== RCS file: /export/cvsroot/SLES9_kernel/kernel/fork.c,v retrieving revision 1.1.1.3.12.1 diff -u -r1.1.1.3.12.1 fork.c --- kernel/fork.c 27 May 2005 05:17:01 -0000 1.1.1.3.12.1 +++ kernel/fork.c 17 Jun 2005 00:39:33 -0000 @@ -1086,7 +1086,7 @@ if (sigismember(¤t->pending.signal, SIGKILL)) { write_unlock_irq(&tasklist_lock); retval = -EINTR; - goto bad_fork_cleanup_namespace; + goto bad_fork_cleanup_pagg; } /* CLONE_PARENT re-uses the old parent */ @@ -1107,7 +1107,7 @@ spin_unlock(¤t->sighand->siglock); write_unlock_irq(&tasklist_lock); retval = -EAGAIN; - goto bad_fork_cleanup_namespace; + goto bad_fork_cleanup_pagg; } p->group_leader = current->group_leader; @@ -1149,8 +1149,9 @@ return ERR_PTR(retval); return p; -bad_fork_cleanup_namespace: +bad_fork_cleanup_pagg: pagg_detach(p); +bad_fork_cleanup_namespace: exit_namespace(p); bad_fork_cleanup_mm: exit_mm(p); Index: kernel/pagg.c =================================================================== RCS file: /export/cvsroot/SLES9_kernel/kernel/Attic/pagg.c,v retrieving revision 1.1.1.1.12.1 diff -u -r1.1.1.1.12.1 pagg.c --- kernel/pagg.c 27 May 2005 05:17:01 -0000 1.1.1.1.12.1 +++ kernel/pagg.c 17 Jun 2005 00:39:33 -0000 @@ -410,14 +410,15 @@ goto error_return; } ret = to_pagg->hook->attach(to_task, to_pagg, from_pagg->data); - - if (ret < 0) { - /* Propagates to copy_process as a fork failure */ - goto error_return; - } - else if (ret > 0) { - /* Success, but attach function pointer doesn't want grouping */ + if (ret) { + /* Negative error propagates to copy_process + * as a fork failure. Otherwise we have + * success, but the attach function pointer + * doesn't want grouping. + */ pagg_free(to_pagg); + if (ret < 0) + goto error_return; } } --AqsLC8rIMeq19msA-- From jlan@engr.sgi.com Wed Jun 22 18:33:55 2005 Received: with ECARTIS (v1.0.0; list pagg); Wed, 22 Jun 2005 18:33:57 -0700 (PDT) Received: from omx1.americas.sgi.com (omx1-ext.sgi.com [192.48.179.11]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id j5N1XsH9031423 for ; Wed, 22 Jun 2005 18:33:55 -0700 Received: from nodin.corp.sgi.com (nodin.corp.sgi.com [192.26.51.193]) by omx1.americas.sgi.com (8.12.10/8.12.9/linux-outbound_gateway-1.1) with ESMTP id j5N1WXxT020117 for ; Wed, 22 Jun 2005 20:32:33 -0500 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by nodin.corp.sgi.com (SGI-8.12.5/8.12.10/SGI_generic_relay-1.2) with ESMTP id j5N1WXbT85811741 for ; Wed, 22 Jun 2005 18:32:33 -0700 (PDT) Received: from aware.engr.sgi.com (aware.engr.sgi.com [163.154.6.184]) by cthulhu.engr.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id j5N1VWdO20818827; Wed, 22 Jun 2005 18:31:32 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by aware.engr.sgi.com (Postfix) with ESMTP id 70DF8282240C; Wed, 22 Jun 2005 18:31:32 -0700 (PDT) Message-ID: <42BA10F3.3060703@engr.sgi.com> Date: Wed, 22 Jun 2005 18:31:31 -0700 From: Jay Lan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040906 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pagg@oss.sgi.com Subject: New JOB rpm uploaded (1.5.0-0.3) X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 94 X-ecartis-version: Ecartis v1.0.0 Sender: pagg-bounce@oss.sgi.com Errors-to: pagg-bounce@oss.sgi.com X-original-sender: jlan@engr.sgi.com Precedence: bulk X-list: pagg Hi, I uploaded JOB user-land rpm job-1.5.0-0.3.i386.rpm and job-1.5.0-0.3.src.rpm to oss.sgi.com. Please note that job-1.5.0-0.x versions contain the jobfs virtual file system implementation. These version of job rpm requires job kernel patches with jobfs support, which is available in these job kernel patches: linux-2.6.10-job.patch-1 and linux-2.6.11-job.patch. The changelog showes the bug fixes since job-1.5.0-0.2: * Tue Jun 21 2005 Jay Lan - job-1.5.0-0.3 - Fixed a strict-aliasing problem that could fail job_create() function of libjob.so. - The job init script is installed to /etc/init.d/job instead of /etc/rc.d/init.d/job - Fixed more compilation warning's at lib/job.c. You can get the new rpm at ftp://oss.sgi.com/projects/pagg/download/ Visit http://oss.sgi.com/projects/pagg/ for more information about PAGG and JOB. Please check them out and have fun. Let me know if you have any problems. Best regards, Jay Lan - Linux System Software - Silicon Graphics From erikj@sgi.com Thu Jun 23 07:34:24 2005 Received: with ECARTIS (v1.0.0; list pagg); Thu, 23 Jun 2005 07:34:27 -0700 (PDT) Received: from omx1.americas.sgi.com (omx1-ext.sgi.com [192.48.179.11]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id j5NEYOH9023620 for ; Thu, 23 Jun 2005 07:34:24 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [198.149.16.15]) by omx1.americas.sgi.com (8.12.10/8.12.9/linux-outbound_gateway-1.1) with ESMTP id j5NEX2xT029521 for ; Thu, 23 Jun 2005 09:33:02 -0500 Received: from thistle-e236.americas.sgi.com (thistle-e236.americas.sgi.com [128.162.236.204]) by flecktone.americas.sgi.com (8.12.9/8.12.10/SGI_generic_relay-1.2) with ESMTP id j5NEX2R010787322; Thu, 23 Jun 2005 09:33:02 -0500 (CDT) Received: from snoot.americas.sgi.com (snoot.americas.sgi.com [128.162.233.102]) by thistle-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id j5NEX1KO35581271; Thu, 23 Jun 2005 09:33:01 -0500 (CDT) Received: by snoot.americas.sgi.com (Postfix, from userid 31161) id CD2631EB20; Thu, 23 Jun 2005 09:33:01 -0500 (CDT) Date: Thu, 23 Jun 2005 09:33:01 -0500 From: Erik Jacobson To: Kingsley Cheung Cc: Erik Jacobson , pagg@oss.sgi.com, tonyt@aurema.com Subject: Re: [patch] Minor PAGG attach/detach semantic change for 2.6.11 Message-ID: <20050623143301.GB32764@sgi.com> References: <20050617014512.GA10285@aurema.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050617014512.GA10285@aurema.com> User-Agent: Mutt/1.5.9i X-archive-position: 95 X-ecartis-version: Ecartis v1.0.0 Sender: pagg-bounce@oss.sgi.com Errors-to: pagg-bounce@oss.sgi.com X-original-sender: erikj@sgi.com Precedence: bulk X-list: pagg Kingsley - my first attempt skipped the list, sorry. > While testing the propagation of pagg_attach errors to fork() I > noticed that the detach callback is called again for the client I'm sorry it's taking a while for me to get back to you. I had kicked your patch around to a couple people internally and I think we want to investigate the error path more before we take it as part of the PAGG patch. Does anybody else on the list have thoughts on this change? Thanks for the submission. I'd like to do a bit more research. > responsible for the error. Perhaps you may have a different opinion > on this, but IMHO this is unnecessary as the client passing the > failure error up should have already cleaned up any data in its pagg > structure during its attach callback. > > I've atttached a patch that applies (with some fuzz) correctly to > 2.6.11 that avoids this unncessary call to the client's detach > callback. Please consider applying. > > Thanks, > -- > Kingsley > Index: kernel/fork.c > =================================================================== > RCS file: /export/cvsroot/SLES9_kernel/kernel/fork.c,v > retrieving revision 1.1.1.3.12.1 > diff -u -r1.1.1.3.12.1 fork.c > --- kernel/fork.c 27 May 2005 05:17:01 -0000 1.1.1.3.12.1 > +++ kernel/fork.c 17 Jun 2005 00:39:33 -0000 > @@ -1086,7 +1086,7 @@ > if (sigismember(¤t->pending.signal, SIGKILL)) { > write_unlock_irq(&tasklist_lock); > retval = -EINTR; > - goto bad_fork_cleanup_namespace; > + goto bad_fork_cleanup_pagg; > } > > /* CLONE_PARENT re-uses the old parent */ > @@ -1107,7 +1107,7 @@ > spin_unlock(¤t->sighand->siglock); > write_unlock_irq(&tasklist_lock); > retval = -EAGAIN; > - goto bad_fork_cleanup_namespace; > + goto bad_fork_cleanup_pagg; > } > p->group_leader = current->group_leader; > > @@ -1149,8 +1149,9 @@ > return ERR_PTR(retval); > return p; > > -bad_fork_cleanup_namespace: > +bad_fork_cleanup_pagg: > pagg_detach(p); > +bad_fork_cleanup_namespace: > exit_namespace(p); > bad_fork_cleanup_mm: > exit_mm(p); > Index: kernel/pagg.c > =================================================================== > RCS file: /export/cvsroot/SLES9_kernel/kernel/Attic/pagg.c,v > retrieving revision 1.1.1.1.12.1 > diff -u -r1.1.1.1.12.1 pagg.c > --- kernel/pagg.c 27 May 2005 05:17:01 -0000 1.1.1.1.12.1 > +++ kernel/pagg.c 17 Jun 2005 00:39:33 -0000 > @@ -410,14 +410,15 @@ > goto error_return; > } > ret = to_pagg->hook->attach(to_task, to_pagg, from_pagg->data); > - > - if (ret < 0) { > - /* Propagates to copy_process as a fork failure */ > - goto error_return; > - } > - else if (ret > 0) { > - /* Success, but attach function pointer doesn't want grouping */ > + if (ret) { > + /* Negative error propagates to copy_process > + * as a fork failure. Otherwise we have > + * success, but the attach function pointer > + * doesn't want grouping. > + */ > pagg_free(to_pagg); > + if (ret < 0) > + goto error_return; > } > } > -- Erik Jacobson - Linux System Software - Silicon Graphics - Eagan, Minnesota