Netdev List
 help / color / mirror / Atom feed
From: Matt Mullins <mmullins@fb.com>
To: "alexei.starovoitov@gmail.com" <alexei.starovoitov@gmail.com>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>
Cc: 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>, Yonghong Song <yhs@fb.com>,
	"arnd@arndb.de" <arnd@arndb.de>, Andrii Nakryiko <andriin@fb.com>
Subject: Re: [PATCH] bpf: hide do_bpf_send_signal when unused
Date: Mon, 17 Jun 2019 23:13:03 +0000	[thread overview]
Message-ID: <75e9ff40e1002ad9c82716dfd77966a3721022b6.camel@fb.com> (raw)
In-Reply-To: <20190617190920.71c21a6c@gandalf.local.home>

On Mon, 2019-06-17 at 19:09 -0400, Steven Rostedt wrote:
> On Mon, 17 Jun 2019 08:26:29 -0700
> Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> 
> > On Mon, Jun 17, 2019 at 5:59 AM Arnd Bergmann <arnd@arndb.de> wrote:
> > > 
> > > When CONFIG_MODULES is disabled, this function is never called:
> > > 
> > > kernel/trace/bpf_trace.c:581:13: error: 'do_bpf_send_signal' defined but not used [-Werror=unused-function]  
> > 
> > hmm. it should work just fine without modules.
> > the bug is somewhere else.
> 
> From what I see, the only use of do_bpf_send_signal is within a
> #ifdef CONFIG_MODULES, which means that you will get a warning about a
> static unused when CONFIG_MODULES is not defined.
> 
> In kernel/trace/bpf_trace.c we have:
> 
> static void do_bpf_send_signal(struct irq_work *entry)
> 
> [..]
> 
> #ifdef CONFIG_MODULES
> 
> [..]
> 
>         for_each_possible_cpu(cpu) {
>                 work = per_cpu_ptr(&send_signal_work, cpu);
>                 init_irq_work(&work->irq_work, do_bpf_send_signal);  <-- on use of do_bpf_send_signal
>         }
> [..]
> #endif /* CONFIG_MODULES */
> 
> 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.

> 
> -- Steve

  reply	other threads:[~2019-06-17 23:14 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 [this message]
2019-06-17 23:27       ` Alexei Starovoitov
2019-06-18  0:18         ` Steven Rostedt
2019-06-24 20:37           ` Yonghong Song

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=75e9ff40e1002ad9c82716dfd77966a3721022b6.camel@fb.com \
    --to=mmullins@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=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@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