From: Eric Dumazet <dada1@cosmosbay.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
David Miller <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] NET : convert IP route cache garbage colleciton from softirq processing to a workqueue
Date: Wed, 12 Sep 2007 12:18:30 +0200 [thread overview]
Message-ID: <20070912121830.4d2e3940.dada1@cosmosbay.com> (raw)
In-Reply-To: <20070912100054.GA3649@infradead.org>
On Wed, 12 Sep 2007 11:00:54 +0100
Christoph Hellwig <hch@infradead.org> wrote:
> This looks nice in general, getting things out of softirq context is
> always good.
I am preparing a patch to net/ipv4/route.c to migrate rt_check_expire()
as well.
>
> On Tue, Sep 11, 2007 at 02:56:13PM +0200, Eric Dumazet wrote:
> > #if RT_CACHE_DEBUG >= 2
> > static atomic_t dst_total = ATOMIC_INIT(0);
> > #endif
> > -static unsigned long dst_gc_timer_expires;
> > -static unsigned long dst_gc_timer_inc = DST_GC_MAX;
> > -static void dst_run_gc(unsigned long);
> > +static struct {
> > + spinlock_t lock;
> > + struct dst_entry *list;
> > + unsigned long timer_inc;
> > + unsigned long timer_expires;
> > +} dst_garbage = {
> > + .lock = __SPIN_LOCK_UNLOCKED(dst_garbage.lock),
> > + .timer_inc = DST_GC_MAX,
> > +};
>
> Can you please et rid of this useless struct? It just complicates
> the code and means we can't use the proper DEFINE_SPINLOCK initializer.
When using the standard DEFINE_SPINLOCK initializer, the lock is in the
data section, while list is in bss section.
This 'useless struct' makes lock/list being on the same cache line, so
reduces latency of __dst_free(). I wish more structures in kernel be used
instead of relying on random placement of the linker...
>
> > +DECLARE_DELAYED_WORK(dst_gc_work, dst_gc_task);
>
> This should be static.
Yes I agree
next prev parent reply other threads:[~2007-09-12 10:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-11 12:56 [PATCH] NET : convert IP route cache garbage colleciton from softirq processing to a workqueue Eric Dumazet
2007-09-12 9:05 ` David Miller
2007-09-12 10:08 ` Eric Dumazet
2007-09-12 11:12 ` David Miller
2007-09-12 12:16 ` Eric Dumazet
2007-09-12 12:30 ` David Miller
2007-09-12 10:00 ` Christoph Hellwig
2007-09-12 10:18 ` Eric Dumazet [this message]
2007-09-12 11:10 ` 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=20070912121830.4d2e3940.dada1@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=hch@infradead.org \
--cc=herbert@gondor.apana.org.au \
--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).