summaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_ldisc.c
diff options
context:
space:
mode:
authorIvo Sieben <meltedpianoman@gmail.com>2012-12-18 15:48:50 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-16 08:02:22 +0100
commitbd5d7ce9afdd0cddc5ab65e20d1134ccad824418 (patch)
tree2bfffe6ab96beedc8410c70a32334951cc14ecac /drivers/tty/tty_ldisc.c
parentdrivers/tty/serial: extern function which for release resource, need check po... (diff)
downloadlinux-bd5d7ce9afdd0cddc5ab65e20d1134ccad824418.tar.xz
linux-bd5d7ce9afdd0cddc5ab65e20d1134ccad824418.zip
tty: Only wakeup the line discipline idle queue when queue is active
Before waking up the tty line discipline idle queue first check if the queue is active (non empty). This prevents unnecessary entering the critical section in the wake_up() function and therefore avoid needless scheduling overhead on a PREEMPT_RT system caused by two processes being in the same critical section. Signed-off-by: Ivo Sieben <meltedpianoman@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_ldisc.c')
-rw-r--r--drivers/tty/tty_ldisc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index c5782294e532..e96d1876bd62 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -64,7 +64,9 @@ static void put_ldisc(struct tty_ldisc *ld)
return;
}
raw_spin_unlock_irqrestore(&tty_ldisc_lock, flags);
- wake_up(&ld->wq_idle);
+
+ if (waitqueue_active(&ld->wq_idle))
+ wake_up(&ld->wq_idle);
}
/**