Netdev List
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	"arnd@arndb.de" <arnd@arndb.de>
Cc: Matt Mullins <mmullins@fb.com>, Song Liu <songliubraving@fb.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"ast@kernel.org" <ast@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Martin Lau" <kafai@fb.com>, Andrii Nakryiko <andriin@fb.com>
Subject: Re: [PATCH] bpf: hide do_bpf_send_signal when unused
Date: Mon, 24 Jun 2019 20:37:50 +0000	[thread overview]
Message-ID: <07dafa45-4141-2559-43ae-a0c80624426b@fb.com> (raw)
In-Reply-To: <20190617201850.010a4cf6@gandalf.local.home>



On 6/17/19 5:18 PM, Steven Rostedt wrote:
> On Mon, 17 Jun 2019 16:27:33 -0700
> Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> 
>> On Mon, Jun 17, 2019 at 4:13 PM Matt Mullins <mmullins@fb.com> wrote:
>>>>
>>>> The bug (really just a warning) reported is exactly here.
>>>
>>> I don't think bpf_send_signal is tied to modules at all;
>>> send_signal_irq_work_init and the corresponding initcall should be
>>> moved outside that #ifdef.
>>
>> right. I guess send_signal_irq_work_init was accidentally placed
>> after bpf_event_init and happened to be within that ifdef.
>> Should definitely be outside.
> 
> So Arnd did find a bug. Just the wrong solution ;-)
> 
> -- Steve

Hi, Arnd,

The following change can fix the issue.

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index c102c240bb0b..ca1255d14576 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -1431,6 +1431,20 @@ int bpf_get_perf_event_info(const struct 
perf_event *event, u32 *prog_id,
         return err;
  }

+static int __init send_signal_irq_work_init(void)
+{
+       int cpu;
+       struct send_signal_irq_work *work;
+
+       for_each_possible_cpu(cpu) {
+               work = per_cpu_ptr(&send_signal_work, cpu);
+               init_irq_work(&work->irq_work, do_bpf_send_signal);
+       }
+       return 0;
+}
+
+subsys_initcall(send_signal_irq_work_init);
+
  #ifdef CONFIG_MODULES
  static int bpf_event_notify(struct notifier_block *nb, unsigned long op,
                             void *module)
@@ -1478,18 +1492,5 @@ static int __init bpf_event_init(void)
         return 0;
  }

-static int __init send_signal_irq_work_init(void)
-{
-       int cpu;
-       struct send_signal_irq_work *work;
-
-       for_each_possible_cpu(cpu) {
-               work = per_cpu_ptr(&send_signal_work, cpu);
-               init_irq_work(&work->irq_work, do_bpf_send_signal);
-       }
-       return 0;
-}
-
  fs_initcall(bpf_event_init);
-subsys_initcall(send_signal_irq_work_init);
  #endif /* CONFIG_MODULES */

Could you submit a new revision? Thanks!

Yonghong

      reply	other threads:[~2019-06-24 20:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 12:57 [PATCH] bpf: hide do_bpf_send_signal when unused Arnd Bergmann
2019-06-17 15:26 ` Alexei Starovoitov
2019-06-17 23:09   ` Steven Rostedt
2019-06-17 23:13     ` Matt Mullins
2019-06-17 23:27       ` Alexei Starovoitov
2019-06-18  0:18         ` Steven Rostedt
2019-06-24 20:37           ` Yonghong Song [this message]

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=07dafa45-4141-2559-43ae-a0c80624426b@fb.com \
    --to=yhs@fb.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andriin@fb.com \
    --cc=arnd@arndb.de \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kafai@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mmullins@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --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