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=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 E2E50C2D0E2 for ; Tue, 22 Sep 2020 19:51:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7382420888 for ; Tue, 22 Sep 2020 19:51:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rmA3rbC8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7382420888 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mAD971O4cUuTEHWfOworshhM9+CXlxufhpAyKqYxePE=; b=rmA3rbC8whP3mURJ9t+4Kz4Cw zLllne42X2pHF5Md08qHaJrfKTkE0U5O/RnVFW64x8iuS9Qn+bk1nJ/74BwOyEVrUMRa5fFsJx4Gr MZfxUAfDnKeMh8vq/3mt+R2/2Yveocz88x8Y1JJPJQTLkbUgUhlq3enfQmwM4Dx9EYlEw9/Qu0kIi zrU/EV0oU5THiezo5xd0Yell8mi4IwUsf3N4BXE5mxn0RYEZsHVQ11mQK8rsdmkuymixhoQoyIUBF YtYO8gH+VkwzfXHnO8VNzvGAbpO1RfnAL0TDw8hbODrctm92twsz9/Tvbze4ueDQjwbyBAvXddqZJ zVy1U8GzA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKoJE-0006vB-Rf; Tue, 22 Sep 2020 19:50:40 +0000 Received: from mga09.intel.com ([134.134.136.24]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKoJB-0006th-38 for linux-arm-kernel@lists.infradead.org; Tue, 22 Sep 2020 19:50:37 +0000 IronPort-SDR: JSGb8Uenp/EXcwJNPEizTw3tGoPGPvakeJZUjYmpdn5RczAWbRtXyz/+pUko+Id9DvSIF+f+vr 4EieJklyElQQ== X-IronPort-AV: E=McAfee;i="6000,8403,9752"; a="161634465" X-IronPort-AV: E=Sophos;i="5.77,291,1596524400"; d="scan'208";a="161634465" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2020 12:50:35 -0700 IronPort-SDR: 5Zp3q7bqiagXrW4yXDtHWAo51m8BHS/JEsCqhw7KJSPsSoW8cYjsLPjvGoTR0UQ7o79MSH5dS2 +iq1S16j2z/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,291,1596524400"; d="scan'208";a="291411874" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.54.74.11]) by fmsmga008.fm.intel.com with ESMTP; 22 Sep 2020 12:50:35 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 4B453301C71; Tue, 22 Sep 2020 12:50:35 -0700 (PDT) Date: Tue, 22 Sep 2020 12:50:35 -0700 From: Andi Kleen To: Wei Li Subject: Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events Message-ID: <20200922195035.GA42577@tassilo.jf.intel.com> References: <20200922031346.15051-1-liwei391@huawei.com> <20200922031346.15051-2-liwei391@huawei.com> <20200922192321.GL13818@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200922192321.GL13818@tassilo.jf.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_155037_255361_31829089 X-CRM114-Status: GOOD ( 18.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Alexander Shishkin , Alexey Budankov , Adrian Hunter , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , huawei.libin@huawei.com, Namhyung Kim , Jiri Olsa , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 22, 2020 at 12:23:21PM -0700, Andi Kleen wrote: > > After debugging, i found the root reason is that the xyarray fd is created > > by evsel__open_per_thread() ignoring the cpu passed in > > create_perf_stat_counter(), while the evsel' cpumap is assigned as the > > corresponding PMU's cpumap in __add_event(). Thus, the xyarray fd is created > > with ncpus of dummy cpumap and an out of bounds 'cpu' index will be used in > > perf_evsel__close_fd_cpu(). > > > > To address this, add a flag to mark this situation and avoid using the > > affinity technique when closing/enabling/disabling events. > > The flag seems like a hack. How about figuring out the correct number of > CPUs and using that? Also would like to understand what's different on ARM64 than other architectures. Or could this happen on x86 too? -Andi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel