From owner-freebsd-hackers@freebsd.org Sun Oct 7 09:42:01 2018 Return-Path: Delivered-To: freebsd-hackers@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 25BB810BAD2A for ; Sun, 7 Oct 2018 09:42:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 99E5A7CF68 for ; Sun, 7 Oct 2018 09:42:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w979foEV051816 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 7 Oct 2018 12:41:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w979foEV051816 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w979foGN051815; Sun, 7 Oct 2018 12:41:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 7 Oct 2018 12:41:50 +0300 From: Konstantin Belousov To: carlos antonio neira bustos Cc: freebsd-hackers@freebsd.org Subject: Re: vm statistics per jail Message-ID: <20181007094150.GY5335@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2018 09:42:01 -0000 On Sun, Oct 07, 2018 at 01:20:50AM -0300, carlos antonio neira bustos wrote: > Hello, Hackers, > > I have added mib member vm.vmtotal to be part of a prison with the intent > that each jail could report the correct memory usage using their vm > counters. > Unfortunately for me, I found that t_free depends on the global vmmeter > counters, so I'm trying to add those as well to the prison struct, that > will make consumers of those counters to report the correct information > inside a jail. > The problem so far trying to add vmeter is when I'm trying to determine to > which jail a vm_page_t belongs to using vm_pages_t's object cred struct I'm > getting a kernel panic due to a page fault. > I have modified vm_phys_freecnt_adj(vm_page_t m, int adj) from > /usr/src/sys/vm/vm_phys.h to increment the vmeter.v_free_count on the > cr_prison that's belongs to vm_page_t. > The panic does not produce a dump, so I'm unable to debug the fault. > My rc.conf contains dumpdev="AUTO" so I think it should produce a dump or > could it be that the panic happens to early? > Is it possible to obtain to which cr_prison a vm_page_t belongs to ?. No. vm_page_t does not belong to a jail.