BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>, andrii@kernel.org
Cc: acme@redhat.com, ast@kernel.org, daniel@iogearbox.net,
	jolsa@kernel.org, martin.lau@linux.dev, song@kernel.org,
	yonghong.song@linux.dev,  john.fastabend@gmail.com,
	kpsingh@kernel.org, sdf@google.com, haoluo@google.com,
	 mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org,
	mykolal@fb.com,  thinker.li@gmail.com, bentiss@kernel.org,
	tanggeliang@kylinos.cn,  bpf@vger.kernel.org
Subject: Re: [PATCH v2 bpf-next 6/6] selftests/bpf: add kfunc_call test for simple dtor in bpf_testmod
Date: Thu, 20 Jun 2024 04:41:01 -0700	[thread overview]
Message-ID: <b9d80fb01651771108df802afd49748c8976da70.camel@gmail.com> (raw)
In-Reply-To: <20240620091733.1967885-7-alan.maguire@oracle.com>

On Thu, 2024-06-20 at 10:17 +0100, Alan Maguire wrote:

[...]

Hi Alan,

I still get the error message in the dmesg:

[   10.489223] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:337
[   10.489454] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 184, name: test_progs
[   10.489589] preempt_count: 200, expected: 0
[   10.489659] RCU nest depth: 1, expected: 0
[   10.489733] 1 lock held by test_progs/184:
[   10.489811]  #0: ffffffff83198a60 (rcu_read_lock){....}-{1:2}, at: bpf_test_timer_enter+0x1d/0xb0
[   10.490040] Preemption disabled at:
[   10.490060] [<ffffffff81a0ee6a>] bpf_test_run+0x16a/0x300
[   10.490197] CPU: 1 PID: 184 Comm: test_progs Tainted: G           OE      6.10.0-rc2-00766-gb812ab0e1306-dirty #39
[   10.490356] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014
[   10.490475] Call Trace:
[   10.490515]  <TASK>
[   10.490557]  dump_stack_lvl+0x83/0xa0
[   10.490618]  __might_resched+0x199/0x2b0
[   10.490695]  kmalloc_trace_noprof+0x273/0x320
[   10.490756]  ? srso_alias_return_thunk+0x5/0xfbef5
[   10.490836]  ? bpf_test_run+0xc0/0x300
[   10.490836]  ? bpf_testmod_ctx_create+0x23/0x50 [bpf_testmod]
[   10.490836]  bpf_testmod_ctx_create+0x23/0x50 [bpf_testmod]
[   10.490836]  bpf_prog_d1347efc07047347_kfunc_call_ctx+0x2c/0xae
[   10.490836]  bpf_test_run+0x198/0x300
[   10.490836]  ? srso_alias_return_thunk+0x5/0xfbef5
[   10.490836]  ? lockdep_init_map_type+0x4b/0x250
[   10.490836]  bpf_prog_test_run_skb+0x381/0x7f0
[   10.490836]  __sys_bpf+0xc4f/0x2e00
[   10.490836]  ? srso_alias_return_thunk+0x5/0xfbef5
[   10.490836]  ? reacquire_held_locks+0xcf/0x1f0
[   10.490836]  __x64_sys_bpf+0x1e/0x30
[   10.490836]  do_syscall_64+0x68/0x140
[   10.490836]  entry_SYSCALL_64_after_hwframe+0x76/0x7e

The following fix helps:

--- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
+++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
@@ -164,7 +164,7 @@ bpf_testmod_ctx_create(int *err)
 {
        struct bpf_testmod_ctx *ctx;
 
-       ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | GFP_ATOMIC);
+       ctx = kzalloc(sizeof(*ctx), GFP_ATOMIC);
        if (!ctx) {
                *err = -ENOMEM;
                return NULL;

Thanks,
Eduard

[...]

  reply	other threads:[~2024-06-20 11:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20  9:17 [PATCH v2 bpf-next 0/6] bpf: resilient split BTF followups Alan Maguire
2024-06-20  9:17 ` [PATCH v2 bpf-next 1/6] libbpf: BTF relocation followup fixing naming, loop logic Alan Maguire
2024-06-20  9:17 ` [PATCH v2 bpf-next 2/6] module, bpf: store BTF base pointer in struct module Alan Maguire
2024-06-20  9:17 ` [PATCH v2 bpf-next 3/6] libbpf: split field iter code into its own file kernel Alan Maguire
2024-06-20  9:17 ` [PATCH v2 bpf-next 4/6] libbpf,bpf: share BTF relocate-related code with kernel Alan Maguire
2024-06-20  9:17 ` [PATCH v2 bpf-next 5/6] kbuild,bpf: add module-specific pahole flags for distilled base BTF Alan Maguire
2024-06-20  9:17 ` [PATCH v2 bpf-next 6/6] selftests/bpf: add kfunc_call test for simple dtor in bpf_testmod Alan Maguire
2024-06-20 11:41   ` Eduard Zingerman [this message]
2024-06-21 22:00     ` Andrii Nakryiko
2024-06-21 22:10 ` [PATCH v2 bpf-next 0/6] bpf: resilient split BTF followups patchwork-bot+netdevbpf

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=b9d80fb01651771108df802afd49748c8976da70.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=acme@redhat.com \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bentiss@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mykolal@fb.com \
    --cc=nathan@kernel.org \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=tanggeliang@kylinos.cn \
    --cc=thinker.li@gmail.com \
    --cc=yonghong.song@linux.dev \
    /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