public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederik Deweerdt <frederik.deweerdt@xprog.eu>
To: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Greg KH <greg@kroah.com>, linux-kernel@vger.kernel.org, dst@ioremap.net
Subject: Re: [4/7] dst: thread pool.
Date: Wed, 14 Jan 2009 15:46:02 +0100	[thread overview]
Message-ID: <20090114144602.GG10720@gambetta> (raw)
In-Reply-To: <1231887933-17843-5-git-send-email-zbr@ioremap.net>

Hi Evgeniy,

On Wed, Jan 14, 2009 at 02:05:30AM +0300, Evgeniy Polyakov wrote:
[...]
> +void thread_pool_del_worker(struct thread_pool *p)
> +{
> +	struct thread_pool_worker *w = NULL;
> +
> +	while (!w) {
> +		wait_event(p->wait, !list_empty(&p->ready_list) || !p->thread_num);
								   ^^^^^^^^^^^^^^
What's the purpose of !p->thread_num here? Is there an exit case missing
in the loop below?

> +
> +		dprintk("%s: locking list_empty: %d, thread_num: %d.\n",
> +				__func__, list_empty(&p->ready_list), p->thread_num);
> +
> +		mutex_lock(&p->thread_lock);
> +		if (!list_empty(&p->ready_list)) {
> +			w = list_first_entry(&p->ready_list,
> +					struct thread_pool_worker,
> +					worker_entry);
> +
> +			dprintk("%s: deleting w: %p, thread_num: %d, list: %p [%p.%p].\n",
> +					__func__, w, p->thread_num, &p->ready_list,
> +					p->ready_list.prev, p->ready_list.next);
> +
> +			p->thread_num--;
> +			list_del(&w->worker_entry);
> +		}
> +		mutex_unlock(&p->thread_lock);
> +	}
> +
> +	if (w)
> +		thread_pool_exit_worker(w);
> +	dprintk("%s: deleted w: %p, thread_num: %d.\n",
> +			__func__, w, p->thread_num);
> +}

  parent reply	other threads:[~2009-01-14 14:46 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-13 23:05 [0/7] Distributed storage for drivers/staging merge request Evgeniy Polyakov
2009-01-13 23:05 ` [1/7] dst: core files Evgeniy Polyakov
2009-01-13 23:05   ` [2/7] dst: network state machine Evgeniy Polyakov
2009-01-13 23:05     ` [3/7] dst: export node Evgeniy Polyakov
2009-01-13 23:05       ` [4/7] dst: thread pool Evgeniy Polyakov
2009-01-13 23:05         ` [5/7] dst: transactions Evgeniy Polyakov
2009-01-13 23:05           ` [6/7] dst: crypto processing Evgeniy Polyakov
2009-01-13 23:05             ` [7/7] dst: kconfig and makefile changes Evgeniy Polyakov
2009-01-13 23:09               ` [8/7] dst: kconfig update Evgeniy Polyakov
2009-01-14  2:22                 ` Randy Dunlap
2009-01-14  9:09                   ` Evgeniy Polyakov
2009-01-14  2:22               ` [7/7] dst: kconfig and makefile changes Randy Dunlap
2009-01-14 14:46         ` Frederik Deweerdt [this message]
2009-01-14 15:01           ` [4/7] dst: thread pool Evgeniy Polyakov
2009-01-15  5:58         ` Andrew Morton
2009-01-15  8:47           ` Evgeniy Polyakov
2009-01-19  0:10           ` Arjan van de Ven
2009-01-19 17:07             ` Evgeniy Polyakov
2009-02-05 13:55             ` David Howells
2009-01-14 14:52       ` [3/7] dst: export node Jens Axboe
2009-01-14 15:11         ` Evgeniy Polyakov
2009-01-13 23:39 ` [0/7] Distributed storage for drivers/staging merge request Greg KH
2009-01-13 23:47   ` Evgeniy Polyakov
2009-01-14  0:01     ` Greg KH
2009-01-14  0:08       ` Evgeniy Polyakov
2009-01-14  0:12       ` Andrew Morton
2009-01-14  0:15         ` Evgeniy Polyakov
2009-01-14  0:20           ` Evgeniy Polyakov
2009-01-14  0:23             ` Andrew Morton
2009-01-14  0:24               ` Evgeniy Polyakov
2009-01-14  9:39               ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2008-12-26 11:56 [0/7] Distributed storage release Evgeniy Polyakov
2008-12-26 11:56 ` [1/7] dst: core files Evgeniy Polyakov
2008-12-26 11:56   ` [2/7] dst: network state machine Evgeniy Polyakov
2008-12-26 11:56     ` [3/7] dst: export node Evgeniy Polyakov
2008-12-26 11:56       ` [4/7] dst: thread pool Evgeniy Polyakov
2008-12-17 13:53 [0/7] dst: new release introduction Evgeniy Polyakov
2008-12-17 13:53 ` [1/7] dst: core files Evgeniy Polyakov
2008-12-17 13:53   ` [2/7] dst: network state machine Evgeniy Polyakov
2008-12-17 13:53     ` [3/7] dst: export node Evgeniy Polyakov
2008-12-17 13:53       ` [4/7] dst: thread pool Evgeniy Polyakov
2008-12-17 15:55         ` Arnd Bergmann
2008-12-17 20:03           ` Benjamin Herrenschmidt
2008-12-17 23:32             ` Evgeniy Polyakov
2008-12-18  0:51               ` Benjamin Herrenschmidt
2008-12-18  8:10                 ` Evgeniy Polyakov
2008-12-18  9:44                   ` Arnd Bergmann
2008-12-17 23:39           ` Evgeniy Polyakov

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=20090114144602.GG10720@gambetta \
    --to=frederik.deweerdt@xprog.eu \
    --cc=dst@ioremap.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zbr@ioremap.net \
    /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