From owner-freebsd-stable@freebsd.org Thu Jun 25 11:42:13 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 B4EF93589AD for ; Thu, 25 Jun 2020 11:42:13 +0000 (UTC) (envelope-from dwilde1@gmail.com) Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) (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 49symN5qyyz3yf6; Thu, 25 Jun 2020 11:42:12 +0000 (UTC) (envelope-from dwilde1@gmail.com) Received: by mail-lj1-x242.google.com with SMTP id n24so6112098lji.10; Thu, 25 Jun 2020 04:42:12 -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=WaGCHoBa6SKk6tV1G1/k0a1T/RnBuRSVlQhSGUHq9C4=; b=Kh3Uh6wa8cOxdhpkr4bLpYryrh9iITcjhcrHNKia8s6IjmxBlsojUFj1DuuAZFK/pr /KmkgSMmRiiF9/vCzPtXITKiZ+A7xvXq5x86OQw/O9WP36ZqdS3iEX201yUBVLZUAH3r ul5PtB/nWvyQor+COved6CfIsLw0sAUGYhrPIlQ3iT6xhAdL3aAaKbkUufliH77lta+w 1+ggoFgbWKOKPNtvXF9+inqgc6Y3bHFeuAJ5PqtYMlnzNpr5b16EMB7XPF9Dy7RNKvef SZcB6WBpACNjUmS5TUXaa+yZqZWdSHcFuzK/5IL8w9oLCb7YnJTOaNDJRFO+S9yfgRMW 4HHQ== 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=WaGCHoBa6SKk6tV1G1/k0a1T/RnBuRSVlQhSGUHq9C4=; b=BbW3jZPxHwCBAQbHuxZ/V6WUNEbbrEq6Vy8ljb1CWT1gbtevuVsvObal9J1fXBGKdX sHqe9T99SZ52YS8PcZRP0g8KCCZeaeDwI5jjl5lRXkGZl/GdrGKmey8k3glD3IB+X2bY x49lu1FjC7p0xow0tLp68P81RJzuHb+8f66gcSS0vQArs5PmnfF1oPFVWhcAajwytWEl 1e20h0QiGhNeVYMdq8UIaqhKvJKGc7Er2xbLEX9CrJZcAJdUEwg1ALfRYR/RyfaX5rwh Unvthxyg/JQpxSz0boib+aWdDQQd6rIA9nh7BjOcl8Mj/yXyCle/Nvo6dpRVPt40kJtv g2Pg== X-Gm-Message-State: AOAM533kMntsKRgO/qFXDxJNEy9it47E6KyIJv+lSQAJUU6emko5ahNh xP9Kt0zI9+Ndp1sHZ6OUlqbgpaga86tFZ+JUvKw= X-Google-Smtp-Source: ABdhPJyZ+u8QoS+KQhra5nyTwh2qLracscB2w/X+L6RacOJE/1K8H/4o8gGXR3zqgTILhLz2tw3yZMQRtuF4gfK73po= X-Received: by 2002:a2e:9316:: with SMTP id e22mr7986237ljh.357.1593085327825; Thu, 25 Jun 2020 04:42:07 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:4703:0:0:0:0:0 with HTTP; Thu, 25 Jun 2020 04:42:07 -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 04:42:07 -0700 Message-ID: Subject: Re: swap space issues To: Kevin Oberman Cc: "Greg 'groggy' Lehey" , freebsd-stable Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49symN5qyyz3yf6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Kh3Uh6wa; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of dwilde1@gmail.com designates 2a00:1450:4864:20::242 as permitted sender) smtp.mailfrom=dwilde1@gmail.com X-Spamd-Result: default: False [-2.84 / 15.00]; HAS_REPLYTO(0.00)[dwilde1@gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; 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.96)[-0.959]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.12)[0.117]; NEURAL_HAM_LONG(-1.00)[-1.002]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::242: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 11:42:13 -0000 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 -- Don Wilde **************************************************** * What is the Internet of Things but a system * * of systems including humans? * ****************************************************