From: Peter Zijlstra <peterz@infradead.org>
To: Zhipeng Xie <xiezhipeng1@huawei.com>
Cc: mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@redhat.com,
namhyung@kernel.org, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org, xiexiuqi@huawei.com,
fanwentao@huawei.com
Subject: Re: [PATCH v2] perf/core: Fix perf_mmap fail when CONFIG_PERF_USE_VMALLOC enabled
Date: Thu, 14 Apr 2022 17:16:05 +0200 [thread overview]
Message-ID: <Ylg6tU5d9JA/2anr@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20220209145417.6495-1-xiezhipeng1@huawei.com>
On Wed, Feb 09, 2022 at 09:54:17AM -0500, Zhipeng Xie wrote:
> This problem can be reproduced with CONFIG_PERF_USE_VMALLOC enabled on both
> x86_64 and aarch64 arch when using sysdig -B(using ebpf)[1].
> sysdig -B works fine after rebuilding the kernel with CONFIG_PERF_USE_VMALLOC
> disabled.
>
> I tracked it down to the if condition event->rb->nr_pages != nr_pages in
> perf_mmap is true when CONFIG_PERF_USE_VMALLOC is enabled where
> event->rb->nr_pages = 1 and nr_pages = 2048 resulting perf_mmap to return
> -EINVAL.This is because when CONFIG_PERF_USE_VMALLOC is enabled, rb->nr_pages
> is always equal to 1.
>
> Arch with CONFIG_PERF_USE_VMALLOC enabled by default:
> arc/arm/csky/mips/sh/sparc/xtensa
> Arch with CONFIG_PERF_USE_VMALLOC disabled by default:
> x86_64/aarch64/...
>
> Fix this problem by using data_page_nr.
>
> [1] https://github.com/draios/sysdig
>
> Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
Right; sorry for being tardy. Fix looks ok, but I tihnk it needs:
Fixes: 906010b2134e ("perf_event: Provide vmalloc() based mmap() backing")
Will go queue.
next prev parent reply other threads:[~2022-04-14 15:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 14:54 Zhipeng Xie
2022-02-16 16:54 ` PING: " Zhipeng Xie
2022-03-18 1:19 ` Zhipeng Xie
2022-04-14 15:16 ` Peter Zijlstra [this message]
2022-04-19 19:34 ` [tip: perf/urgent] " tip-bot2 for Zhipeng Xie
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=Ylg6tU5d9JA/2anr@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=fanwentao@huawei.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=xiexiuqi@huawei.com \
--cc=xiezhipeng1@huawei.com \
/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
all inboxes | Powered by JetHome®