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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 9659DC433DF for ; Wed, 14 Oct 2020 17:27:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40A2B21D7F for ; Wed, 14 Oct 2020 17:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602696451; bh=urcRiDpreOZGXrgWJTPdPdfjcWzil4vJydUkwWKHjFU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=skdharMip0V55mvRY1oUJzxfr3YsUnhjzjBHwnp69AtrR+da/BvJW37Y1t0iPpp92 bsjtGciSP0hVhiglFmEhf83/vZczRrhnWn7Dil1yQ2NhX+SIGp6KJx5fOuQLzupi/x Wai+OMX3jwMcTnauVr/5b2vkTiZPZAxtOkMGmWGU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732090AbgJNR1a (ORCPT ); Wed, 14 Oct 2020 13:27:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:53486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732067AbgJNR1a (ORCPT ); Wed, 14 Oct 2020 13:27:30 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 725F12173E; Wed, 14 Oct 2020 17:27:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602696449; bh=urcRiDpreOZGXrgWJTPdPdfjcWzil4vJydUkwWKHjFU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=v3VBiJH+L1Qdel50WCV2V2GS9qbOORvlj6Leg9nLK4u6GzPB1ZW+NT+4AZmgzMOrp E3n/gz+YpiHpQoeWLHwyR3ZMAJAIFEzch6YrNlxMG4/mTLz6ccNiQUe92St8tjkSue JM7MaF+jba7nzdX7j3YB30ut0VGxuhnKxKf2Fcy8= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id CE3AC4047F; Wed, 14 Oct 2020 14:27:26 -0300 (-03) Date: Wed, 14 Oct 2020 14:27:26 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Namhyung Kim , Alexander Gordeev , Srikar Dronamraju , Peng Fan , LKML , Stephane Eranian Subject: Re: [PATCH v2] perf bench: Use condition variables in numa. Message-ID: <20201014172726.GO3100363@kernel.org> References: <20201012161611.366482-1-irogers@google.com> <20201014114500.GB1375972@krava> <20201014161418.GE1395746@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201014161418.GE1395746@krava> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Oct 14, 2020 at 06:14:18PM +0200, Jiri Olsa escreveu: > On Wed, Oct 14, 2020 at 08:39:51AM -0700, Ian Rogers wrote: > > The pthread_mutex_lock avoids any race on g->nr_tasks_started and > > g->p.nr_tasks is set up in init() along with all the global state. I > > don't think there's any race on g->nr_tasks_started and doing a signal > > for every thread starting will just cause unnecessary wake-ups for the > > main thread. I think it is better to keep it. I added loops on all the > > pthread_cond_waits so the code is robust against spurious wake ups. > > ah, I missed that mutex call > > Acked-by: Jiri Olsa Thanks, applied. - Arnaldo