BPF List
 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: "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	Song Liu <songliubraving@fb.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Subject: Re: [RFC PATCH 0/3] enable bpf_prog_pack allocator for powerpc
Date: Fri, 18 Nov 2022 08:51:31 +0000	[thread overview]
Message-ID: <c651bd44-d0ca-e3cf-0639-6b42b33f4666@csgroup.eu> (raw)
In-Reply-To: <9d5c390a-31db-4f93-203d-281b0831d37f@linux.ibm.com>



Le 18/11/2022 à 09:39, Hari Bathini a écrit :
> 
> 
> On 17/11/22 12:29 pm, Christophe Leroy wrote:
>>
>>
>> Le 16/11/2022 à 18:01, Hari Bathini a écrit :
>>>
>>>
>>> On 16/11/22 12:14 am, Christophe Leroy wrote:
>>>>
>>>>
>>>> Le 14/11/2022 à 18:27, Christophe Leroy a écrit :
>>>>>
>>>>>
>>>>> Le 14/11/2022 à 15:47, Hari Bathini a écrit :
>>>>>> Hi Christophe,
>>>>>>
>>>>>> On 11/11/22 4:55 pm, Christophe Leroy wrote:
>>>>>>> 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:
>>>>>>
>>>>>> Thanks for the quick test. Could you please share the config you 
>>>>>> used.
>>>>>> I am probably missing a few knobs in my conifg...
>>>>>>
>>>>>
>>>>
>>>> I also managed to test it on QEMU. The config is based on
>>>> pmac32_defconfig.
>>>
>>> I had the same config but hit this problem:
>>>
>>>       # echo 1 > /proc/sys/net/core/bpf_jit_enable; modprobe test_bpf
>>>       test_bpf: #0 TAX
>>>       ------------[ cut here ]------------
>>>       WARNING: CPU: 0 PID: 96 at arch/powerpc/net/bpf_jit_comp.c:367
>>> bpf_int_jit_compile+0x8a0/0x9f8
>>
>> I get no such problem, on QEMU, and I checked the .config has:
> 
>> CONFIG_STRICT_KERNEL_RWX=y
>> CONFIG_STRICT_MODULE_RWX=y
> 
> Yeah. That did the trick.

Interesting. I guess we have to find out why it fails when those config 
are missing.

Maybe module code plays with RO and NX flags even if 
CONFIG_STRICT_MODULE_RWX is not selected ?

Christophe

  reply	other threads:[~2022-11-18  8:51 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 ` [RFC PATCH 0/3] enable bpf_prog_pack allocator for powerpc Christophe Leroy
2022-11-14 14:47   ` 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 [this message]
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=c651bd44-d0ca-e3cf-0639-6b42b33f4666@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