From nobody Sun Mar 3 23:27:04 2024 X-Original-To: stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TnyfH5Sbjz5CX7j for ; Sun, 3 Mar 2024 23:27:19 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TnyfG2RXxz4XXZ for ; Sun, 3 Mar 2024 23:27:18 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=cK1Aqysc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2607:f8b0:4864:20::102a as permitted sender) smtp.mailfrom=rick.macklem@gmail.com Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-299d3b09342so2851861a91.2 for ; Sun, 03 Mar 2024 15:27:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709508436; x=1710113236; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1oaQGn0x8ZN+ZJjd3tQb0ZEt3Mt08cZKGTGF7NOHDHQ=; b=cK1AqyschW7j0DMv9jWxAnfm3E13RWzUKn+KCGyqY6bbuftdPKmQA4WLLxFRcATLDl tzOpwldgiYEFvEqxy5VSF61793Mwb9nT8AW0uRS3LNzLf9YifvaEMFDZyzRcNhEbFcD+ +GSJtz7CPj8hxd7QRySTPEwLDmdDgN9MxjNuyQPeRBTNzBteSpHkhJKKCz2LS2UP44vl SPHQukcXcB3FM09kH3l4LMJlBT9pk7MOc4i2Qbt9v93aWUHlPlQ163EPTebfRha5oz4j iFXEXT+mOexVTPwiPDpigI9BGjocHCRpkseJbHG0KtWGvc+c9/JOXmBghhQfPlugyTGK fg3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709508436; x=1710113236; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1oaQGn0x8ZN+ZJjd3tQb0ZEt3Mt08cZKGTGF7NOHDHQ=; b=Mp0tlJyg7OzuOpGUccAvBGBLf1zW20MOvQynQjUmRBztlBzt86nPez7T/WkZt81P5n Oty+FYIvlLKXQtXPuJElPULlFxhLgMWSlGo32nljeUsPnrEWlEGh+fyliD/T9ftOnmQ7 7NaPdr8H7GUKvPiigzjLLRoF6KrKyHdpCgzcqX3e+DUquah4fuEcXFdjbCYEnAhAGHEy Pr5onT2wMKEnHAhWUgEzaY8FEqKH+JnykjrRwEhNomcIRmDEwSqsy76hGmq0ZY6VjZAh Fr03XiLRe7QuqOhfThK/rLjThMlNMZlXUdGthcevwRGCgrrd1V7ptGFa1lulZYR0kDWE Y7ZQ== X-Gm-Message-State: AOJu0YwuTnPCjisYVSACwoHvjK9k8EHteqTryf1MUXA+IiMVMjxyx4So GEK4WZM4p9jzZs1kGPgsWpqF62ljhZJXeQrnZNgC7Cvf7GyXyv+A14ht3nRNzbT+kWOzoq445Ld u9SoEm09D2z2WQi2pms67K+P9gJ3iSec= X-Google-Smtp-Source: AGHT+IFIVNcwDYr8OmwAU7tNY/z/mkzNyqhQa5pVMBF0JHlRHFAFZK+lwJgNqW0RdtfL/kH32TSX6Tqp8DfEvFCQT1o= X-Received: by 2002:a17:90a:8008:b0:29a:bf47:e133 with SMTP id b8-20020a17090a800800b0029abf47e133mr5958705pjn.23.1709508436438; Sun, 03 Mar 2024 15:27:16 -0800 (PST) List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 References: <26078.50375.679881.64018@hergotha.csail.mit.edu> <26083.64612.717082.366639@hergotha.csail.mit.edu> In-Reply-To: From: Rick Macklem Date: Sun, 3 Mar 2024 15:27:04 -0800 Message-ID: Subject: Re: 13-stable NFS server hang To: Garrett Wollman Cc: stable@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: --- X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TAGGED_FROM(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[stable@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MLMMJ_DEST(0.00)[stable@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::102a:from] X-Rspamd-Queue-Id: 4TnyfG2RXxz4XXZ On Sun, Mar 3, 2024 at 1:17=E2=80=AFPM Rick Macklem wrote: > > On Sat, Mar 2, 2024 at 8:28=E2=80=AFPM Garrett Wollman wrote: > > > > > > I wrote previously: > > > PID TID COMM TDNAME KSTACK > > > 997 108481 nfsd nfsd: master mi_switch sleepq_t= imedwait _sleep nfsv4_lock nfsrvd_dorpc nfssvc_program svc_run_internal svc= _run nfsrvd_nfsd nfssvc_nfsd sys_nfssvc amd64_syscall fast_syscall_common > > > 997 960918 nfsd nfsd: service mi_switch sleepq_t= imedwait _sleep nfsv4_lock nfsrv_setclient nfsrvd_exchangeid nfsrvd_dorpc n= fssvc_program svc_run_internal svc_thread_start fork_exit fork_trampoline > > > 997 962232 nfsd nfsd: service mi_switch _cv_wait= txg_wait_synced_impl txg_wait_synced dmu_offset_next zfs_holey zfs_freebsd= _ioctl vn_generic_copy_file_range vop_stdcopy_file_range VOP_COPY_FILE_RANG= E vn_copy_file_range nfsrvd_copy_file_range nfsrvd_dorpc nfssvc_program svc= _run_internal svc_thread_start fork_exit fork_trampoline > > > > I spent some time this evening looking at this last stack trace, and > > stumbled across the following comment in > > sys/contrib/openzfs/module/zfs/dmu.c: > > > > | /* > > | * Enable/disable forcing txg sync when dirty checking for holes with= lseek(). > > | * By default this is enabled to ensure accurate hole reporting, it c= an result > > | * in a significant performance penalty for lseek(SEEK_HOLE) heavy wo= rkloads. > > | * Disabling this option will result in holes never being reported in= dirty > > | * files which is always safe. > > | */ > > | int zfs_dmu_offset_next_sync =3D 1; > > > > I believe this explains why vn_copy_file_range sometimes takes much > > longer than a second: our servers often have lots of data waiting to > > be written to disk, and if the file being copied was recently modified > > (and so is dirty), this might take several seconds. I've set > > vfs.zfs.dmu_offset_next_sync=3D0 on the server that was hurting the mos= t > > and am watching to see if we have more freezes. > > > > If this does the trick, then I can delay deploying a new kernel until > > April, after my upcoming vacation. > Interesting. Please let us know how it goes. Btw, I just tried this for my trivial test and it worked very well. A 1Gbyte file was cpied in two Copy RPCs of 1sec and slightly less than 1sec. So, your vacation may be looking better, rick > > And enjoy your vacation, rick > > > > > -GAWollman > >