From patchwork Fri Mar 6 09:57:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?YmF1ZXJjaGVuKOmZiOiSmeiSmSk=?= X-Patchwork-Id: 1250160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=none (p=none dis=none) header.from=tencent.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=tencent.com header.i=@tencent.com header.a=rsa-sha256 header.s=s202002 header.b=EvQLS9FB; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 48YjjV6Crkz9sRY for ; Fri, 6 Mar 2020 20:58:06 +1100 (AEDT) Received: from localhost ([::1]:33740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jA9k2-0007OD-TH for incoming@patchwork.ozlabs.org; Fri, 06 Mar 2020 04:58:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50740) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jA9jc-0007Nr-NL for qemu-devel@nongnu.org; Fri, 06 Mar 2020 04:57:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jA9jT-0002pK-8g for qemu-devel@nongnu.org; Fri, 06 Mar 2020 04:57:28 -0500 Received: from mail6.tencent.com ([220.249.245.26]:55528) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jA9jP-0002GI-KU; Fri, 06 Mar 2020 04:57:27 -0500 Received: from EX-SZ019.tencent.com (unknown [10.28.6.74]) by mail6.tencent.com (Postfix) with ESMTP id 1FED3CC538; Fri, 6 Mar 2020 17:57:45 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tencent.com; s=s202002; t=1583488665; bh=vXRGqYLfLn+t2valEtnzd7cHE0AuNyj6JvhmbRRLP6s=; h=From:To:CC:Subject:Date:References; b=EvQLS9FBiYls8vNJNcPG5EZ+GgxvJyhsQ29cjG6yRxBHIwKqNArQ3XOi3LOdGCGWf PACkfkgmAmbIFlfpPv9y3UwZQw7GRuiqYTLDDTTYxh9MfhlBff0kIqHAL57Uqpqsw9 HEJlKmLl/kuuqi6X75qxsT+POrNd3dyIz1GQkAG4= Received: from EX-SZ008.tencent.com (10.28.6.32) by EX-SZ019.tencent.com (10.28.6.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 6 Mar 2020 17:57:14 +0800 Received: from EX-SZ005.tencent.com (10.28.6.29) by EX-SZ008.tencent.com (10.28.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 6 Mar 2020 17:57:14 +0800 Received: from EX-SZ005.tencent.com ([fe80::ed4f:20ce:ec0d:e637]) by EX-SZ005.tencent.com ([fe80::ed4f:20ce:ec0d:e637%4]) with mapi id 15.01.1713.004; Fri, 6 Mar 2020 17:57:14 +0800 From: =?utf-8?b?YmF1ZXJjaGVuKOmZiOiSmeiSmSk=?= To: Christian Borntraeger , qemu-devel Subject: =?utf-8?b?5Zue5aSNOiBbUEFUQ0hdIG1lbS1wcmVhbGxvYzogaW5pdGlhbGl6?= =?utf-8?q?e_cond_and_mutex=28Internet_mail=29?= Thread-Topic: [PATCH] mem-prealloc: initialize cond and mutex(Internet mail) Thread-Index: AQHV85RZkOhBH6vxAEysUkxz/tkQww== Date: Fri, 6 Mar 2020 09:57:13 +0000 Message-ID: References: <20200306085014.120669-1-borntraeger@de.ibm.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [9.19.161.120] MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.249.245.26 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: Christian Borntraeger , qemu-s390x , Marc Hartmayer , pbonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Very sorry for my fault, in fact,I test  in a old qemu version ,and patch generated based a new one ;  All in all,its my fault, and I will check and test patch carefully In the future If I  need to  submit the patch again ?     发件人: Christian Borntraeger 发送时间: 2020-03-06 16:50 收件人: qemu-devel 抄送: qemu-s390x; Christian Borntraeger; bauerchen(陈蒙蒙); Paolo Bonzini; Marc Hartmayer 主题: [PATCH] mem-prealloc: initialize cond and mutex(Internet mail) Guests with mem-prealloc do fail with qemu-system-s390x: /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:76: qemu_mutex_lock_impl: Assertion `mutex->initialized' failed. qemu-system-s390x: /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:161: qemu_cond_broadcast: Assertion `cond->initialized' failed.   Let us initialize cond and mutex.   Cc: bauerchen Cc: Paolo Bonzini Reported-by: Marc Hartmayer Fixes: 037fb5eb3941 ("mem-prealloc: optimize large guest startup") Signed-off-by: Christian Borntraeger --- util/oslib-posix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 897e8f3ba6..52650183d3 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -470,6 +470,8 @@ static bool touch_all_pages(char *area, size_t hpagesize, size_t numpages,      char *addr = area;      int i = 0; +    qemu_cond_init(&page_cond); +    qemu_mutex_init(&page_mutex);      memset_thread_failed = false;      threads_created_flag = false;      memset_num_threads = get_memset_num_threads(smp_cpus); -- 2.25.0