Date: Wed, 29 Dec 2010 04:16:12 +0000 (UTC) From: Jeff Roberson <jeff@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r216788 - projects/ofed/head/sys/ofed/include/linux Message-ID: <201012290416.oBT4GCY1086921@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jeff Date: Wed Dec 29 04:16:12 2010 New Revision: 216788 URL: http://svn.freebsd.org/changeset/base/216788 Log: - cancel_delayed_work() is not expected to be perfect and may be called with locks held. Use the non-blocking callout_stop() and a non-blocking workqueue_cancel(). Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/sys/ofed/include/linux/workqueue.h Modified: projects/ofed/head/sys/ofed/include/linux/workqueue.h ============================================================================== --- projects/ofed/head/sys/ofed/include/linux/workqueue.h Wed Dec 29 04:14:24 2010 (r216787) +++ projects/ofed/head/sys/ofed/include/linux/workqueue.h Wed Dec 29 04:16:12 2010 (r216788) @@ -167,17 +167,20 @@ flush_taskqueue(struct taskqueue *tq) #define cancel_work_sync(work) \ (work)->taskqueue ? \ - taskqueue_cancel((work)->taskqueue, &(work)->work_task) : 0 + taskqueue_cancel((work)->taskqueue, &(work)->work_task, 1) : 0 +/* + * This may leave work running on another CPU as it does on Linux. + */ static inline int cancel_delayed_work(struct delayed_work *work) { int error; - error = callout_drain(&work->timer); - if (error == 0 && work->work.taskqueue) + callout_stop(&work->timer); + if (work->work.taskqueue) error = taskqueue_cancel(work->work.taskqueue, - &work->work.work_task); + &work->work.work_task, 0); return error; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012290416.oBT4GCY1086921>