* [PATCH] NET : dst_ifdown() cleanup
@ 2007-12-11 3:59 Eric Dumazet
2007-12-11 10:00 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2007-12-11 3:59 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List
[-- Attachment #1: Type: text/plain, Size: 256 bytes --]
This cleanup shrinks size of net/core/dst.o on i386 from 1299 to 1289 bytes.
(This is because dev_hold()/dev_put() are doing atomic_inc()/atomic_dec() and
force compiler to re-evaluate memory contents.)
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
[-- Attachment #2: dst_ifdown.patch --]
[-- Type: text/plain, Size: 411 bytes --]
diff --git a/net/core/dst.c b/net/core/dst.c
index 5c6cfc4..7eceeba 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -284,8 +284,8 @@ static inline void dst_ifdown(struct dst_entry *dst, struct net_device *dev,
dev_put(dev);
if (dst->neighbour && dst->neighbour->dev == dev) {
dst->neighbour->dev = dst->dev;
+ dev_hold(dst->dev);
dev_put(dev);
- dev_hold(dst->neighbour->dev);
}
}
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] NET : dst_ifdown() cleanup
2007-12-11 3:59 [PATCH] NET : dst_ifdown() cleanup Eric Dumazet
@ 2007-12-11 10:00 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-12-11 10:00 UTC (permalink / raw)
To: dada1; +Cc: netdev
From: Eric Dumazet <dada1@cosmosbay.com>
Date: Tue, 11 Dec 2007 04:59:22 +0100
> This cleanup shrinks size of net/core/dst.o on i386 from 1299 to 1289 bytes.
> (This is because dev_hold()/dev_put() are doing atomic_inc()/atomic_dec() and
> force compiler to re-evaluate memory contents.)
>
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Applied to net-2.6.25, thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-11 10:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-11 3:59 [PATCH] NET : dst_ifdown() cleanup Eric Dumazet
2007-12-11 10:00 ` David Miller
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).