public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.6.13-rc6-rt9
Date: Fri, 19 Aug 2005 09:00:45 -0400	[thread overview]
Message-ID: <1124456445.5186.124.camel@localhost.localdomain> (raw)
In-Reply-To: <1124433586.5186.119.camel@localhost.localdomain>

On Fri, 2005-08-19 at 02:39 -0400, Steven Rostedt wrote:

> Ingo, can't you get rt.c to be more confusing. I mean it is too simple.
> We need to add a few more underscores here and there :-)  Seriously,
> that rt.c is mind boggling. It was nice before, now it is just screaming
> for a cleanup (come now, do we really need the four underscores?).  Same
> with latency.c. 

Ingo,

Here's one example of cleaning up rt.c.  I like an extra parameter
instead of having two functions that are exactly the same except for one
line.  I'll probably submit more.

I haven't thought of a good way yet to solve the race condition with
dependent sleeper. (Except by turning off CONFIG_WAKEUP_TIMING :-)

-- Steve

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


Index: linux_realtime_ernie/kernel/rt.c
===================================================================
--- linux_realtime_ernie/kernel/rt.c	(revision 296)
+++ linux_realtime_ernie/kernel/rt.c	(working copy)
@@ -1331,8 +1331,7 @@
 	FREE_WAITER(&waiter);
 }
 
