From owner-freebsd-fs@freebsd.org Sun Mar 8 18:38:10 2020 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9871271D82 for ; Sun, 8 Mar 2020 18:38:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48b98d1JHPz4LnX for ; Sun, 8 Mar 2020 18:38:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x736.google.com with SMTP id b5so7230066qkh.8 for ; Sun, 08 Mar 2020 11:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a7R2IXBEuIMTJgXF+IwLh6gKZ93fL2Gs5MLEfkSPhtQ=; b=aM7ypu5VbGVnB5qWBh1b8r+wX8HsfE0F/7avtYp07QU5Ro7lSNRgQesayJaIR2sn7c qUxUFoAVtX0KeXPm881UB1w7i9/uI9OxFvOxqKkVx85QUSd6XIZB7FAYz0Kh1pRFk/J6 dUIBmJEP+DqVsG4TLDIXXJpJwdEegG5jchWXMivqzRj6TJXoMSnEhvXcOYccoLJELUo9 GYnPAxq8tUdGYcUrAwWtEPj7EbOnjDKUGP6JzO/2k0VMYf4IoEQgC+fkYMgmtH0RkBD8 GoR4fum6X8npAqPnwv3OLwgvALywnXvg8Vys9sZfhgWCmXp0hcQfRxSF5oUFiRHp74iT Mu7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a7R2IXBEuIMTJgXF+IwLh6gKZ93fL2Gs5MLEfkSPhtQ=; b=swoU/5DF5Ah3vQdRbokqHMiURWDHKgn9AujT8IvCh0+zvT/jebwy8i4XFY15XiDDue sUjUtJh0c+PMg7DThAbMgHoErho5VSjBjpL1eUlwkyrT9ZKpUnj+HDKeXzS6IK4eg09r uIg7B1fhxGrI34VPlJAVPe4fMK4lGyk4tAidU+mORcxC/HgLrU1aeWg06AEKbcsWhDav E4xY/OHJ5XrjiYpg6+neRNolMMg0FjqCv8rHJEw1JdGmsdathkghZK04x1HJbwSJXUZk hOKrVCWC7DrDj+0aPv6t0Uyl+2EH/XO73w9vqzXl4aSzN2RsXGf4+TXNDcK2cBPzZl5m e7Gg== X-Gm-Message-State: ANhLgQ2stjoJaemzqE0I0BEkXc5ff2G33DHmZ/oSvevPwJ2xc2RgiXeM AcrjuhP/M/1x8qkUWbbxs0mdLs2yDJaBdKnZvOApGggO X-Google-Smtp-Source: ADFU+vuVaopuyAIuSlLZ7UZUczBq5qDdpWDVUkQumRtH5F6UNYjwhEgazxpZRVFSAqJatHmw58QSEFuZSiMP+oeXm78= X-Received: by 2002:a05:620a:848:: with SMTP id u8mr1777762qku.495.1583692687271; Sun, 08 Mar 2020 11:38:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Sun, 8 Mar 2020 12:37:56 -0600 Message-ID: Subject: Re: Ways to "pause" ZFS resilver? To: Peter Eriksson Cc: freebsd-fs X-Rspamd-Queue-Id: 48b98d1JHPz4LnX X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=aM7ypu5V; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::736) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.56 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; IP_SCORE(-2.56)[ip: (-9.24), ipnet: 2607:f8b0::/32(-1.86), asn: 15169(-1.65), country: US(-0.05)]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-fs@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[6.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2020 18:38:10 -0000 On Sun, Mar 8, 2020 at 12:35 PM Peter Eriksson wrote: > I=E2=80=99m looking for ideas on how to pause a running ZFS resilver on a= FreeBSD > 11.3-RELEASE-p6 system. > > The reason is we have a system where a running such causes severe NFS > =E2=80=9Chiccups=E2=80=9D for our users (like 5-20s delays more or less o= ften) and thus I=E2=80=99d > like to figure out some way to =E2=80=9Cpause=E2=80=9D it during office h= ours until either > we=E2=80=99ve found and fixed the problem or the resilver is done (1D15H = to go)... > > Since there isn=E2=80=99t any =E2=80=9Czfs=E2=80=9D command to pause a ru= nning resilver I=E2=80=99m > pondering alternative more =E2=80=9Ccreative=E2=80=9D ways. > > /usr/src/cddl/contrib/opensolaris/uts/common/fs/zfs: > > > if (zio_flags & ZIO_FLAG_RESILVER) > > scan_delay =3D zfs_resilver_delay; > > else { > > ASSERT(zio_flags & ZIO_FLAG_SCRUB); > > scan_delay =3D zfs_scrub_delay; > > } > > > > if (scan_delay && (ddi_get_lbolt64() - spa->spa_last_io <=3D > zfs_scan_idle)) > > delay(MAX((int)scan_delay, 0)); > > Settings vfs.zfs.scan_idle to something high and then > vfs.zfs.resilver_delay to 10*60*60*kern.hz (10 hours) and hoping the =E2= =80=9Cif" > statement will trigger? But that assumes nothing can/will interrupt > delay(). Hmmm... > > Any other suggestions? > > (I don=E2=80=99t want to abort the resilver). > If you are dealing with SSDs, you might look to see if BIO_DELETE (trim) traffic is causing delays. If so, you can temporarily disable TRIM on the disk being resilvered. In the resilver case, trim doesn't help much anyway since you're rewriting the entire drive. If not, then I'm not sure what else to recommend... Warner