You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the commit b8780c363d80 ("sched: remove sleep_on() and friends
"), the description about sleep_on is incorrect and the example code has
been fixed by replacing it with wait_event family. Let's also fix the
description to match the corrected code.
Copy file name to clipboardExpand all lines: lkmpg.tex
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1582,7 +1582,7 @@ \subsection{Sleep}
1582
1582
It then returns and the process which just closed the file can continue to run.
1583
1583
In time, the scheduler decides that that process has had enough and gives control of the CPU to another process.
1584
1584
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|.
1586
1586
1587
1587
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.
1588
1588
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}
1594
1594
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.
1595
1595
1596
1596
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.
1599
1599
1600
1600
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.
0 commit comments