mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Subject: Re: [PATCH] kthread_work: add cancel_kthread_work[_sync]()
Date: Mon, 28 Jul 2014 14:20:38 -0400	[thread overview]
Message-ID: <20140728182038.GF7462@htj.dyndns.org> (raw)
In-Reply-To: <1406347444-4045-3-git-send-email-laijs@cn.fujitsu.com>

On Sat, Jul 26, 2014 at 12:04:01PM +0800, Lai Jiangshan wrote:
> When an object or a subsystem quits, we need to destroy the kthread_work
> which is used by the object or the subsystem.  We used to use
> flush_kthread_work().  But flush_kthread_work() has not any guarantee
> about the suspension of the work, this duty is pushed to the users.
> 
> So we introduce the cancel_kthread_work_sync() with a strict guarantee
> like cancel_work_sync() (workqueue).  We also introduce cancel_kthread_work()
> which can be used by users on some conditions.  And it is required for
> making the implementation of the cancel_kthread_work_sync() simpler.
> kthread_flush_work_fn() owns the running state of the kthread_worker
> and calls cancel_kthread_work() to cancel the possible requeued work.
> 
> Both cancel_kthread_work_sync() and cancel_kthread_work() share the
> code of flush_kthread_work() which also make the implementation simpler.
> 
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
>  include/linux/kthread.h |    2 +
>  kernel/kthread.c        |   78 ++++++++++++++++++++++++++++++++++++++--------
>  2 files changed, 66 insertions(+), 14 deletions(-)

We don't have any user.  Let's not implement features which aren't
used just for completeness.  If you can spot and convert users, please
be my guest.

Thanks.

-- 
tejun

      parent reply	other threads:[~2014-07-28 18:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-26  4:04 Lai Jiangshan
2014-07-28 18:18 ` [PATCH UPDATED] " Tejun Heo
2014-07-28 18:19   ` Tejun Heo
2014-07-28 18:20 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140728182038.GF7462@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nacc@linux.vnet.ibm.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®