public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james@albanarts.com>
To: Tejun Heo <tj@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Dan Williams <djbw@fb.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] async: replace list of active domains with global list of pending items
Date: Fri, 25 Jan 2013 00:13:45 +0000	[thread overview]
Message-ID: <20130125001345.GA1960@balrog> (raw)
In-Reply-To: <20130119004100.GL24579@htj.dyndns.org>

Hi,

On Fri, Jan 18, 2013 at 04:41:00PM -0800, Tejun Heo wrote:
> @@ -125,9 +134,8 @@ static void async_run_entry_fn(struct work_struct *work)
>  
>  	/* 2) remove self from the pending queues */
>  	spin_lock_irqsave(&async_lock, flags);
> -	list_del(&entry->list);
> -	if (domain->registered && list_empty(&domain->pending))
> -		list_del_init(&domain->node);
> +	list_del_init(&entry->domain_list);
> +	list_del_init(&entry->global_list);

this unconditionally unlinks the global_list entry, however...

>  
>  	/* 3) free the entry */
>  	kfree(entry);
> @@ -168,10 +176,14 @@ static async_cookie_t __async_schedule(async_func_ptr *ptr, void *data, struct a
>  	entry->domain = domain;
>  
>  	spin_lock_irqsave(&async_lock, flags);
> +
> +	/* allocate cookie and queue */
>  	newcookie = entry->cookie = next_cookie++;
> -	if (domain->registered && list_empty(&domain->pending))
> -		list_add_tail(&domain->node, &async_domains);
> -	list_add_tail(&entry->list, &domain->pending);
> +
> +	list_add_tail(&entry->domain_list, &domain->pending);
> +	if (domain->registered)
> +		list_add_tail(&entry->global_list, &async_global_pending);

if (!domain->registered) then entry->global_list will have NULL pointers
from the kzalloc, so the list_del_init above will crash.

Should it have this?
+	else
+		INIT_LIST_HEAD(&entry->global_list)

Cheers
James

  reply	other threads:[~2013-01-25  0:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-19  0:39 [PATCHSET] async: reimplement synchronization Tejun Heo
2013-01-19  0:39 ` [PATCH 1/4] async: bring sanity to the use of words domain and running Tejun Heo
2013-01-19  0:40 ` [PATCH 2/4] async: use ULLONG_MAX for infinity cookie value Tejun Heo
2013-01-19  0:40 ` [PATCH 3/4] async: keep pending tasks on async_domain and remove async_pending Tejun Heo
2013-01-19  0:41 ` [PATCH 4/4] async: replace list of active domains with global list of pending items Tejun Heo
2013-01-25  0:13   ` James Hogan [this message]
2013-01-25  1:01     ` Tejun Heo
2013-01-25 10:08       ` James Hogan
2013-01-25 10:10         ` James Hogan
2013-01-25 10:13       ` [PATCH 1/1] async: initialise list heads to fix crash James Hogan
2013-01-25 17:17         ` Tejun Heo
2013-01-23 17:33 ` [PATCHSET] async: reimplement synchronization Tejun Heo

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=20130125001345.GA1960@balrog \
    --to=james@albanarts.com \
    --cc=arjan@linux.intel.com \
    --cc=djbw@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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