lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 13 Jan 2009 13:48:59 -0700
From:	Jonathan Corbet <corbet@....net>
To:	Arjan van de Ven <arjan@...radead.org>
Cc:	linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
	akpm@...ux-foundation.org
Subject: Re: [PATCH 1/7] async: Asynchronous function calls to speed up
 kernel boot

[A somewhat belated question...]

As I read the patch, I find the async_entry structure:

> +struct async_entry {
> +	struct list_head list;
> +	async_cookie_t   cookie;
> +	async_func_ptr	 *func;
> +	void             *data;
> +	struct list_head *running;
> +};

The "running" field is, presumably, meant to hold a pointer to the
"running" queue to be used when this function is actually run.  But, then,
I see:

> +async_cookie_t async_schedule(async_func_ptr *ptr, void *data)
> +{
> +	return __async_schedule(ptr, data, &async_pending);
> +}
> +EXPORT_SYMBOL_GPL(async_schedule);

It seems to me that you wanted &async_running there, no?

However, it doesn't matter in the current form of the patch:

> +/*
> + * pick the first pending entry and run it
> + */
> +static void run_one_entry(void)
> +{
> +	unsigned long flags;
> +	struct async_entry *entry;
> +	ktime_t calltime, delta, rettime;
> +
> +	/* 1) pick one task from the pending queue */
> +
> +	spin_lock_irqsave(&async_lock, flags);
> +	if (list_empty(&async_pending))
> +		goto out;
> +	entry = list_first_entry(&async_pending, struct async_entry, list); 
> +
> +	/* 2) move it to the running queue */
> +	list_del(&entry->list);
> +	list_add_tail(&entry->list, &async_running);
> +	spin_unlock_irqrestore(&async_lock, flags);

Given the way things are designed, don't you want to add the entry to
entry->running, rather than unconditionally to async_running?  If not, I
don't see how calls to async_synchronize_cookie_special() can work right.

Of course, I'm probably just confused...enlighten me?

Thanks,

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