-static void __up_mutex_waiter_savestate(struct rt_mutex *lock __EIP_DECL__);
-static void __up_mutex_waiter_nosavestate(struct rt_mutex *lock __EIP_DECL__);
+static void __up_mutex_waiter(struct rt_mutex *lock, int save_state __EIP_DECL__);
 
 /*
  * release the lock:
@@ -1361,12 +1360,9 @@
 	if (plist_empty(&lock->wait_list))
 		check_pi_list_empty(lock, lock_owner(lock));
 #endif
-	if (unlikely(!plist_empty(&lock->wait_list))) {
-		if (save_state)
-			__up_mutex_waiter_savestate(lock __EIP__);
-		else
-			__up_mutex_waiter_nosavestate(lock __EIP__);
-	} else
+	if (unlikely(!plist_empty(&lock->wait_list)))
+			__up_mutex_waiter(lock, save_state __EIP__);
+	else
 		lock->owner = NULL;
 	__raw_spin_unlock(&pi_lock);
 	__raw_spin_unlock(&lock->wait_lock);
@@ -1759,7 +1755,7 @@
 	return __down_trylock(&rwsem->lock __CALLER0__);
 }
 
-static void __up_mutex_waiter_nosavestate(struct rt_mutex *lock __EIP_DECL__)
+static void __up_mutex_waiter(struct rt_mutex *lock, int save_state __EIP_DECL__)
 {
 	struct thread_info *old_owner_ti, *new_owner_ti;
 	struct task_struct *old_owner, *new_owner;
@@ -1790,43 +1786,12 @@
 		new_owner->pending_owner = lock;
 	}
 #endif
-	wake_up_process(new_owner);
+	if (save_state)
+		wake_up_process_mutex(new_owner);
+	else
+		wake_up_process(new_owner);
 }
 
-static void __up_mutex_waiter_savestate(struct rt_mutex *lock __EIP_DECL__)
-{
-	struct thread_info *old_owner_ti, *new_owner_ti;
-	struct task_struct *old_owner, *new_owner;
-	struct rt_mutex_waiter *w;
-	int prio;
-
-	old_owner_ti = lock_owner(lock);
-	old_owner = old_owner_ti->task;
-	new_owner_ti = pick_new_owner(lock, old_owner_ti, 1 __EIP__);
-	new_owner = new_owner_ti->task;
-
-	/*
-	 * If the owner got priority-boosted then restore it
-	 * to the previous priority (or to the next highest prio
-	 * waiter's priority):
-	 */
-	prio = old_owner->normal_prio;
-	if (unlikely(!plist_empty(&old_owner->pi_waiters))) {
-		w = plist_first_entry(&old_owner->pi_waiters, struct rt_mutex_waiter, pi_list);
-		if (w->ti->task->prio < prio)
-			prio = w->ti->task->prio;
-	}
-	if (unlikely(prio != old_owner->prio))
-		pi_setprio(lock, old_owner, prio);
-#ifdef CAPTURE_LOCK
-	if (lock != &kernel_sem.lock) {
-		new_owner->rt_flags |= RT_PENDOWNER;
-		new_owner->pending_owner = lock;
-	}
-#endif
-	wake_up_process_mutex(new_owner);
-}
-
 /*
  * Do owner check too:
  */



  reply	other threads:[~2005-08-19 13:01 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-18  6:01 2.6.13-rc6-rt9 Ingo Molnar
2005-08-18 15:24 ` 2.6.13-rc6-rt9 Thomas Gleixner
2005-08-18 16:08   ` 2.6.13-rc6-rt9 Thomas Gleixner
2005-08-18 21:17   ` 2.6.13-rc6-rt9 Thomas Gleixner
2005-08-18 22:54 ` [2.6.13-rc6-rt9 patch] fix DECNET_ROUTER=y compile Adrian Bunk
2005-08-22  7:59   ` Ingo Molnar
2005-08-18 22:54 ` 2.6.13-rc6-rt9: compile errors Adrian Bunk
2005-08-22  8:44   ` Ingo Molnar
2005-08-19  0:05 ` 2.6.13-rc6-rt9 Chuck Harding
2005-08-19  6:39 ` 2.6.13-rc6-rt9 Steven Rostedt
2005-08-19 13:00   ` Steven Rostedt [this message]
2005-08-19 15:36     ` 2.6.13-rc6-rt9 Steven Rostedt
2005-08-22  7:57       ` 2.6.13-rc6-rt9 Ingo Molnar
2005-08-22  7:58     ` 2.6.13-rc6-rt9 Ingo Molnar
2005-08-23 12:36   ` 2.6.13-rc6-rt9 Ingo Molnar
2005-08-23 12:50     ` 2.6.13-rc6-rt9 Steven Rostedt
2005-08-23 12:56       ` 2.6.13-rc6-rt9 Ingo Molnar
2005-08-19 16:56 ` 2.6.13-rc6-rt9 Peter Zijlstra
2005-08-19 18:30   ` 2.6.13-rc6-rt9 Peter Zijlstra
2005-08-19 18:43     ` 2.6.13-rc6-rt9 Paul E. McKenney
2005-08-20 19:27       ` 2.6.13-rc6-rt9 Peter Zijlstra
2005-08-20 21:24         ` 2.6.13-rc6-rt9 Jeff Dike
2005-09-29  7:54           ` 2.6.13-rc6-rt9 Peter Zijlstra
2005-09-30  1:00             ` 2.6.13-rc6-rt9 Paul E. McKenney
2005-09-30  1:07               ` 2.6.13-rc6-rt9 Thomas Gleixner
2005-09-30  1:46                 ` 2.6.13-rc6-rt9 Paul E. McKenney
2005-09-30  6:17                   ` 2.6.13-rc6-rt9 Thomas Gleixner
2005-08-19 21:50 ` 2.6.13-rc6-rt9 Darren Hart
2005-08-25  6:24   ` 2.6.13-rc6-rt9 Ingo Molnar
2005-08-19 22:13 ` 2.6.13-rc6-rt9 Darren Hart
2005-08-19 23:00   ` 2.6.13-rc6-rt9 Thomas Gleixner
2005-08-20 15:13     ` 2.6.13-rc6-rt9 Darren Hart
2005-08-19 23:48 ` [PATCH 2.6.13-rc6-rt9] PI aware dynamic priority adjustment Thomas Gleixner
2005-08-20  0:19   ` George Anzinger
2005-08-20  0:36     ` Thomas Gleixner
2005-08-20  1:36       ` George Anzinger
2005-09-26 21:03         ` Roland McGrath
2005-08-20 14:10   ` Oleg Nesterov
2005-08-20 16:04     ` Thomas Gleixner
2005-08-20 17:50       ` Oleg Nesterov
2005-08-22 21:37       ` George Anzinger
2005-08-20 16:58   ` [PATCH] fix send_sigqueue() vs thread exit race Oleg Nesterov
2005-08-21  9:44     ` Thomas Gleixner
2005-08-21 10:41       ` Oleg Nesterov
2005-08-21 12:38         ` Thomas Gleixner
2005-08-21 10:59       ` Oleg Nesterov
2005-08-21 21:24         ` Thomas Gleixner
2005-08-21 21:50           ` Thomas Gleixner
2005-08-22  6:39             ` Oleg Nesterov
2005-08-22  8:08               ` Thomas Gleixner
2005-08-22  8:52                 ` Oleg Nesterov
2005-08-22 10:06                   ` Thomas Gleixner
2005-08-22 16:45                     ` Oleg Nesterov
2005-08-23 10:13                       ` Thomas Gleixner
2005-08-23 16:17                         ` Oleg Nesterov
2005-08-23 18:29                           ` Thomas Gleixner
2005-09-24 13:42                           ` [PATCH] fix exit_itimers() vs posix_timer_event() AB-BA deadlock Oleg Nesterov
2005-09-25  5:44                             ` Andrew Morton
2005-09-25 14:07                               ` [PATCH] fix exit_itimers() vs posix_timer_event() AB-BAdeadlock Oleg Nesterov
2005-10-23 16:50                                 ` Oleg Nesterov
2005-08-23 10:42                       ` [PATCH] fix send_sigqueue() vs thread exit race Thomas Gleixner
2005-08-22  7:38   ` [PATCH 2.6.13-rc6-rt9] PI aware dynamic priority adjustment Ingo Molnar
2005-08-22  7:41     ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2005-08-19 10:41 2.6.13-rc6-rt9 Karsten Wiese
2005-08-19 22:42 ` 2.6.13-rc6-rt9 Chuck Harding
2005-08-19 23:12   ` 2.6.13-rc6-rt9 Chuck Harding
2005-08-22  7:47 ` 2.6.13-rc6-rt9 Ingo Molnar

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=1124456445.5186.124.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@us.ibm.com \
    --cc=tglx@linutronix.de \
    /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