[Haifux] SSD and linux
gabik at cs.technion.ac.il
Thu Sep 18 17:49:06 MSD 2008
The place where the current process goes to sleep and waits until the page
is swapped in is indeed in generic_make_request() (called from submit_bio())
There is a call to block_wait_queue_running(q); which moves this process to
wait and calls for schedule() [prepare_to_wait_exclusive() and after that
Thus, this seems to be a place for a busy loop.
You must be careful though with what you change and make sure not to break
some other code path, that assumes certain things done in this code path.
For example, if you are not going to put this process in the wait queue, you
must be careful what will happen when the io operation will finish and will
want to remove this process from the wait queue and wake it up.
P.S. I was referring to version 2.6.11
From: Doron Zuckerman [mailto:doron.zuckerman at gmail.com]
Sent: Thursday, September 18, 2008 12:28 PM
To: muli at il.ibm.com; gabik at cs.technion.ac.il; haifux at haifux.org
Subject: Re: [Haifux] SSD and linux
Hi Gabi and Muli,
I'm sorry about the mistake- you understood me correctly.
I'm not sure it will speed up the OS, however I'm doing an academic research
on the matter as part of a project I'm taking, and I plan to check this
The leading thought was that since the SSD is not a mechanical drive, pages
can be brought faster in this way, and there is no need to context switch,
thus, avoiding the overhead included.
Yes I plan to use the polling system (busy-wait) , and I'm looking for the
kernel part in the pagefault handling mechanism in which the process is
suspended in order to prevent it.
So far I found the function "__generic_make_request" in file "ll_blk".
This function calls a sub function named "might_sleep".
I have deleted the call to this function whenever I'm in a pagefault,
however I'm not sure if this function casuses the sleep, or is just used for
debugging in order to check if we entered a suspend state.
My question is if this is the function I should change in order to accept
the change I'm willing to get, or if the change should be made in
which, according to my understanding, belongs to the specific driver I'm
Please help me find the specific place I'm looking for that would make the
Thank you very much,
On Tue, Sep 16, 2008 at 2:42 PM, gabik <gabik at cs.technion.ac.il
Why do you think it will speed up the OS?
What do you plan to do until the page is swapped in? Busy loop?
About your solution:
handle_mm_fault is called from within page fault handler (do_page_fault
So what is the rational behind calling handle_mm_fault not from inside
Where would you call it from instead and what do you plan to do when you are
in the page fault?
Probably what you meant is, in order not to do context switch due to page
fault, is to call handle_mm_fault as usual, but not to raise need_resched
flag, so as not to trigger a context switch in case of a major page fault.
From: haifux-bounces at haifux.org
[mailto:haifux-bounces at haifux.org
On Behalf Of Doron Zuckerman
Sent: Tuesday, September 16, 2008 12:31 PM
To: haifux at haifux.org
Cc: Ronen Gruengras
Subject: [Haifux] SSD and linux
I have a question regarding the linux kernel (for those of you who are
familiar with it).
I'm looking for a way to add a change to the linux kernel in order to check
if I can make it more compatible with my Asus EEE-PC.
I would like to change the kernel in such way that it will not do a context
switch every time there is a page fault
and will wait for the required page to be brought from the SSD (Solid State
Drive), then continue as usual.
In Such way, I plan to check if I can fasten the speed of the Operating
System (Ubuntu for EEE).
I thought of adding a TIF flag in the process descriptor (thread_info_32.h)
that will tell me if I'm currently in a pagefault and
then change the fault_32.c in such way that it will do the
"handle_mm_fault(mm,vma, address, write_;" only if there is no
pagefault at the moment.
Can you suggest any other solution possible or tell me what you think about
I would really appreciate any help with this,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haifux