public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Williams <pwil3058@bigpond.net.au>
To: Andrew Morton <akpm@osdl.org>
Cc: Con Kolivas <kernel@kolivas.org>, Sam Vilain <sam@vilain.net>,
	Srivatsa <vatsa@in.ibm.com>, Balbir Singh <bsingharora@gmail.com>,
	Kirill Korotaev <dev@openvz.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Mike Galbraith <efault@gmx.de>,
	Kingsley Cheung <kingsley@aurema.com>,
	CKRM <ckrm-tech@lists.sourceforge.net>,
	Ingo Molnar <mingo@elte.hu>,
	Rene Herman <rene.herman@keyaccess.nl>
Subject: Re: [PATCH 1/4] sched: Add CPU rate soft caps
Date: Mon, 19 Jun 2006 11:21:54 +1000	[thread overview]
Message-ID: <4495FC32.9060509@bigpond.net.au> (raw)
In-Reply-To: <20060618082648.6061.62247.sendpatchset@heathwren.pw.nest>

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

As pointed out by Con Kolivas there is an error in the mutex count part 
of this code and an opportunity to increase efficiency with use of the 
likely() macro.  The attached patch addresses these issues.

Signed-off-by: Peter Williams <pwil3058@bigpond.net.au>

-- 
Peter Williams                                   pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce

[-- Attachment #2: fix-mutex-count --]
[-- Type: text/plain, Size: 784 bytes --]

---
 kernel/mutex.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: MM-2.6.17-rc6-mm2/kernel/mutex.c
===================================================================
--- MM-2.6.17-rc6-mm2.orig/kernel/mutex.c	2006-06-19 09:57:03.000000000 +1000
+++ MM-2.6.17-rc6-mm2/kernel/mutex.c	2006-06-19 09:57:55.000000000 +1000
@@ -319,7 +319,7 @@ int fastcall __sched mutex_lock_interrup
 	ret = __mutex_fastpath_lock_retval
 			(&lock->count, __mutex_lock_interruptible_slowpath);
 
-	if (!ret)
+	if (likely(!ret))
 		inc_mutex_count();
 
 	return ret;
@@ -380,7 +380,7 @@ int fastcall __sched mutex_trylock(struc
 	int ret = __mutex_fastpath_trylock(&lock->count,
 					__mutex_trylock_slowpath);
 
-	if (!ret)
+	if (likely(ret))
 		inc_mutex_count();
 
 	return ret;

  parent reply	other threads:[~2006-06-19  1:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-18  8:26 [PATCH 0/4] sched: Add CPU rate caps Peter Williams
2006-06-18  8:26 ` [PATCH 1/4] sched: Add CPU rate soft caps Peter Williams
2006-06-18  8:38   ` Con Kolivas
2006-06-18 15:52     ` Peter Williams
2006-06-19  1:21   ` Peter Williams [this message]
2006-06-18  8:26 ` [PATCH 2/4] sched: Add CPU rate hard caps Peter Williams
2006-06-18  8:27 ` [PATCH 3/4] sched: Add procfs interface for CPU rate soft caps Peter Williams
2006-06-18  8:27 ` [PATCH 4/4] sched: Add procfs interface for CPU rate hard caps Peter Williams
2006-06-18  9:50 ` [PATCH 0/4] sched: Add CPU rate caps Andrew Morton
2006-06-18 10:25   ` Peter Williams
2006-06-18 11:42     ` Srivatsa Vaddagiri
2006-06-18 12:19       ` Peter Williams
2006-06-19  0:13     ` Balbir Singh
2006-06-19  1:03       ` [ckrm-tech] " Peter Williams
2006-06-19  2:20         ` Balbir Singh
2006-06-19  3:17           ` Peter Williams
2006-06-19  3:31             ` Balbir Singh
2006-06-19  3:50               ` Peter Williams
2006-06-19  8:30                 ` Balbir Singh
2006-06-19 11:35                   ` Peter Williams
2006-06-19 11:33                     ` Balbir Singh
2006-06-19 23:09                       ` Peter Williams
2006-06-20  4:28           ` Peter Williams
2006-06-20  4:40             ` Balbir Singh
2006-06-20  5:56               ` Peter Williams
2006-06-19  5:04     ` Peter Williams
2006-06-19 23:59   ` Peter Williams
2006-06-19 18:55 ` [ckrm-tech] " Chris Friesen
2006-06-19 23:28   ` Peter Williams
  -- strict thread matches above, loose matches on Subject: below --
2006-06-22  1:52 Peter Williams
2006-06-22  1:52 ` [PATCH 1/4] sched: Add CPU rate soft caps Peter Williams

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=4495FC32.9060509@bigpond.net.au \
    --to=pwil3058@bigpond.net.au \
    --cc=akpm@osdl.org \
    --cc=bsingharora@gmail.com \
    --cc=ckrm-tech@lists.sourceforge.net \
    --cc=dev@openvz.org \
    --cc=efault@gmx.de \
    --cc=kernel@kolivas.org \
    --cc=kingsley@aurema.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rene.herman@keyaccess.nl \
    --cc=sam@vilain.net \
    --cc=vatsa@in.ibm.com \
    /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