mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ravikiran G Thirumalai <kiran@in.ibm.com>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org,
	"David S. Miller " <davem@redhat.com>,
	Patch Monkey <trivial@rustcorp.com.au>
Subject: [patch trivial 2.5.25] dst.c cleanup -- dst_total
Date: Fri, 12 Jul 2002 16:27:09 +0530	[thread overview]
Message-ID: <20020712162709.B988@in.ibm.com> (raw)

dst_total  is read only #if RT_CACHE_DEBUG >=2 , but is incremented and
decremented during dst_alloc and dst_destroy.  Following patch conditions
the atomic_inc and atomic_decs to dst_total with RT_CACHE_DEBUG >= 2 

dst_alloc routine (which incements dst_total) shows up with the tests 
suggested by Dave Miller for measuring RCU route cache changes. 
Profile ticks reduce by 15 % for dst_alloc on a 4 way with  the foll
patch (with the default -- RT_CACHE_DEBUG = 0 ).

-Kiran


--- linux-2.5.25-pure/net/core/dst.c	Sat Jul  6 05:12:31 2002
+++ linux-2.5.25/net/core/dst.c	Fri Jul 12 13:23:09 2002
@@ -29,7 +29,9 @@
  * 4) All operations modify state, so a spinlock is used.
  */
 static struct dst_entry 	*dst_garbage_list;
+#if RT_CACHE_DEBUG >= 2 
 static atomic_t			 dst_total = ATOMIC_INIT(0);
+#endif
 static spinlock_t		 dst_lock = SPIN_LOCK_UNLOCKED;
 
 static unsigned long dst_gc_timer_expires;
@@ -108,7 +110,9 @@
 	dst->lastuse = jiffies;
 	dst->input = dst_discard;
 	dst->output = dst_blackhole;
+#if RT_CACHE_DEBUG >= 2 
 	atomic_inc(&dst_total);
+#endif
 	atomic_inc(&ops->entries);
 	return dst;
 }
@@ -158,7 +162,9 @@
 		dst->ops->destroy(dst);
 	if (dst->dev)
 		dev_put(dst->dev);
+#if RT_CACHE_DEBUG >= 2 
 	atomic_dec(&dst_total);
+#endif
 	kmem_cache_free(dst->ops->kmem_cachep, dst);
 }
 

             reply	other threads:[~2002-07-12 10:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-12 10:57 Ravikiran G Thirumalai [this message]
2002-07-12 22:03 ` David S. 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=20020712162709.B988@in.ibm.com \
    --to=kiran@in.ibm.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=trivial@rustcorp.com.au \
    /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

all inboxes | Powered by JetHome®