public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Krishna Kumar <krkumar2@in.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Krishna Kumar <krkumar2@in.ibm.com>
Subject: [RFC] [PATCH 0/1] timers: add_timer should never be called if pending
Date: Mon, 22 Sep 2008 10:04:25 +0530	[thread overview]
Message-ID: <20080922043425.21118.24172.sendpatchset@localhost.localdomain> (raw)

From: Krishna Kumar <krkumar2@in.ibm.com>

(Hopefully this is not something that has been suggested earlier and rejected).

add_timer should never be called on a pending timer - such bugs should be
caught by reports generated by debug kernels. It is the responsibility of the
subsystem users to ensure that timers are not added twice. Using the
add_timer_on interface reduces the code that checks if the timer is pending,
the timer_base change, updating 'expires' two times, etc.

1. Single CPU, Single Timer: Add the same timer serially on one CPU - do this
   many times.
	Laptop (2 way Xeon): Saves 10.8%
		ORG: Time: 35359
		NEW: Time: 31527
	Server (4 way x86-64): Saves 7.9%
		ORG: Time: 4520
		NEW: Time: 4164
2. Single CPU, Multiple Timer: Add different timers serially on one CPU - do
   this many times.
	Laptop (2 way Xeon): Saves 7.7%
		ORG: Time: 133728
		NEW: Time: 144822
	Server (4 way x86-64): Saves 15.7%
		ORG: Time: 69012
		NEW: Time: 58186
3. Many CPU's, Single Timer: Add the same timer in parallel on all CPUs - do
   this many times.
	Laptop (2 way Xeon): Saves 14%
		ORG: Time: 69845
		NEW: Time: 60067
	Server (4 way x86-64): Saves 21.8%
		ORG: Time: 18047
		NEW: Time: 14116
4. Many CPU's, Multiple Timer: Add different timers in parallel on all CPUs -
   do this many times.
	Laptop (2 way Xeon): Saves 47.1%
		ORG: Time: 292173
		NEW: Time: 154485
	Server (4 way x86-64): Saves 8.23
		ORG: Time: 319129
		NEW: Time: 292842

             reply	other threads:[~2008-09-22  4:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22  4:34 Krishna Kumar [this message]
2008-09-22  4:34 ` [RFC] [PATCH 1/1]: timers: Change add_timer to use add_timer_on Krishna Kumar
2008-09-22 14:43   ` Oleg Nesterov

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=20080922043425.21118.24172.sendpatchset@localhost.localdomain \
    --to=krkumar2@in.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@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