From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "stable@vger.kernel.org" <stable@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL 4.9 14/62] perf tools: Allow overriding MAX_NR_CPUS at compile time
Date: Sun, 2 Sep 2018 13:14:19 +0000 [thread overview]
Message-ID: <20180902131411.183978-4-alexander.levin@microsoft.com> (raw)
In-Reply-To: <20180902131411.183978-1-alexander.levin@microsoft.com>
From: Christophe Leroy <christophe.leroy@c-s.fr>
[ 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 <christophe.leroy@c-s.fr>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
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 <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
tools/perf/perf.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 9a0236a4cf95..8f8d895d5b74 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -22,7 +22,9 @@ static inline unsigned long long rdclock(void)
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;
--
2.17.1
next prev parent reply other threads:[~2018-09-02 17:30 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-02 13:14 [PATCH AUTOSEL 4.9 11/62] uio: potential double frees if __uio_register_device() fails Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 12/62] tty: rocket: Fix possible buffer overwrite on register_PCI Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 13/62] f2fs: do not set free of current section Sasha Levin
2018-09-02 13:14 ` Sasha Levin [this message]
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 15/62] NFSv4.0 fix client reference leak in callback Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 16/62] fbdev/core: Disable console-lock warnings when fb.lockless_register_fb is set Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 17/62] macintosh/via-pmu: Add missing mmio accessors Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 18/62] ath9k: report tx status on EOSP Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 19/62] ath9k_hw: fix channel maximum power level test Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 20/62] ath10k: prevent active scans on potential unusable channels Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 21/62] wlcore: Set rx_status boottime_ns field on rx Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 22/62] MIPS: Fix ISA virt/bus conversion for non-zero PHYS_OFFSET Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 23/62] ata: libahci: Correct setting of DEVSLP register Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 24/62] scsi: 3ware: fix return 0 on the error path of probe Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 25/62] ath10k: disable bundle mgmt tx completion event support Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 26/62] Bluetooth: hidp: Fix handling of strncpy for hid->name information Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 27/62] x86/mm: Remove in_nmi() warning from vmalloc_fault() Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 28/62] x86/kexec: Allocate 8k PGDs for PTI Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 29/62] gpio: ml-ioh: Fix buffer underwrite on probe error path Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 30/62] net: mvneta: fix mtu change on port without link Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 31/62] f2fs: try grabbing node page lock aggressively in sync scenario Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 32/62] f2fs: fix to skip GC if type in SSA and SIT is inconsistent Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 33/62] tpm_tis_spi: Pass the SPI IRQ down to the driver Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 34/62] tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 35/62] f2fs: fix to do sanity check with reserved blkaddr of inline inode Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 36/62] MIPS: Octeon: add missing of_node_put() Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 37/62] MIPS: generic: fix " Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 38/62] iio: ad9523: Fix return value for ad952x_store() Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 39/62] net: dcb: For wild-card lookups, use priority -1, not 0 Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 40/62] Input: atmel_mxt_ts - only use first T9 instance Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 41/62] iommu/dma: Respect bus DMA limit for IOVAs Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 42/62] media: s5p-mfc: Fix buffer look up in s5p_mfc_handle_frame_{new, copy_time} functions Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 43/62] partitions/aix: append null character to print data from disk Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 44/62] partitions/aix: fix usage of uninitialized lv_info and lvname structures Sasha Levin
2018-09-02 13:14 ` [PATCH AUTOSEL 4.9 45/62] media: helene: fix xtal frequency setting at power on Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 46/62] f2fs: Fix uninitialized return in f2fs_ioc_shutdown() Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 47/62] media: em28xx: Fix DualHD disconnect oops Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 48/62] iommu/ipmmu-vmsa: Fix allocation in atomic context Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 49/62] mfd: ti_am335x_tscadc: Fix struct clk memory leak Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 50/62] f2fs: fix to do sanity check with {sit,nat}_ver_bitmap_bytesize Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 51/62] ALSA: riptide: Properly endian notations Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 52/62] ALSA: wss: Fix sparse warning wrt PCM format type Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 53/62] ALSA: sb: Fix PCM format bit calculation Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 54/62] ALSA: asihpi: Fix PCM format notations Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 55/62] ALSA: ad1816a: Fix sparse warning wrt PCM format type Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 56/62] ALSA: hda: Fix implicit PCM format type conversion Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 57/62] ALSA: au88x0: Fix sparse warning wrt PCM format type Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 58/62] ALSA: sb: " Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 59/62] NFSv4.1: Fix a potential layoutget/layoutrecall deadlock Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 60/62] MIPS: WARN_ON invalid DMA cache maintenance, not BUG_ON Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 61/62] RDMA/cma: Do not ignore net namespace for unbound cm_id Sasha Levin
2018-09-02 13:15 ` [PATCH AUTOSEL 4.9 62/62] fuse: Add missed unlock_page() to fuse_readpages_fill() Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180902131411.183978-4-alexander.levin@microsoft.com \
--to=alexander.levin@microsoft.com \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=christophe.leroy@c-s.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).