From nobody Sun Mar 3 21:17:30 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 4Tnvmm1lYdz5CLBH for ; Sun, 3 Mar 2024 21:17:44 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (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 4Tnvml73Vmz4Fm4 for ; Sun, 3 Mar 2024 21:17:43 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-299c11b250fso2465585a91.2 for ; Sun, 03 Mar 2024 13:17:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709500662; x=1710105462; 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=B7wOW1XtrxWywIVZf0AqKmTjEIgZSWT21nX16aeL+fk=; b=Z6u8MSjsY2vVPH70UgE8CKInXfNhTSpr3hNEEyBS6t43FiHOddjOdZ7Z06j4EIP7TA mbWBT0+CzoLfv5jUnCB/i2QMSmNXZBncNDAGGWLEiUw4TyNzYYPy/v4kY6Ej6oTZwhUh 0ZeieAPmfHSy75Jsev17BBPUQH3gHKsauyH6FMOdKXRnzguH46q7qSqf/cSKdthltoMI sMFSOK8aNC53hwCNIaoeiH03sAPdOt0cLI4mvPoKzR+2kvR+MOdZwcqcSKIHi4DJetO4 Ur7JKHINOylfUaQwYGqUF99M3tnkOnU/m0Qx55lPahsLSQ7jraQ9exBsnBf5sEs1BTRg IFnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709500662; x=1710105462; 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=B7wOW1XtrxWywIVZf0AqKmTjEIgZSWT21nX16aeL+fk=; b=HXZwoBvTiguba/d5cPJW6CaCs7dk3oxH/U6WO0x2U5nuSIkaeourMIAhqUC/TWLqea UNECE/NKKE40zLml7FgmchXeZTi7Ul4FtTV9FlflXJNu5ZArGZuJWsCaFFsYY06uc1qe bUwK77WEkMw/+yohfzJuvpDGZHuQcRW4XJYOHa0NgqNGt8PlHkHdULGWlf+ONC3DZ9hJ ajFqw5Y+nFe2pJmEG1jj55OBddDwmSHq05qkLjehYgMKgInJIT8LyPAMGhmqem6uVvsq ph7/vf7KsCWRnU8DwCbz/PYlMvpyrCKwHHIheFtATllnL+staTucYU+w5lDFqnYp28Oe Bh7Q== X-Gm-Message-State: AOJu0YzvYGnEnEsG8YclzMGWOsRyUeyQjxUziEF1AsQSiTVhsioX6qPz jCC1GLDh/1HT/tTPzRAIAOZLZuLMGrP2aPJSLOleniCYAkEdscjm0dZqDsS6X919dzRERnBLJH3 qeaUpX55kHk2AE7lRzo96pxSq1w== X-Google-Smtp-Source: AGHT+IFMFZFInxnpWxufkZDdKnuivwmgLfeAqN8ylq3RvIX3Vu9EvshAiiLiJQC/RNM4fr1BqaflJT89t6MdA/L+57E= X-Received: by 2002:a17:90a:2ec8:b0:29b:2eab:6bda with SMTP id h8-20020a17090a2ec800b0029b2eab6bdamr3967342pjs.35.1709500662124; Sun, 03 Mar 2024 13:17:42 -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: <26083.64612.717082.366639@hergotha.csail.mit.edu> From: Rick Macklem Date: Sun, 3 Mar 2024 13:17:30 -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-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Tnvml73Vmz4Fm4 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_tim= edwait _sleep nfsv4_lock nfsrvd_dorpc nfssvc_program svc_run_internal svc_r= un nfsrvd_nfsd nfssvc_nfsd sys_nfssvc amd64_syscall fast_syscall_common > > 997 960918 nfsd nfsd: service mi_switch sleepq_tim= edwait _sleep nfsv4_lock nfsrv_setclient nfsrvd_exchangeid nfsrvd_dorpc nfs= svc_program svc_run_internal svc_thread_start fork_exit fork_trampoline > > 997 962232 nfsd nfsd: service mi_switch _cv_wait t= xg_wait_synced_impl txg_wait_synced dmu_offset_next zfs_holey zfs_freebsd_i= octl vn_generic_copy_file_range vop_stdcopy_file_range VOP_COPY_FILE_RANGE = vn_copy_file_range nfsrvd_copy_file_range nfsrvd_dorpc nfssvc_program svc_r= un_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 l= seek(). > | * By default this is enabled to ensure accurate hole reporting, it can= result > | * in a significant performance penalty for lseek(SEEK_HOLE) heavy work= loads. > | * Disabling this option will result in holes never being reported in d= irty > | * 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 most > 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. And enjoy your vacation, rick > > -GAWollman >