From owner-freebsd-bugs@freebsd.org Tue Oct 27 02:05:21 2015 Return-Path: Delivered-To: freebsd-bugs@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 00DB5A1C8CE for ; Tue, 27 Oct 2015 02:05:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0E85179A for ; Tue, 27 Oct 2015 02:05:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id t9R25KnN015629 for ; Tue, 27 Oct 2015 02:05:20 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 204049] vmtotal() loading is high when memory utilization is high Date: Tue, 27 Oct 2015 02:05:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jiashiun@gmail.com X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 02:05:21 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204049 Bug ID: 204049 Summary: vmtotal() loading is high when memory utilization is high Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: jiashiun@gmail.com Tested on a Xeon-E5 v3 with 64GB memory and 11-current #289783 when memory utilization is high, the command 'systat -vmstat 1' will also consumes more cpu cycles. % top last pid: 40272; load averages: 0.32, 4.74, 8.01 up 3+01:19:54 17:23:59 58 processes: 1 running, 57 sleeping CPU: 0.1% user, 0.0% nice, 1.6% system, 0.1% interrupt, 98.3% idle Mem: 4509M Active, 52G Inact, 2819M Wired, 1572M Buf, 2930M Free Swap: 3598M Total, 3598M Free PID USERNAME THR PRI NICE SIZE RES STATE C TIME CPU COMMAND 46841 root 30 20 0 9248M 7930M kqread 9 20.8H 11.88% bhyve 49914 jsli 1 23 0 19320K 3884K select 5 134:08 4.79% systat the cause is supposed to be getting sysctl variable vm.vmtotal, which in turn calls vmtotal(). This can be reproduced with sysctl command: % time repeat 100 sysctl vm.vmtotal > /dev/null 0.055u 8.102s 0:08.19 99.5% 31+175k 0+0io 0pf+0w It does not seem to mitigate loading by freeing memory: % top last pid: 14037; load averages: 0.15, 3.09, 6.45 up 3+17:45:01 09:49:06 57 processes: 1 running, 56 sleeping CPU: 0.0% user, 0.0% nice, 1.2% system, 0.0% interrupt, 98.8% idle Mem: 2060M Active, 45M Inact, 3004M Wired, 1572M Buf, 57G Free Swap: 3598M Total, 623M Used, 2975M Free, 17% Inuse PID USERNAME THR PRI NICE SIZE RES STATE C TIME CPU COMMAND 49914 jsli 1 27 0 19320K 2780K select 8 199:48 12.56% systat 1026 jsli 1 29 0 28116K 8372K select 7 45:39 0.86% tmux % time repeat 100 sysctl vm.vmtotal > /dev/null 0.070u 25.400s 0:26.35 96.6% 28+174k 0+0io 0pf+0w On contrast the status shortly after reboot: % top last pid: 1083; load averages: 0.15, 0.24, 0.12 up 0+00:02:45 09:56:59 42 processes: 3 running, 39 sleeping CPU: 0.0% user, 0.0% nice, 0.1% system, 0.0% interrupt, 99.9% idle Mem: 72M Active, 39M Inact, 451M Wired, 11M Buf, 62G Free Swap: 3598M Total, 3598M Free PID USERNAME THR PRI NICE SIZE RES STATE C TIME CPU COMMAND 1004 jsli 1 38 0 21972K 4176K CPU6 6 0:00 0.52% tmux 814 root 1 20 0 213M 14128K select 3 0:00 0.37% nmbd 1031 jsli 1 20 0 17272K 4628K select 1 0:00 0.16% systat 1083 jsli 1 38 0 9008K 2464K CPU11 11 0:00 0.05% sh % time repeat 100 sysctl vm.vmtotal > /dev/null 0.055u 0.160s 0:00.20 105.0% 172+238k 0+0io 0pf+0w Originally discussed in http://lists.freebsd.org/pipermail/freebsd-hackers/2015-October/048483.html -- You are receiving this mail because: You are the assignee for the bug.