From owner-freebsd-dtrace@FreeBSD.ORG Sun Sep 15 19:53:49 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 34152AA6; Sun, 15 Sep 2013 19:53:49 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-ve0-x22c.google.com (mail-ve0-x22c.google.com [IPv6:2607:f8b0:400c:c01::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D77B4227A; Sun, 15 Sep 2013 19:53:48 +0000 (UTC) Received: by mail-ve0-f172.google.com with SMTP id oz11so2361925veb.17 for ; Sun, 15 Sep 2013 12:53:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=U6yzXai2yf11hevd1q7vul6IsYgyktzjfPqMVUnZd2g=; b=w0mWYMjvH/pY8hu9HPzb5mg6FVTYP9jgE4Ylds2CXAb4jlMmHSOOscUIIvovBAxvis OFaq4IG8G6N2AqhX1J0yi80cfVcMBibdsD5YYvHLq4cELnhYbDpc7MVvXVBjneq3bafB hErYp4s3/QV80vmqJWJ0vaY5bXNUzcNca1amAFCD5N+geYbfMiFJWlD84FsSmxIOEABq ttLWjFr5wOyd8/5FGwIOMcnqu6fBNX5RQ+JCv2LU9lqv6HcZFf2DfKiYtT/dEwY0gqT0 iBXD1gD+AgQ1C/RxK6v7UkTUA/ytRLcO/pqvKgfH8XsxBldqMbnJVrcbpTq75cIfzCCq e+0w== MIME-Version: 1.0 X-Received: by 10.221.56.194 with SMTP id wd2mr23735964vcb.7.1379274827897; Sun, 15 Sep 2013 12:53:47 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.65.132 with HTTP; Sun, 15 Sep 2013 12:53:47 -0700 (PDT) In-Reply-To: <52360A3E.40804@FreeBSD.org> References: <52360A3E.40804@FreeBSD.org> Date: Sun, 15 Sep 2013 21:53:47 +0200 X-Google-Sender-Auth: Vudm9r220tycwK83XbkP9J3Pzzs Message-ID: Subject: Re: vmem(9) use in Dtrace From: Davide Italiano To: Pedro Giffuni Content-Type: text/plain; charset=ISO-8859-1 Cc: 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: Sun, 15 Sep 2013 19:53:49 -0000 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. > Pedro. > _______________________________________________ > freebsd-dtrace@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace > To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org" Thanks, -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare