mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@mvista.com>
To: linux-kernel@vger.kernel.org
Subject: Interrupt starvation points
Date: 11 Feb 2005 09:05:21 -0800	[thread overview]
Message-ID: <1108141521.21940.44.camel@dhcp153.mvista.com> (raw)

        I found some points during schedule when interrupts are off for
long periods . These two patches seem to help. One enables interrupts
inside schedule() , so that interrupts are enabled after each
need-resched loop, then disabled again before __schedule() is called. 

        The other patch enabled interrupt before calling up on
kernel_sem ..This one could use some thinking over. I did this cause
up() is very expensive on ARM , and combined with the looping above
interrupts can stay off for a long time .. 


Daniel


Index: linux-2.6.10/kernel/sched.c
===================================================================
--- linux-2.6.10.orig/kernel/sched.c	2005-02-08 22:32:48.000000000 +0000
+++ linux-2.6.10/kernel/sched.c	2005-02-08 22:33:58.000000000 +0000
@@ -3038,9 +3038,10 @@
 		send_sig(SIGUSR2, current, 1);
 	}
 	do {
+		local_irq_disable();
 		__schedule();
+		local_irq_enable(); // TODO: do sti; ret
 	} while (unlikely(test_thread_flag(TIF_NEED_RESCHED)));
-	local_irq_enable(); // TODO: do sti; ret
 }
 
 EXPORT_SYMBOL(schedule);


Index: linux-2.6.10/lib/kernel_lock.c
===================================================================
--- linux-2.6.10.orig/lib/kernel_lock.c	2005-02-08 18:16:30.000000000 +0000
+++ linux-2.6.10/lib/kernel_lock.c	2005-02-08 22:53:09.000000000 +0000
@@ -114,7 +114,9 @@
 
 void __lockfunc __release_kernel_lock(void)
 {
+	local_irq_enable();
 	up(&kernel_sem);
+	local_irq_disable();
 }
 
 /*





             reply	other threads:[~2005-02-11 17:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-11 17:05 Daniel Walker [this message]
2005-02-11 17:30 ` Ingo Molnar
2005-02-11 17:36   ` Daniel Walker
2005-02-11 20:04 ` Russell King
2005-02-11 21:52   ` Daniel Walker

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=1108141521.21940.44.camel@dhcp153.mvista.com \
    --to=dwalker@mvista.com \
    --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

all inboxes | Powered by JetHome®