Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp786461rdb; Tue, 15 Aug 2023 11:53:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1D8h/vyyfPACJwMI8wnrLvUcJuq58dCyt0iHkVzpLTzHPrfOwCgScp3U8Sg7knAUlAEd8 X-Received: by 2002:a05:6808:2986:b0:3a3:ed41:97d with SMTP id ex6-20020a056808298600b003a3ed41097dmr12072660oib.50.1692125592668; Tue, 15 Aug 2023 11:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692125592; cv=none; d=google.com; s=arc-20160816; b=qlFY+yThmr2+v4BtUrTaLXTatLfxCek8OkQDYpyLXSaBLMOvGYp4izAn2OPhXQpNRD cEAAQINV9jXO9ztwwEzsSQd6euPEL3cAKGbkP+ZNXLfd5A1Fn90zT2yYWZQIgdg/V92v 4tM/yuo+XKWSnraOVtbAPmlNGsB8qX04jfFSylek142DIYZCJRSLDa1nK1XyLr+iQt2V 68ehUZPYmiO+XNOjeRRa5MDKBkwKF5nz9Kkykt0aoFJ/1NyGbYG6nBFxmnJFmGLUdFEf G6MEl62nt5KMF6ig5Aqc9ZBvfuw0c81i+o46PWbkw9F+n1xjxSNwvYBLXDozUDfXdMbF kzGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=t0Y1Xk+m71OwYc+K/l33L23rCYggVYs+BLc3xCFSa8k=; fh=PE+xOD/RIUhSglwkt94Q2A1yarXv7O8YGPGyZU4IDL8=; b=rw145Tbe53FjY9FZXO+l0XPq1Z33glqhfjwWs3rOvtF69KAQLdDY3dK9Nk/cjWA+wt 1BQ2tATSzYSVs9Uj1+jsUbcGlkh5/rVenQKsv04TqMVrRlJoRFXREnV6K674PDY1tiQE FaCOtaLaAk+sYh/S0LCz/Zp3JsOF6CmR/o897QSyYYo2wvXF/ZKVZLqgLCVfyu/BxY0r 1Lbndxyeocq/TdlxlVl88eGFSU7Bx86v5d5jdlTOYbQviiWWuyTMmkxxg/weS1fJRnYr KF0/o2wjyBoZbY/hiaw+68dxywrG1VlopWNm/6+vJVhbY92g1dmtVu5lbe2k50zmrSdK zLKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o16-20020a634e50000000b005648d3f2031si9905471pgl.362.2023.08.15.11.52.52; Tue, 15 Aug 2023 11:53:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236636AbjHOLDO (ORCPT + 99 others); Tue, 15 Aug 2023 07:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236573AbjHOLCu (ORCPT ); Tue, 15 Aug 2023 07:02:50 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51089198E for ; Tue, 15 Aug 2023 04:02:48 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RQ7Yt6YG2zNmsj; Tue, 15 Aug 2023 18:59:14 +0800 (CST) Received: from [10.67.102.169] (10.67.102.169) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 15 Aug 2023 19:02:45 +0800 Subject: Re: [PATCH] drivers/perf: hisi: Schedule perf session according to locality To: Will Deacon CC: , , , , , , References: <20230808125147.2080-1-yangyicong@huawei.com> <20230811111414.GC6993@willie-the-truck> From: Yicong Yang Message-ID: <8b3ea6aa-2751-9612-4b91-82640e8dde0f@huawei.com> Date: Tue, 15 Aug 2023 19:02:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20230811111414.GC6993@willie-the-truck> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.169] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/8/11 19:14, Will Deacon wrote: > On Tue, Aug 08, 2023 at 08:51:47PM +0800, Yicong Yang wrote: >> From: Yicong Yang >> >> The PCIe PMUs locate on different NUMA node but currently we don't >> consider it and likely stack all the sessions on the same CPU: >> >> [root@localhost tmp]# cat /sys/devices/hisi_pcie*/cpumask >> 0 >> 0 >> 0 >> 0 >> 0 >> 0 >> >> This can be optimize a bit to use a local CPU for the PMU. >> >> Signed-off-by: Yicong Yang >> --- >> drivers/perf/hisilicon/hisi_pcie_pmu.c | 15 ++++++++++++--- >> 1 file changed, 12 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/perf/hisilicon/hisi_pcie_pmu.c b/drivers/perf/hisilicon/hisi_pcie_pmu.c >> index e10fc7cb9493..60ecf469782b 100644 >> --- a/drivers/perf/hisilicon/hisi_pcie_pmu.c >> +++ b/drivers/perf/hisilicon/hisi_pcie_pmu.c >> @@ -665,7 +665,7 @@ static int hisi_pcie_pmu_online_cpu(unsigned int cpu, struct hlist_node *node) >> struct hisi_pcie_pmu *pcie_pmu = hlist_entry_safe(node, struct hisi_pcie_pmu, node); >> >> if (pcie_pmu->on_cpu == -1) { >> - pcie_pmu->on_cpu = cpu; >> + pcie_pmu->on_cpu = cpumask_local_spread(0, dev_to_node(&pcie_pmu->pdev->dev)); >> WARN_ON(irq_set_affinity(pcie_pmu->irq, cpumask_of(cpu))); > > Hmm, this is a bit weird now, because the interrupt is affine to a different > CPU from the one you've chosen. Are you sure that's ok? When the offline > notifier picks a new target, it moves the irq as well. > Thanks for pointing it out. This is indeed a problem. Will fix this. Thanks.