From owner-freebsd-current@freebsd.org Mon Jul 10 02:15:25 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 37915D9AFEF for ; Mon, 10 Jul 2017 02:15:25 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-qt0-x22f.google.com (mail-qt0-x22f.google.com [IPv6:2607:f8b0:400d:c0d::22f]) (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 ED1E577BD0 for ; Mon, 10 Jul 2017 02:15:24 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: by mail-qt0-x22f.google.com with SMTP id 32so62236037qtv.1 for ; Sun, 09 Jul 2017 19:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=to:from:subject:message-id:date:user-agent:mime-version; bh=QRiWTknuCN32wYFnGF2rSxv2akfzFPKzR7Uw/XpmV5o=; b=Jm2874hHi24xp25Nu+vX1AApgiPKyfkxol9CfnUbjEh/1kGfIPVZrM0giDK61aNUo1 jfyrJzhIXftqlISdJOH/zuuOf+8i2nN5IiCeLOYktFlFKlR2FnxwsDzahtVDn9wVrB3o 9UpI6mzv2EGO8undVQXE0rXLSCE1NHMA//zGc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version; bh=QRiWTknuCN32wYFnGF2rSxv2akfzFPKzR7Uw/XpmV5o=; b=gGWi7+4C/QTHvrUJvP1GPNzC99fI8+/KjeqVaAJY+5xXqI0WuMy9DIVX1ygigfBAit wxUW7mPL+zQuhThKJbR7JT4UNGJbmrYvKVKcJ83O05Xeh4afJvw7bE75HI5WNhlDIzvR WVgOOl9JZw6Pk3MHabHb51AqkYetZe06KrWyLHTU46LXddhRU3Bz59rzxptn+1YujPVA FzSdiRRYn60pTupHYlmTmif82sskXu/nvr0IvOJzbTpDY2UIKsOwdamuUniaimObOMR1 fuh73E9O09n8OOxu57iaEG4eaqxvsn1qq0wIjbyRc3UDddg/i9tso4QU/7ey2Sqb9DQl e0+A== X-Gm-Message-State: AIVw1109uRWdMO7MqVGB8JfCjLRhPAtTtFXSxS/vpzZbu3aw+DcqnjxB ZKLhAl2JdlIMdWGBuMA= X-Received: by 10.200.43.208 with SMTP id n16mr1514464qtn.190.1499652923157; Sun, 09 Jul 2017 19:15:23 -0700 (PDT) Received: from ?IPv6:2804:54:19ef:cc00:d576:4783:d01d:7f6b? ([2804:54:19ef:cc00:d576:4783:d01d:7f6b]) by smtp.googlemail.com with ESMTPSA id a1sm7455169qkg.54.2017.07.09.19.15.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Jul 2017 19:15:22 -0700 (PDT) To: freebsd-current From: =?UTF-8?B?T3RhY8OtbGlv?= Subject: type of vm.stats.vm.v_vnodepgsin vm.stats.vm.v_swappgsin, vm.stats.vm.v_vnodepgsout vm.stats.vm.v_swappgsout on AMD64 r320730 Message-ID: <1c37db96-7cd2-91c9-011c-967a32a97f05@bsd.com.br> Date: Sun, 9 Jul 2017 23:15:18 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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: Mon, 10 Jul 2017 02:15:25 -0000 Dears I'm the maintainer of xosview and I'm debugging rather weird behavior from it in the latest FreeBSD 12 revisions (12.0-CURRENT #0 r320730 AMD64) . The problem is occurring on the lines responsible for collecting statistics about paging. These lines follow: If (pageinfo) { Pageinfo [0] = (uint64_t) vm.v_vnodepgsin + (uint64_t) vm.v_swappgsin; Pageinfo [1] = (uint64_t) vm.v_vnodepgsout + (uint64_t) vm.v_swappgsout; } This code works on FreeBSD 11 and until a short time ago it works at 12. But now it returns extremely large values ​​when interpreted as 64-bit values. A debugging has shown that for this sysctl call the following values ​​are returned in the terminal: sysctl vm.stats.vm.v_vnodepgsin vm.stats.vm.v_swappgsin vm.stats.vm.v_vnodepgsout vm.stats.vm.v_swappgsout Vm.stats.vm.v_vnodepgsin: 47432 Vm.stats.vm.v_swappgsin: 0 Vm.stats.vm.v_vnodepgsout: 19 Vm.stats.vm.v_swappgsout: 0 While the code returns things like: Pageinf [0] = 34359785800; Pageinfo [1] = 140733193388051 Pageinf [0] = 34359785800; Pageinfo [1] = 2678138638516092947 After some tests I found that if I change the code to use a typecast to (uint32_t) then Xosview works correctly.: If (pageinfo) { Pageinfo [0] = (uint32_t) ((uint64_t) vm.v_vnodepgsin + (uint64_t) vm.v_swappgsin); Pageinfo [1] = (uint32_t) ((uint64_t) vm.v_vnodepgsout + (uint64_t) vm.v_swappgsout); } For me, it seems that some code in the kernel is storing values ​​as 32 bits where it should be 64 bits. Is this behavior correct? []'s -Otacílio