pagg
[Top] [All Lists]

[patch 2/2] Re: PAGG Threading Issues

To: Erik Jacobson <erikj@xxxxxxxxxxxxxxxxxxxxxxx>
Subject: [patch 2/2] Re: PAGG Threading Issues
From: Kingsley Cheung <kingsley@xxxxxxxxxx>
Date: Tue, 14 Dec 2004 12:28:28 +1100
Cc: pagg@xxxxxxxxxxx
In-reply-to: <20041108230039.GE18308@xxxxxxxxxx>
References: <20041108033648.GB18308@xxxxxxxxxx> <Pine.SGI.4.53.0411072233350.2612495@xxxxxxxxxxxxxxxxxxxxxxx> <20041108230039.GE18308@xxxxxxxxxx>
Sender: pagg-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
Hi Erik,

This is the second of the patches.  I believe it is in the best
interest of PAGG to be remain as container for Linux tasks and to let
PAGG clients decide whether they are interested in thread groups
(equivalent to processes) or individual threads.  

To achieve this we need to ensure we only attach individual tasks
_after_ their thread group has been established in the fork code.  For
this reason this patch moves the fork attach to the end of
copy_process().  Since this change can mean that we race with the
registration procedure, the attach code also checks to ensure that
tasks are not attached twice.

Another change the patch makes is to continue attachments for other
clients in pagg_attach even if the attach callback fails for one
client.  IMHO each client should be permitted to operate
independently of each other.

On Tue, Nov 09, 2004 at 10:00:39AM +1100, Kingsley Cheung wrote:
> 2) Is pagg intended to be a container for Linux tasks or thread
> groups?  I'm avoiding the use of the word "process" as that could be
> confusing in this context.
> 
> The reason I'm asking is because throughout the pagg registration code
> the for_each_process() macro is used.  This happens in
> remove_client_paggs_from_all_tasks() and pagg_hook_register().  The
> problem is, however, since 2.6 for_each_process() only traverses
> thread group leader tasks.  Thus the registration and deregistration
> code only considers thread group leaders.
> 
> In contrast the pagg_attach() and pagg_detach() hooks are placed to
> catch all tasks in the fork and exit code.  With the way the
> registration and deregistration code is behaving, this means that we
> won't catch all existing tasks and we won't clean up after all tasks
> properly for multi-threaded applications.
> 
> So what is pagg intended for?  To catch every single task?  In that
> case the do_each_thread() and while_each_thread() macros should be
> used.  Or is pagg a container for thread groups only?  The changes for
> that would require much more thought...

Thanks,
-- 
                Kingsley

Attachment: linux-2.6.9-pagg-attach.patch
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>
  • [patch 2/2] Re: PAGG Threading Issues, Kingsley Cheung <=