Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1275931

Re: [PATCH v3 07/22] kthread: Detect when a kthread work is used by more workers

From Tejun Heo <tj@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3 07/22] kthread: Detect when a kthread work is used by more workers
Date 2015-11-23 23:30 +0100
Message-ID <qy7Mu-7WJ-1@gated-at.bofh.it> (permalink)
References <qwaYa-3sP-5@gated-at.bofh.it> <qwaYb-3sP-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

On Wed, Nov 18, 2015 at 02:25:12PM +0100, Petr Mladek wrote:
> @@ -610,6 +625,12 @@ repeat:
>  	if (work) {
>  		__set_current_state(TASK_RUNNING);
>  		work->func(work);
> +
> +		spin_lock_irq(&worker->lock);
> +		/* Allow to queue the work into another worker */
> +		if (!kthread_work_pending(work))
> +			work->worker = NULL;
> +		spin_unlock_irq(&worker->lock);

Doesn't this mean that the work item can't be freed from its callback?
That pattern tends to happen regularly.

Thanks.

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 07/22] kthread: Detect when a kthread work is used by more workers Petr Mladek <pmladek@suse.com> - 2015-11-18 14:30 +0100
  Re: [PATCH v3 07/22] kthread: Detect when a kthread work is used by  more workers Tejun Heo <tj@kernel.org> - 2015-11-23 23:30 +0100
    Re: [PATCH v3 07/22] kthread: Detect when a kthread work is used by  more workers Petr Mladek <pmladek@suse.com> - 2015-11-24 11:10 +0100
      Re: [PATCH v3 07/22] kthread: Detect when a kthread work is used by  more workers Tejun Heo <tj@kernel.org> - 2015-11-24 15:50 +0100
        Re: [PATCH v3 07/22] kthread: Detect when a kthread work is used by  more workers Petr Mladek <pmladek@suse.com> - 2015-11-24 17:30 +0100
      Re: [PATCH v3 07/22] kthread: Detect when a kthread work is used by  more workers Peter Zijlstra <peterz@infradead.org> - 2015-11-24 16:00 +0100

csiph-web