public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: Bill Kendall <wkendall@sgi.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH v2 6/8] xfsdump: process thread exit status
Date: Mon, 7 Nov 2011 20:03:22 -0600	[thread overview]
Message-ID: <1320717802.3186.97.camel@doink> (raw)
In-Reply-To: <1320699511-12281-7-git-send-email-wkendall@sgi.com>

On Mon, 2011-11-07 at 14:58 -0600, Bill Kendall wrote:
> When IRIX sprocs were in use, the main thread was notified of a thread
> exit just as if a child process exited -- it received SIGCHLD. The main
> thread would grab the pid and exit status, then call cldmgr_died() to
> inform it that the child was gone so the slot in the child array could
> be freed up for reuse.
> 
> This patch implements a similar mechanism for pthreads. The "c_busy"
> field in struct cld has been replaced with a "c_state" field that
> indicates whether the array slot is free (C_AVAIL), in use (C_ALIVE), or
> is waiting to be joined (C_EXITED). Additionally a "c_exit_code" field
> has been added to store the thread's exit value. Normally this is set
> when the thread entry function returns, but it is initialized to
> EXIT_INTERRUPT in case the thread is cancelled or calls pthread_exit()
> rather than returning (neither of which happens in the code today).
> 
> When the child thread starts, it registers a pthread cleanup handler
> which takes care of marking the child as C_EXITED and notifies the main
> thread that a child is gone. Doing this in a cleanup handler ensures
> that it's done regardless of how the thread exits. The main thread's
> loop is based around sigsuspsend(), so the notification is done by
> sending SIGUSR1. The main thread will then call cldmgr_join() to join
> all exited threads and obtain their exit status.
> 
> Additional changes:
> * cldmgr_findbypid() has been removed, it's no longer referenced.
> * stream_dead() no longer grabs the lock(), because it's called
>   only from cldmgr_join() which already holds the lock().
> 
> Signed-off-by: Bill Kendall <wkendall@sgi.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Looks OK to me.  Again, I've looked over this
pretty closely, but have not been as thorough
as I often am.

Reviewed-by: Alex Elder <aelder@sgi.com>


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2011-11-08  2:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07 20:58 [PATCH v2 0/8] xfsdump: enable support for multiple streams Bill Kendall
2011-11-07 20:58 ` [PATCH v2 1/8] xfsdump: link with libpthread Bill Kendall
2011-11-08  2:02   ` Alex Elder
2011-11-07 20:58 ` [PATCH v2 2/8] xfsdump: remove multi-stream synchronous dir dump Bill Kendall
2011-11-08  2:02   ` Alex Elder
2011-11-07 20:58 ` [PATCH v2 3/8] xfsdump: implement lock abstraction with pthreads Bill Kendall
2011-11-08  2:02   ` Alex Elder
2011-11-07 20:58 ` [PATCH v2 4/8] xfsdump: simplify qlock ordinal bitmap Bill Kendall
2011-11-08  2:02   ` Alex Elder
2011-11-07 20:58 ` [PATCH v2 5/8] xfsdump: convert IRIX sproc threads to pthreads Bill Kendall
2011-11-08  2:02   ` Alex Elder
2011-11-07 20:58 ` [PATCH v2 6/8] xfsdump: process thread exit status Bill Kendall
2011-11-08  2:03   ` Alex Elder [this message]
2011-11-07 20:58 ` [PATCH v2 7/8] xfsdump: path lookup cache must be thread specific Bill Kendall
2011-11-08  2:03   ` Alex Elder
2011-11-07 20:58 ` [PATCH v2 8/8] xfsdump: enable multiple streams Bill Kendall
2011-11-08  2:03   ` Alex Elder
2011-11-10 11:00 ` [PATCH v2 0/8] xfsdump: enable support for " Christoph Hellwig
2011-11-10 16:22   ` Bill Kendall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320717802.3186.97.camel@doink \
    --to=aelder@sgi.com \
    --cc=wkendall@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox