Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1321123lqh; Mon, 6 May 2024 04:25:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWpwRsyvVBYafMdGL22obD/+WZqW6z1gSIrmC3M5l3zj7Nf+KC+skAWj/m5+wwWpAcBjrBChGI/UnWI2KxSFHE7eO+s20hPcRuLyBfZCA== X-Google-Smtp-Source: AGHT+IGIyxBm5Ky85ZezaB1j3FlnyG8WNLjB8hYIKFPOmm2SUlSku6GgllgFCSQYMbR6455B2nXI X-Received: by 2002:a17:90a:8a8f:b0:2b2:a1d0:b61c with SMTP id x15-20020a17090a8a8f00b002b2a1d0b61cmr7077179pjn.47.1714994756001; Mon, 06 May 2024 04:25:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714994755; cv=pass; d=google.com; s=arc-20160816; b=C8/CNDKgKUB52A7CD5+m2ZzQCclHNvAK+bCKT3zyUgqEYeg0mqW1h2x+2MAK4Qfzq+ MiSIFvYXpuxCTsmDouNMxat8CbU8SYcZcLXnB1DDFzIbe+JvvFxkWud1JHnbiB7Rl3Jt hVhlquSkyskw+klqvhaxAMpFrMs+wF3aZnHABc3HLTF5L7sXiEwlugBYR5gW+p3h+4Jt G1S0oyik3y/ncHvktZOMhUHhZIP/qwQ4Gd4aZ/qePoBoWMXHlINCMuL62nCnHmWxpcH0 LS6Ty1LAAWBTBYv/lyFlUTFZKJx3LJOiN/uq6q2eepCOjyTGqcK0Y1UJ9TzxDgoXKFnR NEHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=JG47Pp1zlfriG85ow4HZ0py3cxKRgP/mCU5uk5d/lIs=; fh=lNdtkXu8ie3ZXWRcCd0CfZwt2urrF0ZMiJ8FnEB80/E=; b=ygBdNux+aHg0BnB4HlbKTfaYEvgc1DWcyvbmRgP0kK9sNtVJ002mWGnUXbf3lE6WfH HSSyoiUSJHwomojcreHx+c45jChMxEmzdKr4CDNgLU/SEh7ghCSlD6rz/z4NF69VVUCQ BZvwEj4YNicgYfhMJHzBiIcxquqePNTvcpfscKAfWaCtKy1bwNzGkK8JOyCwaIsD8gBR xuNkHel6J91TU5F8q3lgm9K4y7IS4LwrFZeWJGsrgiHTIP5uyurZSWI/ywLUmiSDZjen Skbge2a6Q5fq7ymo9I6Ulh9kNQmoLDL3ZH+vFfSBZAQ6Sxf1bfGF2UFg8FnoaV69kJji V49w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FXds1fXE; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-3166-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3166-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m7-20020a17090a730700b002b4ffba6eadsi3176402pjk.70.2024.05.06.04.25.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 04:25:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3166-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FXds1fXE; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-3166-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3166-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D9ABCB2200D for ; Mon, 6 May 2024 11:25:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD4CB142E9F; Mon, 6 May 2024 11:25:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FXds1fXE" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39C33142E69 for ; Mon, 6 May 2024 11:25:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714994742; cv=none; b=fu5UzZbYUEHIJjpWZ+q0vuPp4PMO2Ih/lRs7SP6Ddbao0Kph4oscASQ0S4VKXLx7+nvq7FsZF6/lsZ3TO1rI5UP3wg2gnwDAQ7TXZAhm4U3Gu3iQhtvMl44O7ZAtE+FZW0l8MSIRNaIPQ/XPYVGNWqkIJrrdiYS80mkBXT8teVw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714994742; c=relaxed/simple; bh=XABrxXp/5HBumr1ooVb911N1diVBYRn/euCHMxn2MUc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lgk7DCXgGwz2uGc3uNtarDF8aKi9K4xmAPzpBcxMi5jkwmZ1uyUPdXMXHrxfgeTc30pAPTFkYUmNOuKg6Zdxjp9oubSTCqZzZAs8eIa0QaaoXrrb84juMF/sbmvM5R7fwUf2tSCkyN5KigDwPyLf4V1CznstJo4M3TjiHBHVMPw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=FXds1fXE; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714994740; 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=JG47Pp1zlfriG85ow4HZ0py3cxKRgP/mCU5uk5d/lIs=; b=FXds1fXEg/IqUnm1xuFc3wW+OhpG5KcjAbsylYaR9GPJRGiMWgApT87BSbZc7LjSeDvGJk cnV/Y5EE059wUlaib2cYQTV3j/Wk5PSYv30JfIk/gmhLac+bEnHwKB69o4D377E1sHj987 yvATk5a3cTijh04dJb0KrsDyjJaGf7A= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-225-nd3T_uyjNGSCp-N9xiCduA-1; Mon, 06 May 2024 07:25:36 -0400 X-MC-Unique: nd3T_uyjNGSCp-N9xiCduA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 70E6E3C025B3; Mon, 6 May 2024 11:25:36 +0000 (UTC) Received: from [192.168.37.1] (ovpn-0-6.rdu2.redhat.com [10.22.0.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DAB34C13FA3; Mon, 6 May 2024 11:25:35 +0000 (UTC) From: Benjamin Coddington To: Thomas Glanzmann Cc: kvm@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: I/O stalls when merging qcow2 snapshots on nfs Date: Mon, 06 May 2024 07:25:34 -0400 Message-ID: In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 On 5 May 2024, at 7:29, Thomas Glanzmann wrote: > Hello, > I often take snapshots in order to move kvm VMs from one nfs share to > another while they're running or to take backups. Sometimes I have very= > large VMs (1.1 TB) which take a very long time (40 minutes - 2 hours) t= o > backup or move. They also write between 20 - 60 GB of data while being > backed up or moved. Once the backup or move is done the dirty snapshot > data needs to be merged to the parent disk. While doing this I often > experience I/O stalls within the VMs in the range of 1 - 20 seconds. > Sometimes worse. But I have some very latency sensitive VMs which crash= > or misbehave after 15 seconds I/O stalls. So I would like to know if th= ere > is some tuening I can do to make these I/O stalls shorter. > > - I already tried to set vm.dirty_expire_centisecs=3D100 which appears = to > make it better, but not under 15 seconds. Perfect would be I/O stalls= > no more than 1 second. > > This is how you can reproduce the issue: > > - NFS Server: > mkdir /ssd > apt install -y nfs-kernel-server > echo '/nfs 0.0.0.0/0.0.0.0(rw,no_root_squash,no_subtree_check,sync)' > = /etc/exports > exports -ra > > - NFS Client / KVM Host: > mount server:/ssd /mnt > # Put a VM on /mnt and start it. > # Create a snapshot: > virsh snapshot-create-as --domain testy guest-state1 --diskspec vda,fil= e=3D/mnt/overlay.qcow2 --disk-only --atomic --no-metadata -no-metadata What NFS version ends up getting mounted here? You might eliminate some head-of-line blocking issues with the "nconnect=3D16" mount option to ope= n additional TCP connections. My view of what could be happening is that the IO from your guest's proce= ss is congesting with the IO from your 'virsh blockcommit' process, and we don't currently have a great way to classify and queue IO from various sources in various ways. Ben