views:

23

answers:

1

I'm learning the Work queues to code bottom halves in the linux kernel. I wonder: if the interrupt handler is executed two times (thus calling schedule_work two times), does the work queue handler be called once or twice?

+1  A: 

Looks like your answer is in the comment for the function.

/**
 * schedule_work - put work task in global workqueue
 * @work: job to be done
 *
 * Returns zero if @work was already on the kernel-global workqueue and
 * non-zero otherwise.
 *
 * This puts a job in the kernel-global workqueue if it was not already
 * queued and leaves it in the same position on the kernel-global
 * workqueue otherwise.
 */
int schedule_work(struct work_struct *work)
{
        return queue_work(keventd_wq, work);
}
Noah Watkins