From patchwork Tue Feb 5 18:14:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1037045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RFfKiVkp"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43vD0Z1Ldhz9s7h for ; Wed, 6 Feb 2019 05:40:26 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gr5dw-0004yk-Fi for incoming@patchwork.ozlabs.org; Tue, 05 Feb 2019 13:40:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gr5GJ-0002La-IQ for qemu-devel@nongnu.org; Tue, 05 Feb 2019 13:16:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gr5GH-0003mE-CO for qemu-devel@nongnu.org; Tue, 05 Feb 2019 13:15:59 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:38246) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gr5GG-0003XX-U0 for qemu-devel@nongnu.org; Tue, 05 Feb 2019 13:15:57 -0500 Received: by mail-wr1-x435.google.com with SMTP id v13so4716360wrw.5 for ; Tue, 05 Feb 2019 10:15:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=CbQc0oVerUPwjt8sr54endkEDd1gxjnDLeM63jRNSVM=; b=RFfKiVkpgRuups/0p9c8zOUbhbhFKLNuUTC53dyeT+1Bf0M6/PAc6o4rU6FYpjrQTc kjtIJ6w/aY7owvBO+Vxb8pVEEx/N3YVwun2b00EO+w+mnTzlWQywkUbT9euDwe8+V2H2 UoOQKi5RV26VNOmXr/GnfbXcZ0ALy6PJSM3TOY2dnxpvjUt02Ku2XaREMjLTs7CCCMJb Dt7lYMeKoi+oig8Y+kvfirwl+ohsXbOuXYubWNB66JSkyKns5AkkK2DxY9MJVcvgshFy atW2I29imGSaoftHrGF4THyXV+Aft0TP1z/q+UyYA9etgGHSgbJWVoxW+lciM/++tAAp mxrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=CbQc0oVerUPwjt8sr54endkEDd1gxjnDLeM63jRNSVM=; b=fBeLimU4GDBTauIBGsYOOkfLsnKMrwo5gJhtQNfq4WxIHeXIYmVJu2oBEWmsXV0ume 0UMNP7U1NGmCkeeovmpuGrcGQSF8ubvUjdLFpTLj2zSTQyNzWnHL+OScn79Qcrl+yfX1 32VUDlqOFKkCUczPCu+d1+5vNuyqJ8bWd37VLFBQRIQ8pP8AvIeTTMamKgJ40U370Zrh hmfUkTSb+Sq0SHc8Gxy5PRCdhRX1QhznTm/SPXKhp/LOtSA4m+Lcivq4Two65SnmFRRP VWWJDokYpLHrwHBLb+NGVjBMeFd+Y9sG1aXsFFb9dDZGHzgwgOndigPHF0poCRiBkYz6 +oRA== X-Gm-Message-State: AHQUAuaIlFhLWklbXBvj/A00gRhPkAmxR7bPcgxfqIlIXQaNSxg/kb2b 4f7W7XMxZ1aGwNzMGUUokdSzWZa4 X-Google-Smtp-Source: AHgI3IYAt3+twGE0Yaw0pj+xyjeaJ42zE5+Q6sdLAF+/alTndHV281MZLwH9fLl1ajFOa0DHWD+L7g== X-Received: by 2002:adf:e8c1:: with SMTP id k1mr4508248wrn.104.1549390538432; Tue, 05 Feb 2019 10:15:38 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id p5sm8931665wmh.16.2019.02.05.10.15.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 10:15:37 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 5 Feb 2019 19:14:20 +0100 Message-Id: <1549390526-24246-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1549390526-24246-1-git-send-email-pbonzini@redhat.com> References: <1549390526-24246-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 Subject: [Qemu-devel] [PULL 10/76] cpus: ignore ESRCH in qemu_cpu_kick_thread() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier We can have a race condition between qemu_cpu_kick_thread() and qemu_kvm_cpu_thread_fn() when we hotunplug a CPU. In this case, qemu_cpu_kick_thread() can try to kick a thread that is exiting. pthread_kill() returns an error and qemu is stopped by an exit(1). qemu:qemu_cpu_kick_thread: No such process We can ignore safely this error. Signed-off-by: Laurent Vivier Signed-off-by: Paolo Bonzini --- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index b09b702..154daf5 100644 --- a/cpus.c +++ b/cpus.c @@ -1778,7 +1778,7 @@ static void qemu_cpu_kick_thread(CPUState *cpu) } cpu->thread_kicked = true; err = pthread_kill(cpu->thread->thread, SIG_IPI); - if (err) { + if (err && err != ESRCH) { fprintf(stderr, "qemu:%s: %s", __func__, strerror(err)); exit(1); }