Re: [PATCH] floppy: convert to delayed work and single-thread wq
From: Tejun Heo
Date: Wed May 16 2012 - 13:01:31 EST
On Wed, May 16, 2012 at 09:36:51AM +0200, Jiri Kosina wrote:
> +static struct workqueue_struct *floppy_wq;
> +
> static struct floppy_struct *_floppy = floppy_type;
> static unsigned char current_drive;
> static long current_count_sectors;
> @@ -629,16 +631,15 @@ static inline void set_debugt(void) { }
> static inline void debugt(const char *func, const char *msg) { }
> #endif /* DEBUGT */
>
> -typedef void (*timeout_fn)(unsigned long);
> -static DEFINE_TIMER(fd_timeout, floppy_shutdown, 0, 0);
>
> +static DECLARE_DELAYED_WORK(fd_timeout, floppy_shutdown);
> static const char *timeout_message;
There's no need to create a separate workqueue for this. There's just
single work item which shouldn't be executed concurrently on different
CPUs, right? Just queueing the work item onto system_nrt_wq should be
enough.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/