Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3874878pxj; Mon, 21 Jun 2021 08:27:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjxt7/z/9oC+IXY0QxdnR+YCiUC5WYzBlRfPCOxudhqAkQaXEfodG/S9Wa57k636GNMafZ X-Received: by 2002:aa7:d888:: with SMTP id u8mr17465174edq.132.1624289221516; Mon, 21 Jun 2021 08:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624289221; cv=none; d=google.com; s=arc-20160816; b=TJ71PR2J95BzMMQFyYJwh6fzM7LB0DHT+Tpk6WMwGqL0OMxlOuop34WoPo25jIojwt SdqGLumb+oqAGhQgJkxNwXbMmZIzInb5hdxviva33mRElUT0T8NFJ5wX3SMvB4NRUOus UpL5PNMTiay0OcbgWoc6BW9y0AIOLpl8iXnQ1ANcbEnv+td8gtM5PcWa72MkKja8xKeH syvKVaEmZD3sWpqvY9z5BexuV4LTQfxg5swjf+Yc1TwyzDAhKUwpFLdE2U3lDxZQMRCi RrUcuvZB1zCVu1gr5SmEnkdakL8l0fDOR0MiQQboY5mRLBZqBb84Py+5Wov/7Il8gBnk UB4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=N3cxomzIffYjbSvXecdBBX9Jtzmz4/D8P4Ua7RpfHOI=; b=g5kgdtS6Qq36Lv2s81AHfBzX3hNpDJ4zHWrFkTIyFhWqJ/Paeq8kKAncHSoOBE8LrL yIBSrWgDHmL8IPJK9SEu9OYo5ImsTt0v/U/9EhnozTilo9zL/T4lZbHZP9eqATPAX05B /L2AuVcxfbeVRiWTOQ3eXJ7brrNNnYZpgE9BcvKUuRJYkI2kl30P5jSTyahGsA6PMblW pZSJcrd1P6rB+BlgO1asUhdBZqE570AL7LtAvF/16Ux5szU7fnXlPn1R9ImoJ8gjrVwU CByo8ZZgQyTnfPLv6TdUbAVsXvrj/HWwVVUEh0nXK7+edEGVA2VM91nf5wfcW6HI4cbp voyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf25si533867ejb.212.2021.06.21.08.26.38; Mon, 21 Jun 2021 08:27:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230286AbhFUP1z (ORCPT + 99 others); Mon, 21 Jun 2021 11:27:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:54312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbhFUP1s (ORCPT ); Mon, 21 Jun 2021 11:27:48 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 CC45261003; Mon, 21 Jun 2021 15:25:30 +0000 (UTC) Date: Mon, 21 Jun 2021 11:25:28 -0400 From: Steven Rostedt To: Daniel Bristot de Oliveira Cc: Phil Auld , Sebastian Andrzej Siewior , Kate Carcia , Jonathan Corbet , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Alexandre Chartre , Clark Willaims , John Kacur , Juri Lelli , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V4 05/12] trace/hwlat: Support hotplug operations Message-ID: <20210621112528.12aee665@oasis.local.home> In-Reply-To: References: <8899f8a8bec38bc600f7a2c61bc6ca664aa7beeb.1623746916.git.bristot@redhat.com> <20210618124503.388fe4d4@oasis.local.home> <20210618150020.689439d4@oasis.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Jun 2021 13:34:44 +0200 Daniel Bristot de Oliveira wrote: > > And of course, because get_online_cpus() is called within > > trace_types_lock, doing this check is going to cause a lock inversion. > > > > Yep! I tried to take the trace_type_lock here, and got the lockdep info about > this problem. > > > The only thing I could think of is to wake up a worker thread to do the > > work. That is, this just wakes the worker thread, then the worker grabs > > the trace_types_lock, iterates through the cpu mask of expect running > > threads, and then starts or kills them depending on the hwlat_busy > > value. > > So, it will not wait for the kworker to run? What wont wait? -- Steve