lkml.org 
[lkml]   [2009]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/7] async: Asynchronous function calls to speed up kernel boot
Em Wed, Jan 07, 2009 at 03:12:26PM -0800, Arjan van de Ven escreveu:

<SNIP>

> +/*
> + * MUST be called with the lock held!
> + */
> +static async_cookie_t __lowest_in_progress(struct list_head *running)
> +{
> + struct async_entry *entry;
> + if (!list_empty(&async_pending)) {
> + entry = list_first_entry(&async_pending,
> + struct async_entry, list);

Small nitpick:

- > + return entry->cookie;
> + } else if (!list_empty(running)) {
> + entry = list_first_entry(running,
> + struct async_entry, list);
- > + return entry->cookie;
> + } else {
> + /* nothing in progress... next_cookie is "infinity" */
> + return next_cookie;
> + }

+ return entry->cookie;

> +/*
> + * 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);

We have list_move_tail()

> + spin_unlock_irqrestore(&async_lock, flags);
> +
> + /* 3) run it (and print duration)*/
> + if (initcall_debug) {
> + printk("calling %lli_%pF @ %i\n", entry->cookie, entry->func, task_pid_nr(current));
> + calltime = ktime_get();

- Arnaldo


\
 
 \ /
  Last update: 2009-01-08 01:35    [W:0.162 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site