From owner-freebsd-stable@freebsd.org Thu Jun 25 15:04:55 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75C2535CAE3 for ; Thu, 25 Jun 2020 15:04:55 +0000 (UTC) (envelope-from dwilde1@gmail.com) Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49t3GG4w2fz49lY; Thu, 25 Jun 2020 15:04:54 +0000 (UTC) (envelope-from dwilde1@gmail.com) Received: by mail-lf1-x133.google.com with SMTP id y18so3384425lfh.11; Thu, 25 Jun 2020 08:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ed0S/BDaZnf/mYrtTKnXRGtsa73PpKKtiL+vok8M83w=; b=d7w8f9ttV4WFhOvng21R1QuB8eMCmF3GkUL1oSOOWnzqlyffyi8366fIqTyJOKnwnE 8YP8UZnGeHTdIQbIjY1FksYE0xIe74gf2Q5KvzSyms0Wvw65fDnZs4SjwtEBqbav2FBR 6TnZ8JhfojeNEGHhKfk+S1PXt6MGEg0xO6rVhGzV6zk+9OCN3mQcREPzlauJ85PnMw14 5YwFAfsHUgpPI/MJrjwmnXJu25SEXxRdKQgBOCaNmRIOY0RPHLCQPLGtvN5zd1y/zepA hQqPTrEAuWfXRPJ9a63jj/wLASd/AHDLnqqrJ9dWnE+QHtq9ViIU31Heslx+3WCCfQRh 3Rqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=ed0S/BDaZnf/mYrtTKnXRGtsa73PpKKtiL+vok8M83w=; b=mqtTopfxH3eFTPqR8eVsJMhLWb/yVC4oGIuHVenufhUiWJCd8Y+SRrEXDr1r/vHbNy NmU6vnfYbL7Eu3Pf7ddIdxVoy9sL+EqyDskzephUqkeib/r1Y8HU7ztFbwV92aU+/1Gw GBbXosdnVw0Zzbd614qgX7WrOnz7s88vl7V323czN7dMFlMUUAJ/fgG/Q6GLj3YFm8ys yUfrmCihQYFOOVeBxJFolOopETiqXzRPM9daX0Jtfpk5Yi0vdjwAiBtqfICkvO8ovxvB aahMlEofA6ndX0ttDI7dnBF6POhkV3V3qdz+XMEE69Zq8u/QwkHcCWjGKS6HVT6e/0Dl RJ1g== X-Gm-Message-State: AOAM533nBmSxIfMttnlECpMV2flZzr7covhXO+ITjdKdzZEvInXGbOy+ voHW/L3zJY0RIEgCOnHKHhnRlR7gsHMpB/85oew= X-Google-Smtp-Source: ABdhPJweuEFX1ZizWt7+qqWXI293qSPyFIcJNA7QtL7cvSbQE27CiSmBlQo47V4pEeXTfRG1Vs3HOiT92JmVriINF1E= X-Received: by 2002:ac2:52af:: with SMTP id r15mr16212076lfm.24.1593097492285; Thu, 25 Jun 2020 08:04:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:4703:0:0:0:0:0 with HTTP; Thu, 25 Jun 2020 08:04:51 -0700 (PDT) Reply-To: dwilde1@gmail.com In-Reply-To: References: <20200625000410.GA10210@eureka.lemis.com> <20200625025248.GB10210@eureka.lemis.com> <20200625052949.GC10210@eureka.lemis.com> From: Donald Wilde Date: Thu, 25 Jun 2020 08:04:51 -0700 Message-ID: Subject: Re: swap space issues To: Kevin Oberman Cc: "Greg 'groggy' Lehey" , freebsd-stable Content-Type: multipart/mixed; boundary="0000000000001ee02305a8e9ea09" X-Rspamd-Queue-Id: 49t3GG4w2fz49lY X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=d7w8f9tt; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of dwilde1@gmail.com designates 2a00:1450:4864:20::133 as permitted sender) smtp.mailfrom=dwilde1@gmail.com X-Spamd-Result: default: False [-1.62 / 15.00]; HAS_REPLYTO(0.00)[dwilde1@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; HAS_ATTACHMENT(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; MIME_BASE64_TEXT_BOGUS(1.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MIME_BASE64_TEXT(0.10)[]; CTYPE_MIXED_BOGUS(1.00)[]; NEURAL_HAM_SHORT(-0.71)[-0.709]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.985]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.02)[-1.023]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::133:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 15:04:55 -0000 --0000000000001ee02305a8e9ea09 Content-Type: text/plain; charset="UTF-8" On 6/25/20, Kevin Oberman wrote: > On Thu, Jun 25, 2020 at 4:42 AM Donald Wilde wrote: > >> On 6/24/20, Kevin Oberman wrote: >> > On Wed, Jun 24, 2020 at 10:30 PM Greg 'groggy' Lehey >> > wrote: >> > >> >> On Wednesday, 24 June 2020 at 20:34:24 -0700, Donald Wilde wrote: >> >> > On 6/24/20, Greg 'groggy' Lehey wrote: >> >> >> On Wednesday, 24 June 2020 at 18:51:04 -0700, Donald Wilde wrote: >> >> >>> On 6/24/20, Greg 'groggy' Lehey wrote: >> >> >>>> On Wednesday, 24 June 2020 at 9:36:23 -0700, Donald Wilde wrote: >> >> >>>>> All, >> >> >>>>> >> >> >>>>> I recently upgraded my 12-STABLE system to the latest, and now >> >> >>>>> my >> >> >>>>> swap subsystems aren't working. I deliberately set up a 40GB >> >> >>>>> partition for swap, and when I do 'top -t' I am only seeing >> >> >>>>> 7906M >> >> >>>>> total. >> >> >>>> >> >> >>>> That looks suspiciously like the difference from 32 GB. Could it >> be >> >> >>>> numeric overflow? And if so, where? What does pstat -s say? >> >> >>> >> >> >>> Well, hi Greg! LTNT2! >> >> >> >> >> >> Indeed. >> >> >> >> >> >>> pstat -shm: >> >> >>> >> >> >>> /dev/ada0s1b 65536 (1M blocks), Used: 1.5G, Avail: 63G, Capacity: >> 2% >> >> >> >> >> >> Now that's really puzzling. Why does it say 64 G when you said 40 >> >> >> G, >> >> >> and the error from top tends to confirm it? How big is the >> >> >> partition >> >> >> (gpart output)? >> >> > >> >> > Attached 'gpart list' output >> >> >> >> FWIW, gpart show would have done the job. But what I see there is Yet >> >> Another swap partition size, 66 GB. So so far we have various parts >> >> reporting 8 GB, 40 GB, 64 GB and 66 GB. >> >> >> >> > Reduced kern.maxswzone to 9999999. Is it decimal or unlabeled hex? >> >> >> >> It'll be decimal, but it refers to the number of swblk structures >> >> assigned in memory, and after reading the code I'm still not 100% in >> >> the clear how this relates to the size of swap, if at all. >> >> >> >> > 'top' now shows 4597M total swap. >> >> >> >> ... and 4.6 GB. 5 different sizes. >> >> >> >> You really shouldn't be relying on top for swap info. It's a third >> >> party program that demonstrably shows incorrect results (though I >> >> I was continuing to reference it because its 'incorrect results' might >> flag where we need to see things working. When 'top' shows the right >> results, we've fixed the right thing. >> >> >> believe that the maintainer would be very interested to know why and >> >> to fix it). But pstat -s (without any further options) should show >> >> what the kernel thinks. >> >> Here's what I see immediately following shutdown -r and boot: >> >> Device 1K-blocks Used Avail Capacity >> /dev/ada0s1b 67108864 0 67108864 0% >> >> >> >> >> >>> What else can I share to help diagnose this? >> >> >> >> >> >> Background, maybe? You say that you upgraded your system. Did you >> >> >> change the swap size when you did? What were swap and RAM sizes >> >> >> before and after? >> >> > >> >> > Meant that I upgraded from 12.1-RELEASE to 12-STABLE. When I >> >> > configured the -RELEASE install, I manually messed with the MBR disk >> >> > partitions. This is nominally a half-TB HDD which showed up as a >> >> > total >> >> > of 446 G available (IIRC, gpart should show it's actual size). I did >> >> > auto partitioning, looked at the sizes, and manually set my >> >> > partitions >> >> > to give me 40G of swap instead of the auto-generated size of 4G. >> >> >> >> That's really puzzling. It seems that it gave you much more than you >> >> asked for. >> >> >> >> Try this in single user mode: modify the size of the swap partition to >> >> 30 GB. I haven't used MBR partitions for years now, but I believe >> >> that 'bsdlabel -e' will do the trick. Just shorten the length of the >> >> b partition. You may need to 'mount -u /'. If you do it right >> >> (check!), this won't harm any of the other partitions: it'll just >> >> leave 26 GB free between the swap partition and the next partition. >> >> Thanks again, Greg! >> >> >> >> > gpart(8) works just fine on MBR drives and partitions/slices and has a >> much >> > friendlier user interface. "gpart resize" is the command you want. >> > -- >> > Kevin Oberman, Part time kid herder and retired Network Engineer >> >> Thanks, Kevin! My laptop's BIOS is old enough that it balked when I >> tried to boot from a GPT setup of 12.1R. One Of These Days I'll fix >> that but the MBR works and I needed to move on. >> >> We'll get there! :D >> > > I think a lot of people miss the point that the fact that gpart was written > primarily to provide support GPT partitioning, it also supports MBR and > bsdlabel is really obsolete. gpart(8) supports 7 different partitioning > schemes including the old RAW scheme, GPT and MBR. I still have an MBR disk > on my near decade old laptop and I use gpart on it. I have been bouncing around between gpart and geom, seeking to understand them better. The man page is... obtuse... but I'm understanding more of it now. geom and gpart seem to be rather self-referential. Here's /etc/fstab: # Device Mountpoint FStype Options Dump Pass# /dev/ada0s1a / ufs rw 1 1 /dev/ada0s1b none swap sw 0 0 /dev/ada0s1d none swap sw 0 0 fdesc /dev/fd fdescfs rw 0 0 proc /proc procfs rw 0 0 Here's /boot/loader.conf: security.bsd.allow_destructive_dtrace=0 loader_logo="beastie" kern.maxproc=75000 kern.maxswzone=25600001 Attached is 'gpart list' output. top is still not happy, but it now shows 11G. I think I'm ready to try synth again. :D I also think it's time for a new thread, because I still have one niggling issue. Thanks for all your help, guys! :D [end thread] -- Don Wilde **************************************************** * What is the Internet of Things but a system * * of systems including humans? * **************************************************** --0000000000001ee02305a8e9ea09 Content-Type: text/plain; charset="US-ASCII"; name="gpart_list.txt" Content-Disposition: attachment; filename="gpart_list.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 R2VvbSBuYW1lOiBhZGEwCm1vZGlmaWVkOiBmYWxzZQpzdGF0ZTogT0sKZndoZWFkczogMTYKZndz ZWN0b3JzOiA2MwpsYXN0OiA5NzY3NzMxNjcKZmlyc3Q6IDYzCmVudHJpZXM6IDQKc2NoZW1lOiBN QlIKUHJvdmlkZXJzOgoxLiBOYW1lOiBhZGEwczEKICAgTWVkaWFzaXplOiA1MDAxMDc4MjkyNDgg KDQ2NkcpCiAgIFNlY3RvcnNpemU6IDUxMgogICBTdHJpcGVzaXplOiA0MDk2CiAgIFN0cmlwZW9m ZnNldDogMAogICBNb2RlOiByM3czZTQKICAgZW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