Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp252436pxy; Wed, 21 Apr 2021 02:03:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAdJwTBYDqNkCP55ehqgr3K56WNXp55AcYBsUdMsCzZV8SK0yJqvanflU934sREnc4jI0T X-Received: by 2002:a63:5c0e:: with SMTP id q14mr21605851pgb.441.1618995816933; Wed, 21 Apr 2021 02:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618995816; cv=none; d=google.com; s=arc-20160816; b=ZF/mCgFLbTINrMvvs1s/V5jNr5UIj4ABhl3ZidAxNcpmAKQSdFEqWzMrbfduHhOhC3 YWrxiJAXoyEM5b40JPIqOpMBUDnW+nstcP3oMqUnjzGKtFo2dV66pou/oeEova5gi51x o9VduvvnQRD/Zm7MpvuoMg6C6ftWJTV4WYNvIItLEbUcyMeUKoQDmK3zFagGW4CvI8lh xSjuniKt8ZwY5y5IpMxnxVErB991eT7w2ZhcusFDYmkCrmyEoVq1uwumcKVVxYdU1LuJ iIPx8pz3HU7ninQpU6D1EWQ7HRdY0V9uBc8K5tm92Om8UWJZK4DKVT9rfoGGYVnWFOAx c2Yg== 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:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=qpo+Dvv7Av6TFfLhPQuukt9eYdPwZE+kB1F1iSqfKJQ=; b=mwipUm44AC/QGyxHk6y1q3JI3sUtK125tfBJDuMmG8p34AhfWaIJh3hcyGV7jZ1hdN xHXNJE2SYjve4eeEiwojm77iDHNQgIee4MEW7+3Y35q9Yq/SfIkWUvGQFLDEs9mNImjc AbrNgdI7KaSPP73EIaZVMsAevqdeeG8tU/DEJj4ghNdQ51syIg7LoYtIPct4Yh/wbkyQ ZtpkW187EfHukLtOTX2YUsQPMIjgyfWGXuzWzBbENNEg77IzJxkGZmoMWeabPw30TYNl 3y//etDLek6n1biYMZDCdfxwoFczG3c3yuGt2Ac2+PC0eljYk036s9VyTQK8vqBRbf2V xXRA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si2168381pjo.145.2021.04.21.02.03.24; Wed, 21 Apr 2021 02:03:36 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234149AbhDUItO (ORCPT + 99 others); Wed, 21 Apr 2021 04:49:14 -0400 Received: from mga04.intel.com ([192.55.52.120]:22710 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232140AbhDUItN (ORCPT ); Wed, 21 Apr 2021 04:49:13 -0400 IronPort-SDR: OKRyT04GN3A8vSTpdoHCTHkRfVTawfR5C9apMewOsNtS0rIDLzFidupauy55IQrhhxr11ViCEC 4ERu3a+tyWtQ== X-IronPort-AV: E=McAfee;i="6200,9189,9960"; a="193542248" X-IronPort-AV: E=Sophos;i="5.82,238,1613462400"; d="scan'208";a="193542248" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 01:48:40 -0700 IronPort-SDR: 3+2uj8P/4vfssUQJyAj8EaXG2WVKt9KTA9rmr5r+g3XFXu/gmfT/uHWC2kqKso/MNMAYUhlA8Y IAuPa04WE9UA== X-IronPort-AV: E=Sophos;i="5.82,238,1613462400"; d="scan'208";a="420907869" Received: from likexu-mobl1.ccr.corp.intel.com (HELO [10.238.4.93]) ([10.238.4.93]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 01:48:37 -0700 Subject: Re: [PATCH RESEND 2/2] perf/x86/lbr: Move cpuc->lbr_xsave allocation out of sleeping region To: Peter Zijlstra Cc: Kan Liang , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org References: <20210421021825.37872-1-like.xu@linux.intel.com> <20210421021825.37872-2-like.xu@linux.intel.com> From: Like Xu Organization: Intel OTC Message-ID: <13fd7ac4-46fd-3fa7-0e80-3f46cfc8edac@linux.intel.com> Date: Wed, 21 Apr 2021 16:48:36 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On 2021/4/21 16:38, Peter Zijlstra wrote: > On Wed, Apr 21, 2021 at 10:18:25AM +0800, Like Xu wrote: >> -int x86_reserve_hardware(void) >> +int x86_reserve_hardware(struct perf_event *event) >> { >> int err = 0; >> >> @@ -398,8 +398,10 @@ int x86_reserve_hardware(void) >> if (atomic_read(&pmc_refcount) == 0) { >> if (!reserve_pmc_hardware()) >> err = -EBUSY; >> - else >> + else { >> reserve_ds_buffers(); >> + reserve_lbr_buffers(event); >> + } >> } >> if (!err) >> atomic_inc(&pmc_refcount); >> @@ -650,7 +652,7 @@ static int __x86_pmu_event_init(struct perf_event *event) >> if (!x86_pmu_initialized()) >> return -ENODEV; >> >> - err = x86_reserve_hardware(); >> + err = x86_reserve_hardware(event); >> if (err) >> return err; >> > > This is still complete garbage.. Hhh,thanks for your comment! So do we have a better idea to alloc cpuc->lbr_xsave to avoid this kind of call trace ? >