From patchwork Fri Mar 6 14:23:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 11424121 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA11517EF for ; Fri, 6 Mar 2020 14:27:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D70F20717 for ; Fri, 6 Mar 2020 14:27:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="isfcE1QF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D70F20717 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jADwZ-0007Ln-IH for patchwork-qemu-devel@patchwork.kernel.org; Fri, 06 Mar 2020 09:27:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32808) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jADtK-0003n9-4u for qemu-devel@nongnu.org; Fri, 06 Mar 2020 09:23:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jADtI-0002Qq-WA for qemu-devel@nongnu.org; Fri, 06 Mar 2020 09:23:54 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:49415 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jADtI-0002K0-SF for qemu-devel@nongnu.org; Fri, 06 Mar 2020 09:23:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583504632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZvHkvVd+7sDC+hYczEiqu5wvxhfUX/wUGDE/sBpPNn4=; b=isfcE1QF1hwNvgHnXsh5eaCQ9/JzOPRPWQPFvHKh9F9QrE9ybp42hRG+5YyH1QIYdA8K/q busk+Q1NEAJ8hvpmTF+U0oJhxtoffe0Tc8gHSUIp7pNPF9EEtvZdXliTUuAIbKNiUmOeoJ T3TX6PrulXekHLv8ysnl7TG5ol3x1TM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-108-tRUanmDlPJa04cFQjeqajg-1; Fri, 06 Mar 2020 09:23:48 -0500 X-MC-Unique: tRUanmDlPJa04cFQjeqajg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3E8CD800D5B; Fri, 6 Mar 2020 14:23:47 +0000 (UTC) Received: from localhost (unknown [10.36.118.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41C68909FB; Fri, 6 Mar 2020 14:23:41 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL 3/3] tests: Fix a bug with count variables Date: Fri, 6 Mar 2020 14:23:18 +0000 Message-Id: <20200306142318.1435372-4-stefanha@redhat.com> In-Reply-To: <20200306142318.1435372-1-stefanha@redhat.com> References: <20200306142318.1435372-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Peter Maydell , Thomas Huth , Tianjia Zhang , qemu-block@nongnu.org, Alexander Bulekov , Bandan Das , Stefan Hajnoczi , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Tianjia Zhang The counting code here should use the local variable n_nodes_local. Otherwise, the variable n_nodes is counting incorrectly, causing the counting logic of the code to be wrong. Signed-off-by: Tianjia Zhang Signed-off-by: Stefan Hajnoczi Link: https://lore.kernel.org/r/20200207115433.118254-1-tianjia.zhang@linux.alibaba.com Message-Id: <20200207115433.118254-1-tianjia.zhang@linux.alibaba.com> --- tests/test-rcu-list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c index 1442c0c982..92be51ec50 100644 --- a/tests/test-rcu-list.c +++ b/tests/test-rcu-list.c @@ -235,7 +235,7 @@ static void *rcu_q_updater(void *arg) j++; if (target_el == j) { struct list_element *new_el = g_new(struct list_element, 1); - n_nodes += n_nodes_local; + n_nodes_local++; TEST_LIST_INSERT_AFTER_RCU(el, new_el, entry); break; }