From nobody Sat Feb 7 14:10:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1557489975; cv=none; d=zoho.com; s=zohoarc; b=iOWVHrUdoWa+fmtbaw/s7viVhE80iGOv3GB0pOWLsXuE65S1IqIKp3dYZI6dJu1QRLTIdZGWNCmfb4xWWVrVQK6HBnW/vIrGrIwRyDtQiZgqR0LD7gn8nGPI9HVdedKGdbLqqg/RCJKgKFl7/GttzhCahrD0pGZfnPOge4qqp70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557489975; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=A07FDDMv5GD1M5OEmmF7OJK1Rjx8FE2A9jX3KiClGgk=; b=C5lkCOzpijBzlHG+YaTav0BLHg47FASg1XyDS6RTjEvHeH+Grii+3YVDwWdqRIeY2Huy2Ij7Wh2odsDNJoVUNCYjbXN/QVIZcIKc6FqnRe+TYTC4ZWS50xdvMr4TVnfKK0aVky9b3JKZ8K9anzSj9EBAB2sT0QrNuFCE6slo/sA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557489975790964.114688528846; Fri, 10 May 2019 05:06:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F4017308FBA6; Fri, 10 May 2019 12:06:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B1407165F1; Fri, 10 May 2019 12:06:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2232C41F58; Fri, 10 May 2019 12:06:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x49Kxr9T016090 for ; Thu, 9 May 2019 16:59:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id D95F64A3; Thu, 9 May 2019 20:59:53 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D38105C582 for ; Thu, 9 May 2019 20:59:51 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC7C03082B67 for ; Thu, 9 May 2019 20:59:49 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x49Kfmmw084666 for ; Thu, 9 May 2019 16:59:49 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 2scqs5hbvr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 09 May 2019 16:59:49 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 May 2019 21:59:48 +0100 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 9 May 2019 21:59:47 +0100 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x49Kxkrd11338216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 May 2019 20:59:46 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0AFC2C6057; Thu, 9 May 2019 20:59:46 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 700C8C6059; Thu, 9 May 2019 20:59:45 +0000 (GMT) Received: from LeoBras.aus.stglabs.ibm.com (unknown [9.18.235.108]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 9 May 2019 20:59:45 +0000 (GMT) From: Leonardo Bras To: libvir-list@redhat.com Date: Thu, 9 May 2019 17:59:36 -0300 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19050920-0020-0000-0000-00000EE60FEC X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011078; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000285; SDB=6.01200987; UDB=6.00630195; IPR=6.00981878; MB=3.00026818; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-09 20:59:48 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19050920-0021-0000-0000-000065C2E866 Message-Id: <20190509205935.26192-1-leonardo@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-09_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=992 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905090118 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 09 May 2019 20:59:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 09 May 2019 20:59:50 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'leonardo@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.701 (RCVD_IN_DNSWL_LOW, SPF_PASS) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Fri, 10 May 2019 08:06:04 -0400 Cc: Leonardo Bras Subject: [libvirt] [PATCH RFC] iohelper: Introduces a small sleep do avoid hunging other tasks X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 10 May 2019 12:06:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" While dumping very large VMs (over 128GB), iohelper seems to cause very intense IO usage on the disk, and it causes some processes (like journald) to hung, and depending on kernel configuration, to panic. This change creates a time window, after every 10GB written, so this processes can write to the disk, and avoid hunging. Signed-off-by: Leonardo Bras --- src/util/iohelper.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/iohelper.c b/src/util/iohelper.c index ddc338b7c7..164c1e2085 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -52,6 +52,8 @@ runIO(const char *path, int fd, int oflags) unsigned long long total =3D 0; bool direct =3D O_DIRECT && ((oflags & O_DIRECT) !=3D 0); off_t end =3D 0; + const unsigned long long sleep_step =3D (long long)10*1024*1024*1024; + unsigned long long next_sleep =3D sleep_step; =20 #if HAVE_POSIX_MEMALIGN if (posix_memalign(&base, alignMask + 1, buflen)) { @@ -128,6 +130,12 @@ runIO(const char *path, int fd, int oflags) =20 total +=3D got; =20 + /* sleeps for a while to avoid hunging other tasks */ + if (total > next_sleep) { + next_sleep +=3D sleep_step; + usleep(100*1000); + } + /* handle last write size align in direct case */ if (got < buflen && direct && fdout =3D=3D fd) { ssize_t aligned_got =3D (got + alignMask) & ~alignMask; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list