Skip to content

Commit ed0b93c

Browse files
authored
Merge pull request #198 from linD026/master
Remove sleep_on family
2 parents cc37e59 + d2d54ca commit ed0b93c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lkmpg.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ \subsection{Sleep}
15821582
It then returns and the process which just closed the file can continue to run.
15831583
In time, the scheduler decides that that process has had enough and gives control of the CPU to another process.
15841584
Eventually, one of the processes which was in the queue will be given control of the CPU by the scheduler.
1585-
It starts at the point right after the call to \cpp|module_interruptible_sleep_on|.
1585+
It starts at the point right after the call to \cpp|wait_event_interruptible|.
15861586

15871587
This means that the process is still in kernel mode - as far as the process is concerned, it issued the open system call and the system call has not returned yet.
15881588
The process does not know somebody else used the CPU for most of the time between the moment it issued the call and the moment it returned.
@@ -1594,8 +1594,8 @@ \subsection{Sleep}
15941594
As soon as the first background process is killed with kill \%1 , the second is woken up, is able to access the file and finally terminates.
15951595

15961596
To make our life more interesting, \cpp|module_close| does not have a monopoly on waking up the processes which wait to access the file.
1597-
A signal, such as \emph{Ctrl +c} (\textbf{SIGINT}) can also wake up a process. This is because we used \cpp|module_interruptible_sleep_on|.
1598-
We could have used \cpp|module_sleep_on| instead, but that would have resulted in extremely angry users whose \emph{Ctrl+c}'s are ignored.
1597+
A signal, such as \emph{Ctrl +c} (\textbf{SIGINT}) can also wake up a process. This is because we used \cpp|wait_event_interruptible|.
1598+
We could have used \cpp|wait_event| instead, but that would have resulted in extremely angry users whose \emph{Ctrl+c}'s are ignored.
15991599

16001600
In that case, we want to return with \cpp|-EINTR| immediately. This is important so users can, for example, kill the process before it receives the file.
16011601

0 commit comments

Comments
 (0)