public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Namhyung Kim <namhyung@kernel.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] kthread: kill task_get_live_kthread()
Date: Mon, 11 Mar 2013 18:36:25 +0100	[thread overview]
Message-ID: <20130311173625.GA13525@redhat.com> (raw)

Hello.

Imho, task_get_live_kthread() is very confusing and unneeded.
2a1d4460 copied get_task_struct() + "vfork_done != NULL" from
kthread_stop(), but only kthread_stop() needs them both.

It needs get_task_struct() because kthread_stop() can be used
when the caller doesn't have a reference but we know that this
thread can't exit itself.

At the same time, if it can exit we do not need get_task_struct()
(the caller must have a reference) but we need to ensure we do not
use to_kthread(NULL) if it has exited.

I think that kthread_park/unpark can simply use to_kthread(), but
this series only removes get_task_struct() and keeps "alive" check.



But the actual reason for this cleanup is that I do not understand
why park/unpark abuse kthread.c.

Thomas, can't we move kthread->parked/cpu to smpboot_thread_data
and move all this code into kernel/smpboot.c? Just for example,
why kthread() does __kthread_parkme() ? smpboot_thread_fn() can do
this at the start.

Or this would be wrong/undesirable by some reason?

Oleg.


             reply	other threads:[~2013-03-11 17:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11 17:36 Oleg Nesterov [this message]
2013-03-11 17:36 ` [PATCH 1/2] kthread: introduce to_live_kthread() Oleg Nesterov
2013-03-11 17:36 ` [PATCH 2/2] kthread: kill task_get_live_kthread() Oleg Nesterov
2013-03-11 21:15 ` [PATCH 0/2] " Thomas Gleixner
2013-03-12 17:04   ` Oleg Nesterov
2013-03-12 18:18     ` Thomas Gleixner

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=20130311173625.GA13525@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rusty@rustcorp.com.au \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    /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