From owner-freebsd-hackers@freebsd.org Sun Oct 7 23:40:41 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 3D48C10ABD0D for ; Sun, 7 Oct 2018 23:40:41 +0000 (UTC) (envelope-from cneirabustos@gmail.com) Received: from mail-vs1-xe2f.google.com (mail-vs1-xe2f.google.com [IPv6:2607:f8b0:4864:20::e2f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA83F70E33 for ; Sun, 7 Oct 2018 23:40:40 +0000 (UTC) (envelope-from cneirabustos@gmail.com) Received: by mail-vs1-xe2f.google.com with SMTP id m5so3861186vsk.6 for ; Sun, 07 Oct 2018 16:40:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=71FWLoeb6iEcg/LE1XBv8SDyIvXrUM25igNeM2TLCLw=; b=q4V4aKKGllSCaV8l+h17pjRcIwzgU2X+UmWk+7gi7n54VqeKZ3ZHEFHX5O+WsIcPOC 1HyXCetwEy6b5k52AM1oitOSXGqDRBd8sa7FCbWx9XvgMB6JpQ1H0QbD7OiafMNpGtMA 6Oq3LGaohrrpNK82DuZKOg+vlr3x41PizZpiU8twZ0FXGbGeSNvnchUU9gB6cYA2Cufw HRA3RBEBlDpZ/ZDE151tqd2hmQyG+sCXZjuZvBlfK5RTsPKZqHmkAgNWmURNDcLIrRQ5 QOJHlzxHmVtEYOA0O/g521sV9AYbzWu/KvoOkKmGhzVh9bLIFsmBwD/lMcvlzGOWyu/z Svtw== 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=71FWLoeb6iEcg/LE1XBv8SDyIvXrUM25igNeM2TLCLw=; b=bR8fKEvwLywnNRVVC1cNIJx+Y1j5nLfjNwZT1AsVgIfByYlnodr7GYV+PLQOkCnbxD ypGmLx/rGTQc9m0O7YOPH13FXklwrAEKVbkBAAxYTPUHJ3i4O7u6j/4CAXhARvYXGEdC bWmBPw+12DXVGkWMLTOHIinv3xbaEKKHIP7nz0pBCwkfw5n12FNK9lAGAia4DIWbZ/wk LeCFUWQHR9Vb5YaA7MJaF1cRckWHwQQkcyAoyDNbBn6nBwUKaVUzs/lI1Y7iEkB6x8nZ yDfCKQCL8PRtN7Fu9/Np6oAKJwg7YjHWwPpk2ijNK2tlf4yNQJqxaZlJ+n2UiDn5MJHY QcYQ== X-Gm-Message-State: ABuFfojW0Xyv4egMj2UE+0zKhT5PKMJ494L2wUfQ3mQRpSJ8lRilY5iH TGGyEsEjsygRcLTNxsPXVjgHNw9NsN9UWHSz9A4= X-Google-Smtp-Source: ACcGV63mqBeNhYMPkWcsah6Lnb97QMhQ3hZyMub2uJpwKr08GpWVR7d6cqvnRp11wFji4bbl8KhPE0I0bkx8qnYGtsQ= X-Received: by 2002:a67:f458:: with SMTP id r24mr7678413vsn.164.1538955639935; Sun, 07 Oct 2018 16:40:39 -0700 (PDT) MIME-Version: 1.0 References: <20181007094150.GY5335@kib.kiev.ua> In-Reply-To: <20181007094150.GY5335@kib.kiev.ua> From: carlos antonio neira bustos Date: Sun, 7 Oct 2018 20:40:23 -0300 Message-ID: Subject: Re: vm statistics per jail To: kostikbel@gmail.com Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 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 23:40:41 -0000 Thanks, Konstantin, So that means that for a vm_page_t object the cred member from a vm_object_t in the vm_page_t will never have it cr_prison struct pointing to a jail? Is there a method to associate a vm_page_t to a jail ? as vm_object contains a cred member I thought I could use that. Bests On Sun, Oct 7, 2018 at 6:42 AM Konstantin Belousov wrote: > 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. >