From nobody Mon Mar 4 00:28:23 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 4Tp0113CSFz5CdX8 for ; Mon, 4 Mar 2024 00:28:37 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) (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 4Tp0103wf5z4h3K for ; Mon, 4 Mar 2024 00:28:36 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=EeT5Fmdp; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2607:f8b0:4864:20::436 as permitted sender) smtp.mailfrom=rick.macklem@gmail.com Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6e58a984ea1so2498753b3a.2 for ; Sun, 03 Mar 2024 16:28:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709512115; x=1710116915; 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=2g4BMOi33bCbE0rIxXZiy0KlU2ywmAEUe6BFKFG8eEc=; b=EeT5FmdpaLjQMwT3J0APUsfoTwkbpjdd9n05nSkmmG2D/iPwf5XaN890Fdcn21PXrJ aFjWCx9v8yR2vW+xQ9aNqyJ3hU03I+ktCFKdcYFJKoug46o5o+yroDetIWEG9HTD5EKp SwMqJNUcqpoxulKOwE9cIEyl3bIpOCxM2dwilKTcuDKY3BtXXaPWiRZQ49scNqXc0K48 E5nMzUXoyaCgyR+5xWbXr5B26mAawlYZnxJvQBtrpxrpi6HaiVpNWAQEFUM61j28xDLd 3irsryF1sU1I4onDtqzyVtVzSH4ua/KtSSuyhW7PEZ0niJEHG/6fHUL0ikdrGH8HCGmF bAHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709512115; x=1710116915; 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=2g4BMOi33bCbE0rIxXZiy0KlU2ywmAEUe6BFKFG8eEc=; b=VHHtiD7zfZ3m2aGZk3j/VTXVlSPJxqt19sdyYk5V28s+W9kK8RIOXDVrSwBV3yuj5W ls1tWmfyWKbBri+YQVFCUN7suY+2CqxUorTqbo7WT+v94yZnGX9iKCkKjRRbcKiSx+rM boOnuJ3akD7ONRRfvw5GEQN/1o8Pnre+sJIZlcCoAOW25Yrek96DZSE5QYmKII2dxM6C EozDNuGGFbOO8JqNtQhufCi6dkETaJON/VpkzLvRU0BbCtiek/4QqgzyxeckdzL+8+mu EcKhhw/tQ9H6b6RIrbZseCIzjyfVPIksdHTl6yr7t2eT5JVnEArp865owBh23Vrm3u40 0USA== X-Gm-Message-State: AOJu0Yz7kzcTGqwhvnl/XcvdtP+uskZu6j2TGVdWzQoiwSeAU017W/37 3zNS91oi+K+SjydXvMNehpW/25porDBzsN6l0LHjqI9PvwtNQzM9kp3Ts6e+/c44MuKJZD5WwzV 0Y5LYc10XikKc91/ALzbg09krBCdJfXg= X-Google-Smtp-Source: AGHT+IF+zAKeA+nP0yZK0vlzD0gh5NG2tJ8kl/N7lZ4KiuFujP0irTkEngUJ0Kf+WhiXwqzLbwvHNR0kd7uS9lP18ro= X-Received: by 2002:a05:6a20:428a:b0:1a0:f5e6:110d with SMTP id o10-20020a056a20428a00b001a0f5e6110dmr6246412pzj.7.1709512114837; Sun, 03 Mar 2024 16:28:34 -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 16:28:23 -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:c]; 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::436:from] X-Rspamd-Queue-Id: 4Tp0103wf5z4h3K On Sun, Mar 3, 2024 at 3:27=E2=80=AFPM Rick Macklem wrote: > > 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= _timedwait _sleep nfsv4_lock nfsrvd_dorpc nfssvc_program svc_run_internal s= vc_run nfsrvd_nfsd nfssvc_nfsd sys_nfssvc amd64_syscall fast_syscall_common > > > > 997 960918 nfsd nfsd: service mi_switch sleepq= _timedwait _sleep nfsv4_lock nfsrv_setclient nfsrvd_exchangeid nfsrvd_dorpc= nfssvc_program svc_run_internal svc_thread_start fork_exit fork_trampoline > > > > 997 962232 nfsd nfsd: service mi_switch _cv_wa= it txg_wait_synced_impl txg_wait_synced dmu_offset_next zfs_holey zfs_freeb= sd_ioctl vn_generic_copy_file_range vop_stdcopy_file_range VOP_COPY_FILE_RA= NGE vn_copy_file_range nfsrvd_copy_file_range nfsrvd_dorpc nfssvc_program s= vc_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 wi= th lseek(). > > > | * By default this is enabled to ensure accurate hole reporting, it= can result > > > | * in a significant performance penalty for lseek(SEEK_HOLE) heavy = workloads. > > > | * 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 modifie= d > > > (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 m= ost > > > 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. Oops, I spoke too soon. The Copy RPCs worked fine (as above) but the Commit RPCs took a long time, so it still looks like you may need the patches. rick > > So, your vacation may be looking better, rick > > > > > And enjoy your vacation, rick > > > > > > > > -GAWollman > > >