mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Howells <dhowells@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Alexander Gordeev <agordeev@redhat.com>,
	Chris Zankel <chris@zankel.net>, David Smith <dsmith@redhat.com>,
	"Frank Ch. Eigler" <fche@redhat.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Larry Woodman <lwoodman@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>, Tejun Heo <tj@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] genirq: reimplement exit_irq_thread() hook via task_work_queue()
Date: Fri, 13 Apr 2012 11:41:43 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1204131139450.2542@ionos> (raw)
In-Reply-To: <20120412211248.GC30456@redhat.com>

On Thu, 12 Apr 2012, Oleg Nesterov wrote:

> exit_irq_thread() and task->irq_thread are needed to handle
> the unexpected (and unlikely) exit of irq-thread.
> 
> We can use task_work instead and make this all private to
> kernel/irq/manage.c, simplification plus micro-optimization.
> 
> 1. rename exit_irq_thread() to irq_thread_dtor(), make it
>    static, and move it up before irq_thread().
> 
> 2. change irq_thread() to do task_queue_work(irq_thread_dtor)
>    at the start and task_work_cancel() before return.
> 
>    tracehook_notify_resume() can never play with kthreads,
>    only do_exit()->exit_task_work() can call the callback
>    and this is what we want.
> 
> 3. remove task_struct->irq_thread and the special hook
>    in do_exit().
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> ---
>  include/linux/interrupt.h |    4 --
>  include/linux/sched.h     |   10 +-----
>  kernel/exit.c             |    2 -
>  kernel/irq/manage.c       |   69 +++++++++++++++++++++-----------------------
>  4 files changed, 35 insertions(+), 50 deletions(-)

Nice cleanup.

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

      reply	other threads:[~2012-04-13  9:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12 21:11 [PATCH v3 0/3] task_work_queue() with 2 users Oleg Nesterov
2012-04-12 21:12 ` [PATCH v3 1/3] task_work_queue: add generic process-context callbacks Oleg Nesterov
2012-04-12 22:22   ` Andrew Morton
2012-04-12 23:15     ` Oleg Nesterov
2012-04-15 11:11       ` Peter Zijlstra
2012-04-12 21:12 ` [PATCH v3 2/3] cred: change keyctl_session_to_parent() to use task_work_queue() Oleg Nesterov
2012-04-12 21:12 ` [PATCH v3 3/3] genirq: reimplement exit_irq_thread() hook via task_work_queue() Oleg Nesterov
2012-04-13  9:41   ` Thomas Gleixner [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=alpine.LFD.2.02.1204131139450.2542@ionos \
    --to=tglx@linutronix.de \
    --cc=agordeev@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=chris@zankel.net \
    --cc=dhowells@redhat.com \
    --cc=dsmith@redhat.com \
    --cc=fche@redhat.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lwoodman@redhat.com \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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

Powered by JetHome