* Load interrupt code dynamically
@ 2007-07-31 21:26 Haifeng He
2007-08-01 0:03 ` Alan Cox
0 siblings, 1 reply; 3+ messages in thread
From: Haifeng He @ 2007-07-31 21:26 UTC (permalink / raw)
To: linux-kernel
Hi, all,
I am working on a project to reduce the memory requirement of Linux
kernel code. The idea is to keep infrequent executed code on disk and
load them into a
buffer (code buffer) in memory at runtime. The idea is simple but
there are many issues
dealing with the concurrency in the kernel. Interrupt is one of them.
Since interrupt is executed asynchronously, my current solution is to
assign two buffers: one for regular (non-interrupt code) and one
specifically for
interrupt code. However, the scheme still does not work well. The
problem is that, it seems,
there can multiple interrupt occur at the same in the kernel and
therefore, if interrupt
A is using the code buffer, another interrupt B can be issued and
overwrite the code
buffer(where A's code is stored). I found couples of such examples,
including, driver code
for ide (driver/ide/) and video (driver/video/vgacon.c) and console
(driver/char/). My
feeling is that since handling ide interrupt may take a while, kernel
will enable
other interrupts when handling an ide request.
My first question is, what are other interrupts in the kernel that can
allow other interrupts
to be issued? Second question is, how does the kernel switch between
different interrupts? Last, any suggestion on how to change my current
implementation to
enable loading interrupt code dynamically?
Thank you
Haifeng
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Load interrupt code dynamically
2007-07-31 21:26 Load interrupt code dynamically Haifeng He
@ 2007-08-01 0:03 ` Alan Cox
2007-08-01 11:06 ` Andi Kleen
0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2007-08-01 0:03 UTC (permalink / raw)
To: Haifeng He; +Cc: linux-kernel
> dealing with the concurrency in the kernel. Interrupt is one of them.
Its extremely hard as you've probably noticed by now.
> My first question is, what are other interrupts in the kernel that can
> allow other interrupts
> to be issued? Second question is, how does the kernel switch between
The kernel IRQ handling is pretty flexible. A concious decision was made
many years ago not to try and limit it to do a pageable kernel as RAM was
far cheaper than the pain, and getting cheaper by the day.
> different interrupts? Last, any suggestion on how to change my current
> implementation to enable loading interrupt code dynamically?
Realistically - the one case it is done right now is by the mainframe
people, simply because the underlying hypervisor does it. You probably
have much more chance that way using a microkernel (real one not MACH)
underneath. Still a huge task.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Load interrupt code dynamically
2007-08-01 0:03 ` Alan Cox
@ 2007-08-01 11:06 ` Andi Kleen
0 siblings, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2007-08-01 11:06 UTC (permalink / raw)
To: Alan Cox; +Cc: Haifeng He, linux-kernel
Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
>
> Realistically - the one case it is done right now is by the mainframe
> people, simply because the underlying hypervisor does it. You probably
> have much more chance that way using a microkernel (real one not MACH)
> underneath. Still a huge task.
There are also patchkits for KVM for swappable guests. And you can do it today
in qemu.
-Andi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-01 10:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-31 21:26 Load interrupt code dynamically Haifeng He
2007-08-01 0:03 ` Alan Cox
2007-08-01 11:06 ` Andi Kleen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.