From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9A08C43331 for ; Tue, 2 Mar 2021 15:56:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 789C764F17 for ; Tue, 2 Mar 2021 15:56:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1575873AbhCBPxi (ORCPT ); Tue, 2 Mar 2021 10:53:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58442 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1447402AbhCBN3n (ORCPT ); Tue, 2 Mar 2021 08:29:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614691696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=umQPMaBIIn1ud59t64umNutBCq3ImvcIOTQnYrwtg1o=; b=hj5HMfFvJBvmNZ0Me9nuO/eMqfZvAF2rIcW+neB5MK+e6oopM+2G4aSvLGSW/M/ND14myb z3LOTM9FGV1SaiLWqvdCeiIe1VEQJ69tGNvlpnSEscSCtr7reEEWc5wpXCe/Yh/dpopQcG 4hJmZplhgaTOqgB0YrUMRObNc5GYO0M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-452-p7RefSDkMEKd_fewATVYNQ-1; Tue, 02 Mar 2021 08:03:10 -0500 X-MC-Unique: p7RefSDkMEKd_fewATVYNQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 933DF835E22; Tue, 2 Mar 2021 13:03:08 +0000 (UTC) Received: from krava (unknown [10.40.195.211]) by smtp.corp.redhat.com (Postfix) with SMTP id DD7EF10013C1; Tue, 2 Mar 2021 13:03:05 +0000 (UTC) Date: Tue, 2 Mar 2021 14:03:05 +0100 From: Jiri Olsa To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Mark Rutland , Alexander Shishkin , LKML , Stephane Eranian , Andi Kleen , Adrian Hunter , Ian Rogers , Leo Yan Subject: Re: [PATCH 04/11] perf test: Fix cpu and thread map leaks in sw_clock_freq test Message-ID: References: <20210301140409.184570-1-namhyung@kernel.org> <20210301140409.184570-5-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 02, 2021 at 10:50:15AM +0900, Namhyung Kim wrote: SNIP > > > err = -ENOMEM; > > > pr_debug("Not enough memory to create thread/cpu maps\n"); > > > - goto out_free_maps; > > > + goto out_delete_evlist; > > > } > > > > > > perf_evlist__set_maps(&evlist->core, cpus, threads); > > > > > > - cpus = NULL; > > > - threads = NULL; > > > > hum, so IIUC we added these and the other you remove in your patches long time ago, > > because there was no refcounting at that time, right? > > It seems my original patch just set the maps directly. > > bc96b361cbf9 perf tests: Add a test case for checking sw clock event frequency > > And after that Adrian changed it to use the set_maps() helper. > > c5e6bd2ed3e8 perf tests: Fix software clock events test setting maps ok, and after that there's this one: a55e56637613 perf evlist: Reference count the cpu and thread maps at set_maps() forcing the get calls when storing cpus and threads for the patchset Acked-by: Jiri Olsa thanks, jirka > > It seems we already had the refcounting at the moment. And then the libperf > renaming happened later. > > Thanks, > Namhyung >