Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3914274pxj; Mon, 21 Jun 2021 09:16:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOtjc5743FypdQp8yvNmu0lNb081UHljk2ABejkG+xjN5vg7M3bogaqC3Ur6kLFnUeg2iM X-Received: by 2002:a05:6402:144e:: with SMTP id d14mr2923936edx.339.1624292167204; Mon, 21 Jun 2021 09:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292167; cv=none; d=google.com; s=arc-20160816; b=IpMRxhOuuqn5S5XnSh3zfOHbHOHCY1cBEug1EUUjvxwtdoZvN7gcUf3vt6jnKdk14n NWexU7YLYH4lEpGrjpPVcDkI18LRnYwAND3eM26EDhQL84ypjroqAmkko0fr1Ov/dwu7 AeoLGAnnoK4LhsXpKjtX/NwWoCfEHtq/NcXzBJj7UK3UGUsNpbVaYCH5040J5k54hsd/ n8Qwm2elNoznI+dC74sdJOLrBJWo7bx1X+5ukgbiMutvVIZh6nrqdRtF1jFdWkWpaNjt rl0uKbBLHgPDQ28XN66BQfsvUllv8MQWsgGLclHq15G1fdsZhOMPvR+fZx4p+/2BGC5r 71aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=G817IJLoTEYUuE/9RZvRi1mEhIu8nStp2ksiuR5OOGA=; b=A2uTxMpVI6HVF46qPPhXEWFqPCSsnN6D247T3G7RqzAT+jcVAQND8lwy4T5Ih0rkqt Grs5pxQ74DpeNRdXvEifIiR14PBHgpxhH0Zf3nEqJCi3tKYxiTC21ZTsNBm68D3eXQpm 3K5ZawR4yzHZ0DMN8gydEsBV0xUBoVeDhlJjjaizn4Nn28KuTiixogvDvDPwH/Red/Lp kUzALWdueDPqaWQH1pc8bjFKTg7+oRWCnW/fJlIpIjLT/YWoR92By3Li+6F/siwTCUu3 VGCqF0ZGRO4OzPlrPcR3pqAfo3rQjsFMp0gu6THPEqUoNOKaA88qKuTrDMJfSlu6O+45 s8uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C2B2Ofcc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r7si5341302edd.178.2021.06.21.09.15.44; Mon, 21 Jun 2021 09:16:07 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C2B2Ofcc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230028AbhFUQQ5 (ORCPT + 99 others); Mon, 21 Jun 2021 12:16:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23465 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbhFUQQz (ORCPT ); Mon, 21 Jun 2021 12:16:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624292080; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G817IJLoTEYUuE/9RZvRi1mEhIu8nStp2ksiuR5OOGA=; b=C2B2OfccH9C6WJLDVCZzDzYtphAmJM5FpHYr4Ni2OEplI6q40U3KcfBtYgsDtr4zK/m1xg PY1b9Idi3Cobytnlhd53u+HPYkdgMmZ/wyVpHUzV6wOVkskEejkpAPPPLcVs1d4853m7tD Et5hzEa0J0ndaDJs0UyuFrjx07nbf5o= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-533-uXH7lJBzOqedVExIlIzpjw-1; Mon, 21 Jun 2021 12:14:39 -0400 X-MC-Unique: uXH7lJBzOqedVExIlIzpjw-1 Received: by mail-ed1-f69.google.com with SMTP id p23-20020aa7cc970000b02903948bc39fd5so5934520edt.13 for ; Mon, 21 Jun 2021 09:14:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=G817IJLoTEYUuE/9RZvRi1mEhIu8nStp2ksiuR5OOGA=; b=YPaVucmZfr/4y5c9pTLAfEhDHvEewyGw7m3J+9cfmvBIRHhmazu4K2WpMvdi/F5dBG k0QTrS//9MtyheYk8MLFB+Q667z8j49DgRjweQi7XaWNfw5VHHBBOHyeMDnN1o+q/yOR HCEoUFpZimIIj9PaZ+8ihT0k9h2R0No3It9nngpivnIMokkpeWo7KBvWUmW/R36LC2uu O86Ysn4X0oAlSU46NFyqBPb/ZZ1LbW9mDoFrSKj7F2FpZewwvweq2tMOurTCFck7yErR /seI6wDZ7DrkvlVdQumEvMRCQMYUnZVvdHUxAhIUtYoGpN1td0t6qn3QxQLGOtP2Zmls zfyg== X-Gm-Message-State: AOAM530ijd3rLT1OXkMs4TEmHD3js+SyG44evzoQOb6qqEWgXCfmreQu GuSQwc0YUyes9hkFAneODBxUMNA5xNTIy4C2RGdLXGtcEwQlWE+otOJP7HM/3erR9d99roPyXd4 KoR7AhE4Ed1gJgsMI6s6kyPe52r9jpeOfbabR39XDBIx3SXdxTGmq0olE6SUDNoDhgTbqxbnU9R E= X-Received: by 2002:a17:906:1806:: with SMTP id v6mr25386700eje.454.1624292077982; Mon, 21 Jun 2021 09:14:37 -0700 (PDT) X-Received: by 2002:a17:906:1806:: with SMTP id v6mr25386670eje.454.1624292077790; Mon, 21 Jun 2021 09:14:37 -0700 (PDT) Received: from x1.bristot.me (host-79-23-205-114.retail.telecomitalia.it. [79.23.205.114]) by smtp.gmail.com with ESMTPSA id x9sm5155238ejc.37.2021.06.21.09.14.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Jun 2021 09:14:37 -0700 (PDT) Subject: Re: [PATCH V4 05/12] trace/hwlat: Support hotplug operations To: Steven Rostedt 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 References: <8899f8a8bec38bc600f7a2c61bc6ca664aa7beeb.1623746916.git.bristot@redhat.com> <20210618124503.388fe4d4@oasis.local.home> <20210618150020.689439d4@oasis.local.home> <20210621112528.12aee665@oasis.local.home> From: Daniel Bristot de Oliveira Message-ID: Date: Mon, 21 Jun 2021 18:14:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210621112528.12aee665@oasis.local.home> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/21/21 5:25 PM, Steven Rostedt wrote: > 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? For example, at the shutdown, should the hotplug callback wait for the workqueue to run & kill the thread, or not? -- Daniel > -- Steve >