Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4535563imm; Mon, 17 Sep 2018 16:03:33 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYWSaFU7cTPluo671Cgi4VQZgA+USEhqy6o2TuU/+nvKi18cY6ZWLQyKuJtpoRheLQdXtuR X-Received: by 2002:a63:4a09:: with SMTP id x9-v6mr24341610pga.34.1537225413430; Mon, 17 Sep 2018 16:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537225413; cv=none; d=google.com; s=arc-20160816; b=SgfwF4kiEsNTr6MGG+xf+rfvH/kw9rn66AVAywDxt0yX1m/EQASF+UVkObnAwZPPKX QwL1G5VUgfI1jkiRmYeahEH8RxtVCdEroZli7WPf9M7VcKcA027CS/Xf4yrPMr4nwoxQ 4XjzxxfuUel+wVP/T3+VWEfsrx2BAqZnG3LqFsmVsR4MXsSE8TEm45CDh6GyQA5Ml+Uv NG2RO01o0nEZJvetNP8EtdHe4itdlRKrX89ivgPuXw7ctLYOcEk9avXMUWXBDNHOkiQS vnNewWpQA/oGZtrSo1N8Fdhypy8w73IJpHvDb4pvfQ4EprTaLMGaLz8ic+o36zFtQ4x+ WdaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=dpnIxXIfjsrF+yTtVe+VaazxbisRKbYRhoiqq1ukWb4=; b=n2/nhmTyza18ayCXQR2p0fGvtrjkudc/jjWe8YZH2C7cNFx5Ka9eWBJpQub9D7XTXd oH0mbI9SBFHkn34D+pia0ssvZujF9OdGDQRIbhCK/GSDe3YVxYC7opMtoMerqv2WD5Aa eve8PPZlCad8Vqo35Kob3SDXi/T2HI2Y7/WVv0Q73Wm/hbjGkrznZRxyAn87R+kFhsqz culegWPZA4JJqJSK4SNI827sEk3CXUfmCuUouN7ylB/8FPp3/qROY6jaxp/PX7JgZN0o IryyTp4IO1S0QIraVgvxCafx5UES+vn7oZEfHg0PvlG8FXRo+bAhrMJGNa/eE6VhBGR7 Unow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64-v6si15765625plk.257.2018.09.17.16.03.17; Mon, 17 Sep 2018 16:03:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730518AbeIREc2 (ORCPT + 99 others); Tue, 18 Sep 2018 00:32:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48646 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726987AbeIREc1 (ORCPT ); Tue, 18 Sep 2018 00:32:27 -0400 Received: from localhost (li1825-44.members.linode.com [172.104.248.44]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5D58FC49; Mon, 17 Sep 2018 23:02:58 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Alexander Shishkin , Peter Zijlstra , linuxppc-dev@lists.ozlabs.org, Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.14 046/126] perf tools: Allow overriding MAX_NR_CPUS at compile time Date: Tue, 18 Sep 2018 00:41:34 +0200 Message-Id: <20180917211707.646988170@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180917211703.481236999@linuxfoundation.org> References: <20180917211703.481236999@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe Leroy [ Upstream commit 21b8732eb4479b579bda9ee38e62b2c312c2a0e5 ] After update of kernel, the perf tool doesn't run anymore on my 32MB RAM powerpc board, but still runs on a 128MB RAM board: ~# strace perf execve("/usr/sbin/perf", ["perf"], [/* 12 vars */]) = -1 ENOMEM (Cannot allocate memory) --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0} --- +++ killed by SIGSEGV +++ Segmentation fault objdump -x shows that .bss section has a huge size of 24Mbytes: 27 .bss 016baca8 101cebb8 101cebb8 001cd988 2**3 With especially the following objects having quite big size: 10205f80 l O .bss 00140000 runtime_cycles_stats 10345f80 l O .bss 00140000 runtime_stalled_cycles_front_stats 10485f80 l O .bss 00140000 runtime_stalled_cycles_back_stats 105c5f80 l O .bss 00140000 runtime_branches_stats 10705f80 l O .bss 00140000 runtime_cacherefs_stats 10845f80 l O .bss 00140000 runtime_l1_dcache_stats 10985f80 l O .bss 00140000 runtime_l1_icache_stats 10ac5f80 l O .bss 00140000 runtime_ll_cache_stats 10c05f80 l O .bss 00140000 runtime_itlb_cache_stats 10d45f80 l O .bss 00140000 runtime_dtlb_cache_stats 10e85f80 l O .bss 00140000 runtime_cycles_in_tx_stats 10fc5f80 l O .bss 00140000 runtime_transaction_stats 11105f80 l O .bss 00140000 runtime_elision_stats 11245f80 l O .bss 00140000 runtime_topdown_total_slots 11385f80 l O .bss 00140000 runtime_topdown_slots_retired 114c5f80 l O .bss 00140000 runtime_topdown_slots_issued 11605f80 l O .bss 00140000 runtime_topdown_fetch_bubbles 11745f80 l O .bss 00140000 runtime_topdown_recovery_bubbles This is due to commit 4d255766d28b1 ("perf: Bump max number of cpus to 1024"), because many tables are sized with MAX_NR_CPUS This patch gives the opportunity to redefine MAX_NR_CPUS via $ make EXTRA_CFLAGS=-DMAX_NR_CPUS=1 Signed-off-by: Christophe Leroy Cc: Alexander Shishkin Cc: Peter Zijlstra Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/20170922112043.8349468C57@po15668-vm-win7.idsi0.si.c-s.fr Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/perf/perf.h | 2 ++ 1 file changed, 2 insertions(+) --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -24,7 +24,9 @@ static inline unsigned long long rdclock return ts.tv_sec * 1000000000ULL + ts.tv_nsec; } +#ifndef MAX_NR_CPUS #define MAX_NR_CPUS 1024 +#endif extern const char *input_name; extern bool perf_host, perf_guest;