bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Hari Bathini <hbathini@linux.ibm.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Cc: Song Liu <songliubraving@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
Subject: Re: [RFC PATCH 0/3] enable bpf_prog_pack allocator for powerpc
Date: Fri, 11 Nov 2022 11:25:35 +0000	[thread overview]
Message-ID: <00efe9b1-d9fd-441c-9eb4-cbf25d82baf2@csgroup.eu> (raw)
In-Reply-To: <20221110184303.393179-1-hbathini@linux.ibm.com>

Le 10/11/2022 à 19:43, Hari Bathini a écrit :
> Most BPF programs are small, but they consume a page each. For systems
> with busy traffic and many BPF programs, this may also add significant
> pressure on instruction TLB. High iTLB pressure usually slows down the
> whole system causing visible performance degradation for production
> workloads.
> 
> bpf_prog_pack, a customized allocator that packs multiple bpf programs
> into preallocated memory chunks, was proposed [1] to address it. This
> series extends this support on powerpc.
> 
> Patches 1 & 2 add the arch specific functions needed to support this
> feature. Patch 3 enables the support for powerpc. The last patch
> ensures cleanup is handled racefully.
> 
> Tested the changes successfully on a PowerVM. patch_instruction(),
> needed for bpf_arch_text_copy(), is failing for ppc32. Debugging it.
> Posting the patches in the meanwhile for feedback on these changes.

I did a quick test on ppc32, I don't get such a problem, only something 
wrong in the dump print as traps intructions only are dumped, but 
tcpdump works as expected:

[   55.692998] bpf_jit_enable = 2 was set! NEVER use this in production, 
only for JIT debugging!
[   66.279259] device eth0 entered promiscuous mode
[   67.214756] Pass 1: shrink = 0, seen = 0x1f980000
[   67.214880] Pass 2: shrink = 0, seen = 0x1f980000
[   67.214966] flen=5 proglen=60 pass=3 image=be7a8038 from=tcpdump pid=459
[   67.225261] JIT code: 00000000: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.233904] JIT code: 00000010: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.242579] JIT code: 00000020: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.249694] JIT code: 00000030: 7f e0 00 08 7f e0 00 08 7f e0 00 08
[   67.259255] Pass 1: shrink = 0, seen = 0x3ff801fe
[   67.259421] Pass 2: shrink = 0, seen = 0x3ff801fe
[   67.259514] flen=40 proglen=504 pass=3 image=be7a80a0 from=tcpdump 
pid=459
[   67.269467] JIT code: 00000000: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.278001] JIT code: 00000010: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.286519] JIT code: 00000020: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.295041] JIT code: 00000030: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.303596] JIT code: 00000040: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.312164] JIT code: 00000050: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.319231] JIT code: 00000060: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.328822] JIT code: 00000070: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.337382] JIT code: 00000080: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.345901] JIT code: 00000090: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.354423] JIT code: 000000a0: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.362941] JIT code: 000000b0: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.371462] JIT code: 000000c0: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.378526] JIT code: 000000d0: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.388120] JIT code: 000000e0: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.396680] JIT code: 000000f0: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.405199] JIT code: 00000100: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.413756] JIT code: 00000110: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.422324] JIT code: 00000120: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.429389] JIT code: 00000130: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.438982] JIT code: 00000140: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.447541] JIT code: 00000150: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.456059] JIT code: 00000160: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.464578] JIT code: 00000170: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.473201] JIT code: 00000180: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.481705] JIT code: 00000190: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.488770] JIT code: 000001a0: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.498359] JIT code: 000001b0: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.506921] JIT code: 000001c0: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.515439] JIT code: 000001d0: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.523998] JIT code: 000001e0: 7f e0 00 08 7f e0 00 08 7f e0 00 08 
7f e0 00 08
[   67.532565] JIT code: 000001f0: 7f e0 00 08 7f e0 00 08
[   82.620898] device eth0 left promiscuous mode


> 
> [1] https://lore.kernel.org/bpf/20220204185742.271030-1-song@kernel.org/
> 
> Hari Bathini (3):
>    powerpc/bpf: implement bpf_arch_text_copy
>    powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack
>    powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free]
> 
>   arch/powerpc/net/bpf_jit.h        |  18 +--
>   arch/powerpc/net/bpf_jit_comp.c   | 194 ++++++++++++++++++++++++------
>   arch/powerpc/net/bpf_jit_comp32.c |  26 ++--
>   arch/powerpc/net/bpf_jit_comp64.c |  32 ++---
>   4 files changed, 198 insertions(+), 72 deletions(-)
> 


  parent reply	other threads:[~2022-11-11 11:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 18:43 [RFC PATCH 0/3] enable bpf_prog_pack allocator for powerpc Hari Bathini
2022-11-10 18:43 ` [RFC PATCH 1/3] powerpc/bpf: implement bpf_arch_text_copy Hari Bathini
2022-11-13 13:17   ` Christophe Leroy
2022-11-14 14:54     ` Hari Bathini
2022-11-10 18:43 ` [RFC PATCH 2/3] powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack Hari Bathini
2022-11-13 18:00   ` Christophe Leroy
2022-11-10 18:43 ` [RFC PATCH 3/3] powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free] Hari Bathini
2022-11-13 18:36   ` Christophe Leroy
2022-11-11 11:25 ` Christophe Leroy [this message]
2022-11-14 14:47   ` [RFC PATCH 0/3] enable bpf_prog_pack allocator for powerpc Hari Bathini
     [not found]     ` <bf0af91e-861c-1608-7150-d31578be9b02@csgroup.eu>
     [not found]       ` <e0266414-843f-db48-a56d-1d8a8944726a@csgroup.eu>
2022-11-16 17:01         ` Hari Bathini
2022-11-16 17:16           ` Christophe Leroy
2022-11-17  6:59           ` Christophe Leroy
2022-11-18  8:39             ` Hari Bathini
2022-11-18  8:51               ` Christophe Leroy
2022-11-18  9:39                 ` Hari Bathini
2022-11-18 11:46                   ` Christophe Leroy
2022-11-18 17:28                     ` Song Liu
2022-11-18 18:05                       ` Christophe Leroy

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=00efe9b1-d9fd-441c-9eb4-cbf25d82baf2@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=hbathini@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=songliubraving@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;
as well as URLs for NNTP newsgroup(s).