~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/scheduler/sched-arch.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/scheduler/sched-arch.rst (Version linux-6.12-rc7) and /Documentation/scheduler/sched-arch.rst (Version linux-4.16.18)


  1 ==============================================    
  2 CPU Scheduler implementation hints for archite    
  3 ==============================================    
  4                                                   
  5         Nick Piggin, 2005                         
  6                                                   
  7 Context switch                                    
  8 ==============                                    
  9 1. Runqueue locking                               
 10 By default, the switch_to arch function is cal    
 11 locked. This is usually not a problem unless s    
 12 take the runqueue lock. This is usually due to    
 13 the context switch.                               
 14                                                   
 15 To request the scheduler call switch_to with t    
 16 you must `#define __ARCH_WANT_UNLOCKED_CTXSW`     
 17 (typically the one where switch_to is defined)    
 18                                                   
 19 Unlocked context switches introduce only a ver    
 20 penalty to the core scheduler implementation i    
 21                                                   
 22 CPU idle                                          
 23 ========                                          
 24 Your cpu_idle routines need to obey the follow    
 25                                                   
 26 1. Preempt should now disabled over idle routi    
 27    be enabled to call schedule() then disabled    
 28                                                   
 29 2. need_resched/TIF_NEED_RESCHED is only ever     
 30    be cleared until the running task has calle    
 31    threads need only ever query need_resched,     
 32    clear it.                                      
 33                                                   
 34 3. When cpu_idle finds (need_resched() == 'tru    
 35    schedule(). It should not call schedule() o    
 36                                                   
 37 4. The only time interrupts need to be disable    
 38    need_resched is if we are about to sleep th    
 39    the next interrupt (this doesn't provide an    
 40    need_resched, it prevents losing an interru    
 41                                                   
 42         4a. Common problem with this type of s    
 43                                                   
 44                 local_irq_disable();              
 45                 if (!need_resched()) {            
 46                         local_irq_enable();       
 47                         *** resched interrupt     
 48                         __asm__("sleep until n    
 49                 }                                 
 50                                                   
 51 5. TIF_POLLING_NRFLAG can be set by idle routi    
 52    need an interrupt to wake them up when need    
 53    In other words, they must be periodically p    
 54    although it may be reasonable to do some ba    
 55    a low CPU priority.                            
 56                                                   
 57       - 5a. If TIF_POLLING_NRFLAG is set, and     
 58         an interrupt sleep, it needs to be cle    
 59         barrier issued (followed by a test of     
 60         interrupts disabled, as explained in 3    
 61                                                   
 62 arch/x86/kernel/process.c has examples of both    
 63 sleeping idle functions.                          
 64                                                   
 65                                                   
 66 Possible arch/ problems                           
 67 =======================                           
 68                                                   
 69 Possible arch problems I found (and either tri    
 70                                                   
 71 sparc - IRQs on at this point(?), change local    
 72       - TODO: needs secondary CPUs to disable     
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php