From 90f33bee7f31a99c87ab1bdb235c41081f3a6dd2 Mon Sep 17 00:00:00 2001 From: Octavian Purdila Date: Wed, 13 Jul 2016 17:53:37 +0300 Subject: [PATCH 1/2] lkl: irq handling optimizations Since run_irqs is run from arch_lkl_irq_restore() try to avoid atomic operations in the common case where we don't have interrupts pending. While at it, also optimize for the common case where not all interrupts will be triggered and try to exit the interrupt loop as soon as possible. Signed-off-by: Octavian Purdila --- arch/lkl/kernel/irq.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/lkl/kernel/irq.c b/arch/lkl/kernel/irq.c index 16f0e390c0a9ac..fb579c789b0bda 100644 --- a/arch/lkl/kernel/irq.c +++ b/arch/lkl/kernel/irq.c @@ -38,17 +38,22 @@ int lkl_trigger_irq(int irq) static void run_irqs(void) { - int i; + int i = 1; unsigned long status; + if (!irq_status) + return; + status = TEST_AND_CLEAR_IRQ_STATUS(IRQS_MASK); - for (i = 1; i < NR_IRQS; i++) { - if (status & IRQ_BIT(i)) { + while (status) { + if (status & 1) { irq_enter(); generic_handle_irq(i); irq_exit(); } + status = status >> 1; + i++; } } From 8883b5f4e1c1465eb14257152eb226acec1d92f4 Mon Sep 17 00:00:00 2001 From: Octavian Purdila Date: Wed, 13 Jul 2016 17:55:47 +0300 Subject: [PATCH 2/2] lkl tests: increase btrfs test image size to 100MB This is required by newer btrfs-tools, otherwise mkfs.brtfs fails to create a new filesystem. Signed-off-by: Octavian Purdila --- tools/lkl/tests/boot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lkl/tests/boot.sh b/tools/lkl/tests/boot.sh index f8357dcc876f44..1dcbcb8f63cf52 100755 --- a/tools/lkl/tests/boot.sh +++ b/tools/lkl/tests/boot.sh @@ -13,7 +13,7 @@ if [ -z "$fstype" ]; then fi file=`mktemp` -dd if=/dev/zero of=$file bs=1024 count=20480 +dd if=/dev/zero of=$file bs=1024 count=102400 yes | mkfs.$fstype $file >/dev/null