/[lkdp]/lkdp/pm/smp.tex
ViewVC logotype

Diff of /lkdp/pm/smp.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by nayaniabhishek, Tue Nov 5 19:35:42 2002 UTC revision 1.2 by kdlinux2001, Thu Nov 21 13:08:15 2002 UTC
# Line 1  Line 1 
1  \chapter{SMP issues}  \chapter{SMP issues} \label{smp:all} \index{smp\_processor\_id}
2          \section{SMP issues related to process scheduling}          \section{SMP related macros}
3            In a SMP configured kernel, basic boot actions are performed by single CPU. Then, this cpu just wakes up other cpus. The complete kernel code is written SMP transparent by making use of macros for SMP and non-SMP mode. An example of system generic smp code is given below.
4            \begin{verbatim}
5    
6            #ifdef CONFIG_SMP
7            extern int smp_call_function (void (*func) (void *info), void *info,
8                                     int retry, int wait);
9            #define smp_processor_id() (current_thread_info()->cpu)
10    
11            #else
12    
13            #define smp_call_function(func,info,retry,wait) ({ 0; })
14            #define smp_processor_id()                       0
15    
16            #endif
17            \end{verbatim}
18    
19            Thus, for a SMP kernel, the funtions/macros access the appropriate structure from the cpu subsytem while for a non-SMP kernel, the macros default to the single cpu counterpart actions.
20            \section{Boot in SMP mode} \label{smp:boot}
21            \subsection{Function smp\_init code}
22            \subsection{Function smp\_boot\_cpus code} \index{smp\_boot\_cpus}
23            \section{SMP issues related to process Management}
24            \subsection{Function smp\_tune\_scheduling code}

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26