From owner-freebsd-current@freebsd.org Sun Aug 20 07:22:21 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E13A4DE4A63 for ; Sun, 20 Aug 2017 07:22:21 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73B7B770AD; Sun, 20 Aug 2017 07:22:21 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id q189so8541515wmd.0; Sun, 20 Aug 2017 00:22:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=AUub/DPFMbm5rWRcrmtpW8CVn0ARtOk9Ka5/szJNxyQ=; b=OlYiuXtmiuoByoeBEiwUQBk5xnunp5SjIhCZRwUyxcbyh3IhRX0SQYbiOSfRVxPc3v iKfFcu2Quy6CTpihT6F6WcFoG0BQ/7YrXOxsDFLgPq2h4gKfZSHxR5Hez3eegDUOR2vc 8h29BxPpOUlAGl7gASya3I3miej4ieUTRWSuOg/cLIbyff9krQkxmuWWHN8ObRI41KBF 91ow9fa0rxQyLLvBLJGyD2vUlCuiTGNfhJaisq16uoLDNokEeBDHD7Xmwr9L0jeF+NTa Ke3oQ7dqWTgxci6T7AfumbKrPKHzH267G5lNnHM5L+7wGOBpruXw/R4jITbFZFFHL8eQ z+Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=AUub/DPFMbm5rWRcrmtpW8CVn0ARtOk9Ka5/szJNxyQ=; b=J/ssXh2sQCtEAH6pyzyUEPQDsK9KcuLxw3GJeho+UP1MFg8lUxSfS+k65v1r2IoY3N 8HBXUdH5OOSkQ+sRUnrKmkrREs4RjIEP+SbTwqSdpJqx6E43V1pCFcZI7dez2sYouVgi eLzizgnpPhDhd/URBPB4viYzG+PPbUos1cyFSqeyBp2GaUP797kBkAyXYzc/FA2en618 6wKMmzlUl3V5YD+Cpj33q0801WkckRMBqV7ydZZ7cZfUF+/vbKyk+1DZWurnLipvYMGG jT/xPCqjPBkXEiMaXVsHpmz7tS4lCuLFYuQFKygS3pPlRwMNdTcvuCRvy4lWCGbduwav MTUg== X-Gm-Message-State: AHYfb5gsEcrJpjKE3eFedDEp8FUsOd5Y8mL0qbiTLpaaN2dhcEceRSNL uS5rSZqUVO4sdjsd X-Received: by 10.28.151.199 with SMTP id z190mr4859680wmd.100.1503213739601; Sun, 20 Aug 2017 00:22:19 -0700 (PDT) Received: from ernst.home (p4FCA62DB.dip0.t-ipconnect.de. [79.202.98.219]) by smtp.gmail.com with ESMTPSA id q203sm4421125wmg.43.2017.08.20.00.22.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Aug 2017 00:22:18 -0700 (PDT) Date: Sun, 20 Aug 2017 09:22:11 +0200 From: Gary Jennejohn To: Cy Schubert Cc: Mark Johnston , freebsd-current@freebsd.org Subject: Re: swapfile query Message-ID: <20170820092211.6a9ad920@ernst.home> In-Reply-To: <201708192238.v7JMcFci004579@slippy.cwsent.com> References: <20170819213149.GA34140@raichu> <201708192238.v7JMcFci004579@slippy.cwsent.com> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.15.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 20 Aug 2017 07:22:22 -0000 On Sat, 19 Aug 2017 15:38:15 -0700 Cy Schubert wrote: > In message <20170819213149.GA34140@raichu>, Mark Johnston writes: > > On Sat, Aug 19, 2017 at 02:24:19PM -0700, Cy Schubert wrote: > > > In message <201708192100.v7JL0vFk003935@slippy.cwsent.com>, Cy Schubert > > > writes: > > > > > > > (On my -CURRENT laptop I see a scan rate in the hundreds on a totally idl > > e > > > > laptop and in the teens of my idle firewall. IMO this doesn't seem right, > > > > > > at least not compared to previous releases of FreeBSD or from the days wh > > en > > > > I worked on Solaris. You shouldn't see a scan rate on an idle system.) > > > > > > It appears that on an idle system with many pages in use, i.e. a laptop > > > running X and not really doing anything else, pages are scanned though the > > > system is idle. This is likely an artifact of r308474. > > > > It's an intentional consequence of r254304. The page daemon performs a > > slow and steady scan of the queue of active pages and will gradually > > move unreferenced pages to the inactive queue. > > This is certainly better. > > It's probably good idea to remove scan rate from vmstat output as it's not > meaningful in the traditional sense any more. For example on a > traditionally scanning VM system (Solaris or z/OS) the number of pages > scanned per second (or unreferenced interval count -- the inverse of the > scan rate) is the first indication that you need to look at your vm > subsystem. As of r254304 rate cannot be used used as a metric any more > except when one sees it deviate wildly from previous observations. (Not > that I'm complaining.) > > See below: > > procs memory page disks faults cpu > r b w avm fre flt re pi po fr sr ad0 da0 in sy cs us > sy id > 0 0 0 3.9G 292M 4 0 0 0 193 125 0 0 434 773 588 0 > 0 100 > 1 0 0 3.9G 292M 55 0 0 0 181 123 22 0 460 2467 1402 0 > 1 99 > 0 0 0 3.9G 290M 969 0 0 1 316 124 1 0 490 12571 4004 3 > 1 95 > 0 0 0 3.9G 289M 261 0 0 0 160 124 21 0 505 20426 7751 2 > 2 97 > 0 0 0 1.5G 755M 3481 0 1 1 60951 74 18 0 463 19918 6576 13 > 4 82 > > At this point I closed firefox. Pages are freed and scan rate decreases. We > now have a new normal. > > 0 0 0 1.5G 752M 10 0 0 0 0 24 1 0 409 595 365 0 > 0 100 > 0 0 0 1.5G 754M 1 0 0 0 403 23 49 0 478 609 1321 0 > 1 99 > 0 0 0 1.5G 754M 19 0 0 0 171 24 0 0 402 655 382 0 > 0 100 > 0 0 0 1.5G 754M 0 0 0 0 170 24 0 0 423 568 463 0 > 0 100 > 0 0 0 1.5G 754M 0 0 0 0 174 12 0 0 403 627 359 0 > 0 100 > 0 0 0 1.5G 754M 0 0 0 0 172 35 4 0 425 625 474 0 > 0 100 > 0 0 0 1.5G 754M 1 0 0 0 170 24 4 0 416 651 398 0 > 0 100 > 0 0 0 1.5G 754M 0 0 0 0 163 23 1 0 426 655 490 0 > 0 100 > 0 0 0 1.5G 754M 0 0 0 0 176 23 0 0 429 663 384 0 > 0 100 > 0 0 0 1.5G 754M 0 0 0 0 163 23 0 0 445 661 482 0 > 0 100 > > Should we consider removing scan rate from vmstat output? It doesn't really > mean anything in relation to tuning any more. > Depends. I have vm.pageout_update_period=0 in /etc/sysctl.conf and scan rate (sr) really does reflect the true scan rate. On my system sr is 0 while the system is idle. As an aside, my system (8GB RAM) hardly ever swaps, even under heavy memory load. Perhaps the output of sr could be somehow scaled based on the setting of the sysctl? Just a thought, I haven't looked at the source. -- Gary Jennejohn