From owner-freebsd-hackers@freebsd.org Wed Nov 16 02:27:10 2016 Return-Path: Delivered-To: freebsd-hackers@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 1D5CBC44213 for ; Wed, 16 Nov 2016 02:27:10 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com [209.85.214.41]) (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 E0966FD8 for ; Wed, 16 Nov 2016 02:27:09 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f41.google.com with SMTP id c20so186655545itb.0 for ; Tue, 15 Nov 2016 18:27:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=w5zeQzW8sc3nfE2YknGRRNFN8D5XIZ9CIOQ+bW+SK14=; b=K8GF15v6NanQMcgBwL98DdxF++TxLP4mmB6JA/g7yKNel9LDUpSQfanPeE88meEo8s Yl8dvVnoNel9APgUv9KWs8KLBLH1SAPz8XVENO00BUBGC2ZXpF4YTzbr+VFhelmQVfCJ Njzg9Ar+OJUuYuaF5jj08HcPupYKuGUw3O1zVZvduiskkmNYBXE8XTaQ22C+ngcdAvn7 dGoVAxCWKO2IPTV85Fx9kr3FisAyiJ9SjwtIyNE2uAsxzTp0NB4+t1H8Q4ZlJNGbB4s5 2Cl0mtDu1oD5O4sjtdcLz/sgmvtvKoJVoTc4LCjtqByHBPsP+CDeuiW+KF62frcFBCoa lF4g== X-Gm-Message-State: ABUngvcfQ/a3VVRMxUP6XB19vxXifGO/aYti9xPUdNYG02UIbBVVkui+b0BU3CaK5zKX2g== X-Received: by 10.36.61.207 with SMTP id n198mr6476014itn.60.1479262732657; Tue, 15 Nov 2016 18:18:52 -0800 (PST) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com. [209.85.214.53]) by smtp.gmail.com with ESMTPSA id 7sm2579705itk.0.2016.11.15.18.18.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Nov 2016 18:18:52 -0800 (PST) Received: by mail-it0-f53.google.com with SMTP id c20so30637800itb.0 for ; Tue, 15 Nov 2016 18:18:52 -0800 (PST) X-Received: by 10.36.99.68 with SMTP id j65mr5965742itc.119.1479262731868; Tue, 15 Nov 2016 18:18:51 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.199 with HTTP; Tue, 15 Nov 2016 18:18:51 -0800 (PST) In-Reply-To: References: <20161110012624.GA23701@lonesome.com> <20161110215549.GL91607@kduck.kaduk.org> From: Conrad Meyer Date: Tue, 15 Nov 2016 18:18:51 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: sbrk(0) replacement for memory resource tracking? To: Matthias Andree Cc: Benjamin Kaduk , "freebsd-hackers@FreeBSD.org" , Mark Linimon Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2016 02:27:10 -0000 On Thu, Nov 10, 2016 at 2:26 PM, Matthias Andree wrote: > OK. So the quick and dirty way to re-enable e2fsprogs on those > architectures whilst scrapping any memory statistics would be to #define > sbrk(a) (a) which would just invalidate stats, providing the application > handles bogus data. > > Other than that, it would seem that mallctl("epoch", ...) to synch up > stats, and mallctl("stats.active", ...) or perhaps or "stats.mapped" > gets me close to what comparing sbrk(0) over process lifetime would have > achieved, wouldn't it? This is assuming sbrk() had page granularity > anyhow and stats.active provides exactly that (gross memory allocated). > Possibly this also wants mallctlnametomib and mallctlbymib for > optimization if called often. Right? Yes, something exactly like that (jemalloc-specific) or perhaps libprocstat (FreeBSD-specific). Best, Conrad