From owner-freebsd-dtrace@FreeBSD.ORG Mon Sep 16 00:36:32 2013 Return-Path: Delivered-To: dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7F71D977 for ; Mon, 16 Sep 2013 00:36:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm27-vm5.bullet.mail.ne1.yahoo.com (nm27-vm5.bullet.mail.ne1.yahoo.com [98.138.91.249]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C4CE2F5B for ; Mon, 16 Sep 2013 00:36:32 +0000 (UTC) Received: from [98.138.101.132] by nm27.bullet.mail.ne1.yahoo.com with NNFMP; 16 Sep 2013 00:30:40 -0000 Received: from [98.138.84.38] by tm20.bullet.mail.ne1.yahoo.com with NNFMP; 16 Sep 2013 00:30:40 -0000 Received: from [127.0.0.1] by smtp106.mail.ne1.yahoo.com with NNFMP; 16 Sep 2013 00:30:40 -0000 X-Yahoo-Newman-Id: 693927.40817.bm@smtp106.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Rs3JyKgVM1lprkGOwXLD78c8t5EszgU5puLcb5C3Pq539kf v7v_maaSCqH8W9FDjALC.pSmCVNCMPjV7S6tAACvD0LSqapl_bX8HGGIeFwW D0ZI_De52H4wIm7ieT0YRgIBHcYW2y0lLmhY3yMG2rZH55j468JfpInq27CL 28B3MEk7Ket6Mbye17mN0kx1_ykc_2kym47U1X21iEFikl8gNN8AcgjXMU3A W.ChSS.U0aC2Upb1yMuLqqhgxrhyb_Xfc.4_X5oMUh0XHgkCS4nQmqoBtHQu D.iYZAIfPz8XqjN.dgN4AA4qDVMf6k1ZP79p1cwP_0djW605rpwjBdZZAUym s2_yGQlTMGIwkYGQGtL1XHZ2TuiZqQ5EVzYZxJJjuXzZwt41XihhTYPIjxBu xL3VoK81tOnXV._VkRtxgQ_CNr.R3tIrWSesuu1vAtiOt0H42XirACEXiKht G9L1She1NvpcP5sgrMAmpbCC2DrBJliO.772t5CrQExFkj.f_XtyqwrbhqfJ 1ECgx8ysEHHupr1rjvW4ixfzmqPDmBhPhWMRITZJMs3MWNG8PLonfT0BBUyE - X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp106.mail.ne1.yahoo.com with SMTP; 15 Sep 2013 17:30:40 -0700 PDT Message-ID: <52365131.8020709@FreeBSD.org> Date: Sun, 15 Sep 2013 19:30:41 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Davide Italiano Subject: Re: vmem(9) use in Dtrace References: <52360A3E.40804@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: jeff@FreeBSD.org, dtrace@freebsd.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2013 00:36:32 -0000 On 15/09/2013 2:53 p. m., Davide Italiano wrote: > On Sun, Sep 15, 2013 at 9:27 PM, Pedro Giffuni wrote: >> Hi; >> >> Just noticed this, in the old DtraceTODO wiki: >> >> https://wiki.freebsd.org/DTraceTODO >> >> There is mention of some use that Dtrace makes of Solaris's vmem >> allocator, specifically vmem_create(), vmem_destroy(), vmem_alloc(), and >> vmem_free(). These functions (not exact but similar ones) have >> been brought to FreeBSD 10 (r252330). >> >> According to opengrok we may just have to uncomment some Solaris >> code in sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c >> > > We need also to provide at least some sort of wrappers for e.g. flags > passed to vmem_alloc which takes VM_SLEEP in solaris while in FreeBSD > this is M_WAITOK etc... > >> This would reduce differences with the Solaris code but it has >> to be examined carefully as I think John Birrell had already >> solved the issue by providing the resource id's natively (kmem). >> >> Just thought I would point it out ... It may be that it is not >> worth spending too much time on it since the existing code should >> just work. >> > > vmem is designed to be a generic resource allocator. I still need to > analyze how Dtrace uses it but in general it provides better > scalability and less fragmentation wrt home-rolled allocators we have > in the kernel. FWIW, Illumos uses it for several things, e.g. pid/tid > allocation. It might worth a try. > FWIW, the next point in the old DTrace TODO list is that Solaris has vmem_cache_*. Maybe providing a cache is something that may be useful in FreeBSD too. Regards, Pedro.