mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Miroslav Benes <mbenes@suse.cz>,
	jeyu@kernel.org, pmladek@suse.com, lpechacek@suse.cz,
	live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
	Oleg Nesterov <oleg@redhat.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	linuxppc-dev@lists.ozlabs.org, x86@kernel.org
Subject: Re: [PATCH v2 2/3] livepatch: send a fake signal to all blocking tasks
Date: Sat, 12 Aug 2017 22:03:19 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LSU.2.20.1708122200220.30597@cbobk.fhfr.pm> (raw)
In-Reply-To: <20170811213046.bpbnhbbhqxn4jnmj@treble>

On Fri, 11 Aug 2017, Josh Poimboeuf wrote:

> > +	read_lock(&tasklist_lock);
> > +	for_each_process_thread(g, task) {
> > +		if (!klp_patch_pending(task))
> > +			continue;
> > +
> > +		/*
> > +		 * There is a small race here. We could see TIF_PATCH_PENDING
> > +		 * set and decide to wake up a kthread or send a fake signal.
> > +		 * Meanwhile the task could migrate itself and the action
> > +		 * would be meaningless. It is not serious though.
> > +		 */
> > +		if (task->flags & PF_KTHREAD) {
> > +			/*
> > +			 * Wake up a kthread which still has not been migrated.
> > +			 */
> > +			wake_up_process(task);
> > +		} else {
> > +			/*
> > +			 * Send fake signal to all non-kthread tasks which are
> > +			 * still not migrated.
> > +			 */
> > +			spin_lock_irq(&task->sighand->siglock);
> > +			signal_wake_up(task, 0);
> > +			spin_unlock_irq(&task->sighand->siglock);
> > +		}
> > +	}
> > +	read_unlock(&tasklist_lock);
> 
> I can't remember if we talked about this before, is it possible to also
> signal/wake the idle tasks?

Scheduler won't select idle task in case there is *anything* else runnable 
in any other sched class anyway. And if that is the case, there is no need 
for explicit wakeup, as idle task would get scheduled anyway implicitly.

So idle task is a little bit more difficult than that, unfortunately.

-- 
Jiri Kosina
SUSE Labs

  reply	other threads:[~2017-08-12 20:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 10:48 [PATCH v2 0/3] livepatch: Introduce force sysfs attribute Miroslav Benes
2017-08-10 10:48 ` [PATCH v2 1/3] livepatch: Add " Miroslav Benes
2017-08-11 21:13   ` Josh Poimboeuf
2017-08-14 14:03     ` Miroslav Benes
2017-08-16 13:15   ` Petr Mladek
2017-08-28 14:58     ` Miroslav Benes
2017-10-02 11:05       ` Petr Mladek
2017-08-10 10:48 ` [PATCH v2 2/3] livepatch: send a fake signal to all blocking tasks Miroslav Benes
2017-08-11 21:30   ` Josh Poimboeuf
2017-08-12 20:03     ` Jiri Kosina [this message]
2017-08-14 14:29     ` Miroslav Benes
2017-08-16 14:37   ` Petr Mladek
2017-08-10 10:48 ` [PATCH v2 3/3] livepatch: force transition process to finish Miroslav Benes
2017-08-30  7:24   ` Pavel Machek
2017-08-30 12:48     ` Miroslav Benes
2017-08-30 15:29       ` Josh Poimboeuf
2017-08-11 21:11 ` [PATCH v2 0/3] livepatch: Introduce force sysfs attribute Josh Poimboeuf
2017-08-14  8:49   ` Miroslav Benes
2017-08-16 14:50   ` Petr Mladek
2017-08-16 15:26     ` Josh Poimboeuf
2017-08-30 12:51       ` Miroslav Benes
2017-10-02 11:18         ` Petr Mladek
2017-08-16 13:31 ` Petr Mladek
2017-08-30 12:52   ` Miroslav Benes

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.LSU.2.20.1708122200220.30597@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=hpa@zytor.com \
    --cc=jeyu@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=live-patching@vger.kernel.org \
    --cc=lpechacek@suse.cz \
    --cc=luto@kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=oleg@redhat.com \
    --cc=pmladek@suse.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®