From owner-freebsd-fs@freebsd.org Thu Oct 5 05:13:30 2017 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B3DE2CDA4 for ; Thu, 5 Oct 2017 05:13:30 +0000 (UTC) (envelope-from javocado@gmail.com) Received: from mail-vk0-x22b.google.com (mail-vk0-x22b.google.com [IPv6:2607:f8b0:400c:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91869FD for ; Thu, 5 Oct 2017 05:13:30 +0000 (UTC) (envelope-from javocado@gmail.com) Received: by mail-vk0-x22b.google.com with SMTP id u128so7178201vkg.10 for ; Wed, 04 Oct 2017 22:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lWaQaMeKsxO2FinrniLFfEwn2C9EkG8rZxBy5wOJv3E=; b=nVVt8GcksbRB0cDReZ6eg5GzL2uXGKnjZWmMjJCf9a3u/FsuLM+vNj08a2ocCapPMk ffao5ZZEs7KHcJPzpGwAJwoPLEikXq5+4YDQYZ2YbIu8xU1QvIcTrsJlNBrV299DPA2U O6DkEbuM1D9sux4HdZ/VBrJ/tSpTjZLxCRsAlZO1aNEyR1RqVzpeOma8PqL++pOl110v lueZ3i+Jx9CzZBJA4V/TnV+JkwzmQBL9rI5SYUHcWv+7xk1d6XqxCiKTaoi2hwk2JSE8 /ue5QQDaMbYMYlb7QfK0J3+CxYA43Lg+IPhT8/Faq1QrQYnw0hKSQhrQwFXJ4TojZqFu nHBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lWaQaMeKsxO2FinrniLFfEwn2C9EkG8rZxBy5wOJv3E=; b=oytegbsqOW6wvS3MFadFlxnn3Z2BkXW0HuC+ByNNMGw+K2QbXGq9mbiTIyZoeX0Ugq SRtB5BGJ5jpZWO+ip9SlyrhPQQjiFWFgHHznda7v898ihO//1CHuFQCLbEuo3vtuUD7I IqX0SYXqIkAV+y+MjkZfMMZhUr4G8pSl3nXq3RUdqGRt3VRb5OTYrLDxwKygOaZ8xCkX WFfg4uq/jvwWgCHWTRcmkuUwH2fYEC1lUxGvlo8ZNMKpkMwiVzon2Wi7HyRWkGujznOe /Bkdex7vxYtI6bO2P5qwW7k+uuH35P/LuTIH7C3ubzl+TSdXe8GW2NsLSzwAzyypZKTb t+YA== X-Gm-Message-State: AMCzsaW+RYAy+KvxfjDXX5PBxcSn1KqVkBJHNRSJlVMaMdKamgPXopLF pH4y9cNWP2QxTqiIYgNldU+oB1xRkuzavAZeHLo= X-Google-Smtp-Source: AOwi7QBN8M1h7+J9rOiyZqsjPZtOVtlrdMmk4F8A0cShcf2Sx0FIZDy5DHBaMDUgRKgXe/5m1aw729EE4GeqaO2I0JY= X-Received: by 10.31.171.146 with SMTP id u140mr1170419vke.44.1507180409389; Wed, 04 Oct 2017 22:13:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.51.90 with HTTP; Wed, 4 Oct 2017 22:13:28 -0700 (PDT) In-Reply-To: References: From: javocado Date: Wed, 4 Oct 2017 22:13:28 -0700 Message-ID: Subject: Re: lockup during zfs destroy To: Freddie Cash Cc: FreeBSD Filesystems Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 05:13:31 -0000 Setting vfs.zfs.free_max_blocks to 20k has not helped unfortunately. I was able to get a small amount of debug out though. Any thoughts on how I can: - get more detailed debug on the progress of this operation, or whether progress is being made at all each time I reboot and start over after a freeze - configure my way out of this issue? # dtrace -q -n 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}' txg 34628587 open pool version 28; software version 5000/5; uts host 10.3-RELEASE 1003000 amd64 txg 34628587 destroy begin tank/temp (id 3680) txg 34628588 destroy tank/temp (id 3680) On Wed, Oct 4, 2017 at 10:58 AM, Freddie Cash wrote: > On Wed, Oct 4, 2017 at 9:27 AM, Freddie Cash wrote: > >> On Wed, Oct 4, 2017 at 9:15 AM, javocado wrote: >> >>> I am trying to destroy a dense, large filesystem and it's not going wel= l. >>> >>> Details: >>> - zpool is a raidz3 with 3 x 12 drive vdevs. >>> - target filesystem to be destroyed is ~2T with ~63M inodes. >>> - OS: FreeBSD 10.3amd with 192 GB of RAM. >>> - 120 GB of swap (90GB recently added as swap-on-disk) >>> >> >> =E2=80=8BDo you have dedupe enabled on any filesystems in the pool? Or = was it >> enabled at any point in the past? >> >> This is a common occurrence when destroying large filesystems or lots of >> filesystems/snapshots on pools that have/had dedupe enabled and there's = not >> enough RAM/L2ARC to contain the DDT. The system runs out of usable wire= d >> memory=E2=80=8B and locks up. Adding more RAM and/or being patient with= the >> boot-wait-lockup-repeat cycle will (usually) eventually allow it to fini= sh >> the destroy. >> >> There was a loader.conf tunable (or sysctl) added in the 10.x series tha= t >> mitigates this by limiting the number of delete operations that occur in= a >> transaction group, but I forget the details on it. >> >> Not sure if this affects pools that never had dedupe enabled or not. >> >> (We used to suffer through this at least once a year until we enabled a >> delete-oldest-snapshot-before-running-backups process to limit the >> number of snapshots.)=E2=80=8B >> > > =E2=80=8BFound it. You can set vfs.zfs.free_max_blocks in /etc/sysctl.co= nf. That > will limit the number to-be-freed blocks in a single transaction group. > You can play with that number until you find a value that won't run the > system out of kernel memory trying to free all those blocks in a single > transaction. > > On our problem server, running dedupe with only 64 GB of RAM for a 53 TB > pool, we set it to 200,000 blocks: > > =E2=80=8Bvfs.zfs.free_max_blocks=3D200000 > > -- > Freddie Cash > fjwcash@gmail.com >