netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: David Miller <davem@davemloft.net>
Cc: joe@perches.com, greearb@candelatech.com,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	arnd@arndb.de, netdev@vger.kernel.org
Subject: Re: [patch] net/core/filter.c: Fix build error
Date: Thu, 26 May 2011 21:09:39 +0200	[thread overview]
Message-ID: <20110526190939.GC3476@elte.hu> (raw)
In-Reply-To: <20110526.143843.205897228685761536.davem@davemloft.net>


* David Miller <davem@davemloft.net> wrote:

> From: Joe Perches <joe@perches.com>
> Date: Thu, 26 May 2011 08:31:06 -0700
> 
> > My suggestion would be to see about again adding
> > #include <linux/ratelimit.h> somehow
> > back to kernel.h which commit 3fff4c42bd0a removed
> > in 2009 because of the spinlock issues.
> > 
> > Any suggestion on how best to fix it generically?
> 
> I don't think we want spinlock_t's definition being sucked
> into kernel.h's dependency food chain.

Agreed.

Also, i don't think it's unreasonable to require code that uses 
DEFINE_RATELIMIT_STATE() to #include ratelimit.h. That's what we 
require from DEFINE_MUTEX() and DEFINE_SPINLOCK() users and many 
other users as well.

The only exception is printk_ratelimit() itself - that should not - 
and currently does not - require the inclusion of ratelimit.h.

The *real* solution here would be to remove the spurious and .config 
dependent inclusion of ratelimit.h in include/linux/net.h.  It's fine 
to provide the net_ratelimit() interface (it'sanalogous to 
printk_ratelimit()), but it's not fine to declare net_ratelimit_state 
in that header and include that header in half of all networking 
code, bringing in ratelimit.h implicitly.

So no, i don't think your patch is the real solution. The problem was 
that the .config's you tested had CONFIG_SYSCTL=y, which brought in 
ratelimit.h into half of the networking code. That's unnecessary and 
problematic - the interface between net/core/sysctl_net_core.c and 
net/core/utils.c should be done via a dedicated header (not included 
by other code), or via explicit extern declared in the .c file (more 
dangerous, but used by pretty much all sysctl code in the kernel).

Thanks,

	Ingo

  parent reply	other threads:[~2011-05-26 19:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 18:30 [PATCH] sk-filter: Rate-limit WARNing, print dbg info greearb
2011-05-17 18:52 ` Joe Perches
2011-05-17 19:23   ` David Miller
2011-05-17 19:34     ` Ben Greear
2011-05-17 19:39       ` David Miller
2011-05-17 19:53       ` Joe Perches
     [not found]         ` <4DD2DB9D.6050306@candelatech.com>
2011-05-17 21:13           ` RFC: Add WARN_RATELIMIT to bug.h (was: Re: [PATCH] sk-filter: Rate-limit WARNing, print dbg info.) Joe Perches
2011-05-21 17:48             ` [PATCH 0/2] Add and use WARN_RATELIMIT Joe Perches
2011-05-21 17:48               ` [PATCH 1/2] bug.h: Add WARN_RATELIMIT Joe Perches
2011-05-21 17:48               ` [PATCH 2/2] net: filter: Use WARN_RATELIMIT Joe Perches
2011-05-26 12:31                 ` [patch] net/core/filter.c: Fix build error Ingo Molnar
2011-05-26 15:31                   ` Joe Perches
2011-05-26 18:38                     ` David Miller
2011-05-26 18:57                       ` Randy Dunlap
2011-05-26 19:00                         ` David Miller
2011-05-26 19:07                       ` Joe Perches
2011-05-26 19:09                       ` Ingo Molnar [this message]
2011-05-26 19:12                         ` Ingo Molnar
2011-05-23 21:38               ` [PATCH 0/2] Add and use WARN_RATELIMIT David Miller

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=20110526190939.GC3476@elte.hu \
    --to=mingo@elte.hu \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=greearb@candelatech.com \
    --cc=joe@perches.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).