From nobody Thu Feb 02 16:04:02 2023 X-Original-To: hackers@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 4P73WN5Bgvz3fp09 for ; Thu, 2 Feb 2023 16:04:16 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com [209.85.217.50]) (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 4P73WN30yVz3RLX for ; Thu, 2 Feb 2023 16:04:16 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-vs1-f50.google.com with SMTP id s24so2299133vsi.12 for ; Thu, 02 Feb 2023 08:04:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=4feOC/QctWD9Y/YLctfByAuDLyTN7Sj/4YbXr0z5QGs=; b=Z6rpmg9AbAwoJHivHMwCrGnPLhxwHkE5pY5zoAhLWwVJQ9RAqjsTB0WxMM2jqIZxtr l7NeoZl1TFfsApgRzTwdIBLixusszzCNTKA93qEI9Uyk+n0WyIWZ5wFvuE6dP4wAoal+ 98kX7FrIZ7vZYb33ihppK3i5M+M0czPoAbJ/2KFRzlmr+2g5+iU8b9lzjQEQUm3VPYvh Yoka0hFRZ//cJnfaaju2vCJJEvHcz6fHPTMfxhvMz9j6JEe+PEJne0sxZ2cIVnvdPH/U M3NjhEcduoPeI7+jqpHDvGLT5aSCfzvWQUV+7t/iMZJptbaSejjHfG9YhafHCoTVGt0L nx/g== X-Gm-Message-State: AO0yUKVyW6Ed2yDnMvindRkpEazTP6xOeXm8AAcQKcMlOWvvDqhzh+Ff U6Gl2T0bGXd7QpamAcdjPi+5gGAMzYl2OODMHv0H6YuB0Ew= X-Google-Smtp-Source: AK7set8iFiutMn9S0ddGEi9+d39B9izwm6v75zaxO0sG5cZ4GvCJPXnfUKvLQVXLC8LlfV/55BZjYDpUzHDXILBkisQ= X-Received: by 2002:a67:f501:0:b0:3f6:c8ee:b841 with SMTP id u1-20020a67f501000000b003f6c8eeb841mr1035766vsn.76.1675353854841; Thu, 02 Feb 2023 08:04:14 -0800 (PST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: <1689ba8c-a317-ce1f-2854-99566468a9ed@grosbein.net> In-Reply-To: From: Alan Somers Date: Thu, 2 Feb 2023 09:04:02 -0700 Message-ID: Subject: Re: Swap, ZFS & ARC To: jbo@insane.engineer Cc: "hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4P73WN30yVz3RLX X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Thu, Feb 2, 2023 at 8:45 AM wrote: > > > > > > > ------- Original Message ------- > On Thursday, February 2nd, 2023 at 14:41, Eugene Grosbein wrote: > > > > > > > > 02.02.2023 21:28, jbo@insane.engineer wrote: > > > > > Hello folks, > > > > > > Based on a discussion on the forums not so long ago I tried to figure= out how swap usage on a ZFS system plays together with ARC. However, I cou= ld find very little to no information on this which leads me to believe tha= t there is some "core concept" I might be oblivious to. > > > > > > The main question is basically this: Your system starts to swap out d= ata from RAM to your swap partition. > > > This swap data on disk ultimately resides somewhere in a ZFS pool. > > > > > > I prefer not doing this. That is, all my systems have swap partition ou= tside of ZFS pool. > > This isn't really achievable on your average "single disk" desktop system= s, right? > Assuming I'm not missing something (which is why I came here to ask), a "= regular" or "default" installation through the FreeBSD installer would setu= p a swap partition within the zpool, right? Actually, the installer by default sets up a swap partition beside the zroot pool. It doesn't use swap-on-zvol. Here's what it looks like: > gpart show =3D> 40 1953525088 nvd0 GPT (932G) 40 532480 1 efi (260M) 532520 1024 2 freebsd-boot (512K) 533544 984 - free - (492K) 534528 16777216 3 freebsd-swap (8.0G) 17311744 1936211968 4 freebsd-zfs (923G) 1953523712 1416 - free - (708K) =3D> 40 1953525088 nvd1 GPT (932G) 40 532480 1 efi (260M) 532520 1024 2 freebsd-boot (512K) 533544 984 - free - (492K) 534528 16777216 3 freebsd-swap (8.0G) 17311744 1936211968 4 freebsd-zfs (923G) 1953523712 1416 - free - (708K) > zpool status zroot pool: zroot state: ONLINE scan: resilvered 314G in 00:10:19 with 0 errors on Sat Dec 24 22:31:04 20= 22 config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 nvd0p4 ONLINE 0 0 0 nvd1p4 ONLINE 0 0 0 > swapinfo Device 1K-blocks Used Avail Capacity /dev/gpt/swap0 8388608 0 8388608 0%