From owner-freebsd-stable@freebsd.org Thu Jun 25 06:27:45 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 8339B352D87 for ; Thu, 25 Jun 2020 06:27:45 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) (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 49sqnY1SRbz4fdt; Thu, 25 Jun 2020 06:27:44 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by mail-oi1-x234.google.com with SMTP id w10so531378oih.0; Wed, 24 Jun 2020 23:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0dXdsuv/G/FJAocWfHE1Gpnj7BpSsG1z+uWp9OJZ1xU=; b=lNlK16YES9WE27Jgd0L+xgcz+Hr/ZMMCixQ1E0Lo2SW0P9PDZs1cFdTbxeLRME0ani FXKkWQTEIarREKDB+cngHn74b4UJbNkXF4v9AdFyp6nPDkXdQR7temDDkb72O2Se1AIc 8ZXUYqtHCxgptNqjGetBUSVjp00z0QNDODWMa43LLNV8c+H6pqcPMGRqWA3unvbBitgD JmMJWNzatVJFWkHqiVQ1O+QrMB26lcoC1pTAZjeH0dAlCuSrdy6rroZLmy4rVJdwo64B LMGTQTmzMIFiPwvRMbciSpHjU8KDJcMhsp1oGu01V1BFZfT/ro39Fhxp1g/iTN7e1Fd3 5wbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0dXdsuv/G/FJAocWfHE1Gpnj7BpSsG1z+uWp9OJZ1xU=; b=Ars1oBXrMeTWGclVkP3Dche7FeWJUFRkyBldPsmp35iXN6i66M9Hng2qcXBpmzxdcG VLLGjB9f2+QPTy1SD6s+8r2tcL5stwq0Vl2gW2xkM0c7I+CQuSkW2vEeGNJkKzejg60u wqDj1+FajfybMLb9zT4D/OX4twCCy2/0VCFw+qp9nfjSxjoCJ7rNtUBjbDQn7DZn0ucV kkjeVZekWOMyNiN0Cx7kMIyew7mIqElZlG5Q2ABDRs4xWYoe/7LAN36bTdwKPixwYxjm lFO3KoTcqoZw/nBwuGFnUXx1BV1dTilo6u8KJch+SggD32jBArnsh1wUc3VZbNBXcG1k qjLQ== X-Gm-Message-State: AOAM531VJGX1XMrZTyJjqTsFnWgeq6iAuAI/QzL2nnjeXpvU1b6pPko6 AvWkSTf0HsK/1zbXZVPzgSfSsFOapd2xaQH9mKgvVb97OUc= X-Google-Smtp-Source: ABdhPJy/cpKRy5qujvTOoOyvzcoyo6PuOS0pbqjYrf1QDsqMkymgMq6YiVt5kGbLx3WeIosfZQwfgaeIUZJYerD33/Q= X-Received: by 2002:aca:df04:: with SMTP id w4mr1017426oig.27.1593066463455; Wed, 24 Jun 2020 23:27:43 -0700 (PDT) MIME-Version: 1.0 References: <20200625000410.GA10210@eureka.lemis.com> <20200625025248.GB10210@eureka.lemis.com> <20200625052949.GC10210@eureka.lemis.com> In-Reply-To: <20200625052949.GC10210@eureka.lemis.com> From: Kevin Oberman Date: Wed, 24 Jun 2020 23:27:27 -0700 Message-ID: Subject: Re: swap space issues To: "Greg 'groggy' Lehey" Cc: Donald Wilde , freebsd-stable X-Rspamd-Queue-Id: 49sqnY1SRbz4fdt X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 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 06:27:45 -0000 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 > 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. > > >>> 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. > 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 E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683