From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Adhemerval Zanella Newsgroups: gmane.comp.lib.glibc.alpha Subject: Re: [PATCH v2] Add malloc micro benchmark Date: Fri, 5 Jan 2018 14:46:43 -0200 Message-ID: References: <14a47123-3c83-85cf-d851-c0e6df3d9e25@linaro.org> <54c9f9e0-5939-4b98-e36b-76383f276f35@redhat.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1515170703 12662 195.159.176.226 (5 Jan 2018 16:45:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 5 Jan 2018 16:45:03 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 To: Carlos O'Donell , libc-alpha@sourceware.org Original-X-From: libc-alpha-return-88875-glibc-alpha=m.gmane.org@sourceware.org Fri Jan 05 17:44:58 2018 Return-path: Envelope-to: glibc-alpha@blaine.gmane.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=cgpl6jy3eU6dAB6D khNMhSctIc2vVm40tgXWCPew7YZAmj6RNOO3U0ZjRWzwBhan2WzfjqanTCPRXvGb tdPW/TE7zk2A0/W7lROm7I0IZPH0DiptpmMmsdIntqUkMRlwiZHnA+f0cKA5OZqK S0XtaGtb8slumE6A2dOXD+YrVIU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=7X6KDrlN3oalNrUlr3+wh6 zM+zY=; b=f2WtU/1zvMB8iCDDifOefgl1yHb6OnUe7tPkFZC5dfInz8hDG3UEtK 1lsHxYFpJ7Sw1JVutnID6JJYKQPvlJoESvJq0RbO0mXQwuA0St1kSfVsfI2TH0W6 7XzK+XeNv07WRVkH5OoyAavI9k0cOalwvOU+/GsCtP6S6D4Hait7U= Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Original-Sender: libc-alpha-owner@sourceware.org Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=secret X-HELO: mail-qt0-f194.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mZo9IwMsggbZiNcz3lk8Cs8/LgHb6s8zAi4VPRZcCa0=; b=M9d8403Rf7JwFZFdWa9r4yP80jcuBVQPITtG408njfgh90p+USX46CyK3bZDtBBYt/ bVbZRuXHnvLJSW+rPIAzSUKrqznWS8OMcRZtd6CZd0d+pyQtXC3P+bPm2zveRowvawbM QJNW054hF2CG0NqGkx+4PFNvj6zYkPX1EWPSkJMtLeQWiXW6Ybkm4vXe3zsMUY1zjYQZ miAsEUURVaJqepon/BYx20ILHLBU91Tie0DIEM/s6KB/ehZrMsY0IRfCqGo8oByyeHe+ Ozqn7j9+6Jg7Gs57HOHMwcFAPSUFlUQFlRAiVqWexVoZsG+fSUFBY/YD1CYiEFoag9we 8Amg== X-Gm-Message-State: AKwxytfqwhPqlHy9W22QY71YmJjmLODeenu+2FyZzGA6kJLFYV4HVgVW xNbFqj7s6OGle210kckTOWjpkWTZR8A= X-Google-Smtp-Source: ACJfBouZpNf1n89YS9+g8XcEB6aYBa/hkvEA8Izq0JyfyCN+hkJqEnggW5EJvP2I+fx2MMyqu5K/Cg== X-Received: by 10.237.39.69 with SMTP id n63mr5108293qtd.76.1515170808235; Fri, 05 Jan 2018 08:46:48 -0800 (PST) In-Reply-To: <54c9f9e0-5939-4b98-e36b-76383f276f35@redhat.com> Xref: news.gmane.org gmane.comp.lib.glibc.alpha:81238 Archived-At: Received: from server1.sourceware.org ([209.132.180.131] helo=sourceware.org) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXV6z-0002iG-03 for glibc-alpha@blaine.gmane.org; Fri, 05 Jan 2018 17:44:53 +0100 Received: (qmail 114198 invoked by alias); 5 Jan 2018 16:46:52 -0000 Received: (qmail 113812 invoked by uid 89); 5 Jan 2018 16:46:52 -0000 On 05/01/2018 14:17, Carlos O'Donell wrote: > On 01/05/2018 07:50 AM, Adhemerval Zanella wrote: >> >> >> On 05/01/2018 12:32, Carlos O'Donell wrote: >>> On 01/04/2018 05:48 AM, Wilco Dijkstra wrote: >>>> Carlos O'Donell wrote: >>>>> >>>>> Don't use mallopt, please make it a tunable then. >>>>> >>>>> The mallopt API already had 2 secret arena options which eventually became >>>>> so well used they were baked into the API and had to be made public. >>>> >>>> Unfortunately tunables are not exported so you can't use them outside of GLIBC: >>>> >>>> /build/glibc/benchtests/bench-malloc-simple.o: In function `bench': >>>> bench-malloc-simple.c:(.text+0x19c): undefined reference to `__tunable_set_val' >>>> collect2: error: ld returned 1 exit status >>> >>> Correct, we only have a env-var frontend right now, and the internal API is not >>> made accessible via GLIBC_PRIVATE. >>> >>> You have 3 options for tests: >>> >>> * Use the env vars to adjust test behaviour. Run the tests multiple times. >>> * Add a new C API frontend, very valuable, but more time consuming. >>> * Expose the existing internal C API via GLIBC_PRIVATE for testing, and throw >>> it away later when we get a proper C API frontend. >>> >> >> Do we want a C API to tied the malloc implementation to some tunables? My >> understanding is the tunable api idea is not really enforce retro-compability >> (where a C api would enforce it). > > If we add a C API to the tunables, we would honour that API for tunables for > all time, but the tunables themselves would not be stable. > > e.g. > > * get list of tunables supported > * get the default value for a tunable > * get the value of a tunable > * set the value of a tunable > > So you would use this API in the tests to get the tunable list, assert the > tcache tunable was accepted (or fail the test), and then set it to a special > value for the part of the test that needs it. Right, this seems a reasonable approach (although I think out of the scope for this change).