From patchwork Fri Sep 23 07:31:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 673967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sgRSw10LCz9t17 for ; Fri, 23 Sep 2016 18:33:04 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=sAebY3Jr; dkim-atps=neutral Received: from localhost ([::1]:42124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnLun-000634-NG for incoming@patchwork.ozlabs.org; Fri, 23 Sep 2016 04:33:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnKyy-0005of-F4 for qemu-devel@nongnu.org; Fri, 23 Sep 2016 03:33:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnKyu-0005om-9M for qemu-devel@nongnu.org; Fri, 23 Sep 2016 03:33:15 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnKyu-0005og-3Z for qemu-devel@nongnu.org; Fri, 23 Sep 2016 03:33:12 -0400 Received: by mail-wm0-f67.google.com with SMTP id l132so1282211wmf.1 for ; Fri, 23 Sep 2016 00:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lSEw6ZCFVQ5zwQiWlEHVHI7fgWBPnUJ6ANgpZdEHz1A=; b=sAebY3JrXIM5+iFx96Y+eXawkwmDE5huSc7qyomY8n6MCf1lnmzE0v27waKsZh0UyM Nq14vTr9o07u3gBykem1DCyG5y1QzvouE46f8Suce0H8u8CGzViL3HP0LJvYftpfxjLe jce44IlrMjG1QClEHs0jJhs8FN7PFYlQ3P4m3UGZFkhb+lFKMCgrAoaoBON6k2m6vXP6 EsmC0z5s908hviY1xTEdEJP1wepDTZ0xyhLm9/TR1gf/8NK1VTddd2iAVS0v9Br3BUcE Tl6903VDSFFd1MQWWOXEJSk5CwK8iRP0xtHLtW3kRX1jWr93fKcZfJT+wNRyyznSJ0pf v/GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=lSEw6ZCFVQ5zwQiWlEHVHI7fgWBPnUJ6ANgpZdEHz1A=; b=UiFrqGSeGkcm9moXVnLqUEY9HPPKOXHkK06+0VzwKBzLV/gvCNN8wixmucqyuu8/e0 YUHj17B9qRR7OTF8G/NBP8DlJ9CLu9u62z4/wip0YmqZBsEl4d+A93cxNCK2ZQXM4Tg4 7cmWv2WAGFOAKZe/czNAA3IKHe3EDjFy5/P/fU2o4oIXvOEkQLEFXkg5z2JOu30/omLq 6zreRPX3dGv4+y//D/QdWtnJBM7HuVeFxO/gXuUptBIIwWSz8TTwNAKRFXoV6w3Z6hXg aAPQGGSu+kuR6f6b8EvrNO0H3zfXnss1X3S/mW5prqP+kwgLOrBd71YuVD3eOjkSbg8K Evqg== X-Gm-Message-State: AA6/9RlS98GHw0pjxYyhxOa9+G9ub4s7s31jjrW77V19EI6XtxeoJ+YAM7mkrdaciiH1bA== X-Received: by 10.28.48.71 with SMTP id w68mr1436729wmw.4.1474615931195; Fri, 23 Sep 2016 00:32:11 -0700 (PDT) Received: from donizetti.lan (94-39-176-182.adsl-ull.clienti.tiscali.it. [94.39.176.182]) by smtp.gmail.com with ESMTPSA id q10sm1691267wme.6.2016.09.23.00.32.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Sep 2016 00:32:10 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 23 Sep 2016 09:31:45 +0200 Message-Id: <1474615909-17069-13-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474615909-17069-1-git-send-email-pbonzini@redhat.com> References: <1474615909-17069-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.67 Subject: [Qemu-devel] [PATCH 12/16] cpus-common: remove redundant call to exclusive_idle() 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: serge.fdrv@gmail.com, cota@braap.org, alex.bennee@linaro.org, sergey.fedorov@linaro.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" No need to call exclusive_idle() from cpu_exec_end since it is done immediately afterwards in cpu_exec_start. Any exclusive section could run as soon as cpu_exec_end leaves, because cpu->running is false and the mutex is not taken, so the call does not add any protection either. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée --- cpus-common.c | 1 - docs/tcg-exclusive.promela | 1 - 2 files changed, 2 deletions(-) diff --git a/cpus-common.c b/cpus-common.c index 115f3d4..80aaf9b 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -221,7 +221,6 @@ void cpu_exec_end(CPUState *cpu) qemu_cond_signal(&exclusive_cond); } } - exclusive_idle(); qemu_mutex_unlock(&qemu_cpu_list_lock); } diff --git a/docs/tcg-exclusive.promela b/docs/tcg-exclusive.promela index 360edcd..9e7d9e3 100644 --- a/docs/tcg-exclusive.promela +++ b/docs/tcg-exclusive.promela @@ -123,7 +123,6 @@ byte has_waiter[N_CPUS]; } \ :: else -> skip; \ fi; \ - exclusive_idle(); \ MUTEX_UNLOCK(mutex); // Promela processes