From owner-freebsd-current@freebsd.org Mon Mar 18 15:55:24 2019 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 246291544CDE for ; Mon, 18 Mar 2019 15:55:24 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 288918EFE0; Mon, 18 Mar 2019 15:55:23 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f195.google.com with SMTP id z26so14288548lja.13; Mon, 18 Mar 2019 08:55:23 -0700 (PDT) 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=LpUiOFtLmpEzdFghhxzIZCO9kVsGwVtEbGslnGEP0ys=; b=MxsEPMP/5dxTyvhkEvy90oBdoapl6KG8kgqpUybVethr59pGbcc2+yVJU5ro83txVG DRrN2r78z8JV9FU8SpcdsTOdnHxd+15sbhNYPXkGErJQ90Dok8WTV8CPiXDdvVFp061l xpnQ9yzbTuVImshJha932ICGT7GHc+zxDLHyszfNKnjzNWgq+N0ZNtormNKjD1imzuFx SgwlTKFHNATeXLFJio8ZnVJwB7EtHOfIJsbnd4Re+lkuRo/dRyRHWEcm+goyh2VzVZFc 89RunxE7OQvDOjX6Elhix3ukJDCMM0pIHL+zmNjuhDfm+sZOrHxHa810r8aU2DnGx56A o4TQ== X-Gm-Message-State: APjAAAU/TaqpTHifniqHPrL++NXx9sK7ZG36D6CZNLpb04Xly4UzH61L bLM4zgLQlbbSFU3DVnNXFiffFpSiKsYzIOn/n/vbFbNY X-Google-Smtp-Source: APXvYqxAld7ysp6t9h4K2zSjzhTec2+Ywh+foMHoi7DPH70y6A6CkZCYWtEgycc415rElKoIxwkuaEjgmnygTKgHH4o= X-Received: by 2002:a2e:1510:: with SMTP id s16mr10892432ljd.62.1552924516209; Mon, 18 Mar 2019 08:55:16 -0700 (PDT) MIME-Version: 1.0 References: <9c5eaa94-f55b-464a-ab0f-267e7fce4bd0@FreeBSD.org> <20190318153230.GS96870@kib.kiev.ua> <2f644795-abe6-da6d-6019-05cd3dd84380@FreeBSD.org> In-Reply-To: <2f644795-abe6-da6d-6019-05cd3dd84380@FreeBSD.org> From: Alan Somers Date: Mon, 18 Mar 2019 09:55:04 -0600 Message-ID: Subject: Re: leaked swap? To: Andriy Gapon Cc: Konstantin Belousov , FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 288918EFE0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.208.195 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-2.88 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; IP_SCORE(-1.21)[ipnet: 209.85.128.0/17(-3.88), asn: 15169(-2.09), country: US(-0.07)]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.67)[-0.669,0]; RCVD_IN_DNSWL_NONE(0.00)[195.208.85.209.list.dnswl.org : 127.0.5.0]; SUBJECT_ENDS_QUESTION(1.00)[]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[195.208.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; FREEMAIL_CC(0.00)[gmail.com] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 15:55:24 -0000 On Mon, Mar 18, 2019 at 9:38 AM Andriy Gapon wrote: > > On 18/03/2019 17:32, Konstantin Belousov wrote: > > On Mon, Mar 18, 2019 at 05:20:35PM +0200, Andriy Gapon wrote: > >> > >> First, a note that this was observed on a system that runs a fairly old current > >> (~ 1 year old) with a fairly long uptime (> 6 months). > >> I noticed that the system was nearly out of memory, 98% of swap was in use, > >> there was less than 1 GB of free memory, several GBs of each of active, inactive > >> and laundry memory, and many GBs of wired (mostly ZFS). > >> I decided to pro-actively reboot the system, but to speed that up I put the > >> system to the single-user mode (via shutdown) and then back to multi-user. So, > >> there was no real hardware reboot and the kernel kept running. However, all > >> userland processes were terminated. > >> > >> To my surprise, even while in the single-user mode the swap utilization didn't > >> go below 70%. Also, laundry memory remained in multi-GB area, but let's ignore > >> this for now. > >> > >> I think that the swap could be used only for anonymous memory, so I expected it > >> go to zero after the shutdown to the single user mode. > >> Does anyone have any ideas? > >> Maybe that's something that has already been fixed? > >> If not, any ideas on what to look for? > > tmpfs, swap-backed (or even memory backed) md, persistent posix shared > > memory, SysV shared memory. > > > > Thank you. > There is a single tmpfs mount: > $ df -t tmpfs -h > Filesystem Size Used Avail Capacity Mounted on > tmpfs 1.0G 4.0K 1.0G 0% /tmp/tmp > > No md devices at all according to mdconfig. > > Not sure how to check for the shared memory though. Try "ipcs -a"