From: Song Liu <songliubraving@fb.com>
To: Alexei Starovoitov <ast@fb.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"ast@kernel.org" <ast@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Kernel Team <Kernel-team@fb.com>,
"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
Teng Qin <qinteng@fb.com>
Subject: Re: [PATCH bpf-next v4 1/2] bpf: extend stackmap to save binary_build_id+offset instead of address
Date: Tue, 13 Mar 2018 21:31:24 +0000 [thread overview]
Message-ID: <671059DC-FFD4-45E5-BB75-36A582711240@fb.com> (raw)
In-Reply-To: <C1507E62-2E3B-41A7-9C17-36CF86D8674B@fb.com>
> On Mar 12, 2018, at 3:47 PM, Song Liu <songliubraving@fb.com> wrote:
>
>
>
>> On Mar 12, 2018, at 2:31 PM, Alexei Starovoitov <ast@fb.com> wrote:
>>
>> On 3/12/18 2:12 PM, Song Liu wrote:
>>>
>>>> On Mar 12, 2018, at 2:00 PM, Alexei Starovoitov <ast@fb.com> wrote:
>>>>
>>>> On 3/12/18 1:39 PM, Song Liu wrote:
>>>>> + page = find_get_page(vma->vm_file->f_mapping, 0);
>>>>
>>>> did you test it with config_debug_atomic_sleep ?
>>>> it should have complained...
>>>
>>> Yeah, I have CONFIG_DEBUG_ATOMIC_SLEEP=y.
>>>
>>> I think find_get_page() will not sleep. The variation find_get_page_flags()
>>> may sleep with flag FGP_CREAT.
>>
>> I see. gfp_mask == 0 and no locks. should work indeed.
>> curious how perf report looks like for heavy bpf_get_stackid() usage?
>
> I modified samples/bpf/sampleip to only call bpf_get_stackid(). The following
> is captured with bpf_get_stackid() called at 10k Hz. stressapptest is running
> with 16 threads on a system with 56 cores.
>
>
> Samples: 1M of event 'cycles:pp', Event count (approx.): 628092326243
> Overhead Command Shared Object Symbol
> + 51.61% stressapptest stressapptest [.] AdlerMemcpyC
> - 20.82% stressapptest [kernel.vmlinux] [k] queued_spin_lock_slowpath
> - queued_spin_lock_slowpath
> - 20.80% pcpu_freelist_pop
> bpf_get_stackid
> bpf_get_stackid_tp
> - 0x590c
> 16.12% AdlerMemcpyC
> 4.50% OsLayer::CpuStressWorkload
> + 14.36% stressapptest stressapptest [.] OsLayer::CpuStressWorkload
> - 8.74% stressapptest [kernel.vmlinux] [k] _raw_spin_lock
> - _raw_spin_lock
> - 8.73% bpf_get_stackid
> bpf_get_stackid_tp
> + 0x590c
> - 0.67% stressapptest [kernel.vmlinux] [k] pcpu_freelist_pop
> - pcpu_freelist_pop
> - 0.67% bpf_get_stackid
> bpf_get_stackid_tp
> + 0x590c
>
> Seems lock contention is the dominating overhead here. This should be the same
> for original stackmap.
>
> Song
Samples: 172K of event 'cycles:pp', Event count (approx.): 102311012653
Overhead Command Shared Object Symbol
78.84% stressapptest stressapptest [.] AdlerMemcpyC
8.78% stressapptest stressapptest [.] OsLayer::CpuStressWorkload
3.14% stressapptest [kernel.vmlinux] [k] _raw_spin_lock
2.56% stressapptest stressapptest [.] WorkerThread::FillPage
0.45% stressapptest [kernel.vmlinux] [k] perf_callchain_user
0.37% stressapptest [kernel.vmlinux] [.] native_irq_return_iret
0.31% stressapptest [kernel.vmlinux] [k] clear_page_erms
0.29% stressapptest [kernel.vmlinux] [k] pcpu_freelist_pop
0.27% stressapptest stressapptest [.] CalculateAdlerChecksum
0.25% stressapptest [kernel.vmlinux] [k] bpf_get_stackid
0.22% swapper [kernel.vmlinux] [k] poll_idle
This perf output is taken with stressapptest running on 4 cores.
bpf_get_stackid() and pcps_free_list_pop combined about 0.54% of CPU.
Song
next prev parent reply other threads:[~2018-03-13 21:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-12 20:39 [PATCH bpf-next v4 0/2] bpf stackmap with build_id+offset Song Liu
2018-03-12 20:39 ` [PATCH bpf-next v4 1/2] bpf: extend stackmap to save binary_build_id+offset instead of address Song Liu
2018-03-12 21:00 ` Alexei Starovoitov
2018-03-12 21:12 ` Song Liu
2018-03-12 21:31 ` Alexei Starovoitov
2018-03-12 22:47 ` Song Liu
2018-03-13 21:31 ` Song Liu [this message]
2018-03-12 22:01 ` Peter Zijlstra
2018-04-24 0:06 ` Yonghong Song
2018-03-13 9:53 ` [PATCH] bpf: fix semicolon.cocci warnings kbuild test robot
2018-03-13 9:53 ` [PATCH bpf-next v4 1/2] bpf: extend stackmap to save binary_build_id+offset instead of address kbuild test robot
2018-03-12 20:39 ` [PATCH bpf-next v4 2/2] bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID Song Liu
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=671059DC-FFD4-45E5-BB75-36A582711240@fb.com \
--to=songliubraving@fb.com \
--cc=Kernel-team@fb.com \
--cc=ast@fb.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=hannes@cmpxchg.org \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=qinteng@fb.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