mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joey Pabalinas <joeypabalinas@gmail.com>
To: x86@kernel.org
Cc: Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joey Pabalinas <joeypabalinas@gmail.com>
Subject: [PATCH] x86/kvm: replace TASK_UNINTERRUPTIBLE with TASK_KILLABLE
Date: Fri, 16 Mar 2018 00:57:29 -1000	[thread overview]
Message-ID: <20180316105729.ykomeftdvlzqm4p6@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

There doesn't seem to be any advantage to having a *completely*
uninterruptible task here. For most users, allowing a task to respond
to the SIGKILL interrupt signal (all other signals are ignored just like
TASK_UNINTERRUPTIBLE) will not impact them at all.

However, for the rare edge-cases where a task becomes stuck, maybe due to
snapshot corruption or some other similarly unrecoverable error, it
is *much* more convenient for a user to be able to have the additional
option of nuking that task with SIGKILL, rather than annoying them by
forcing them to reboot in order to remove the immortal process.

Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com>

 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index bc1a27280c4bf77899..7d4faee962e0c2e3c1 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -154,8 +154,8 @@ void kvm_async_pf_task_wait(u32 token, int interrupt_kernel)
 
 	for (;;) {
 		if (!n.halted)
-			prepare_to_swait(&n.wq, &wait, TASK_UNINTERRUPTIBLE);
-		if (hlist_unhashed(&n.link))
+			prepare_to_swait(&n.wq, &wait, TASK_KILLABLE);
+		if (hlist_unhashed(&n.link) || fatal_signal_pending(current))
 			break;
 
 		rcu_irq_exit();
-- 
Cheers,
Joey Pabalinas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2018-03-16 10:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 10:57 Joey Pabalinas [this message]
2018-03-29 21:41 ` Radim Krčmář
2018-05-06  4:26   ` Joey Pabalinas

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=20180316105729.ykomeftdvlzqm4p6@gmail.com \
    --to=joeypabalinas@gmail.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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®