Re: what means "voluntary kernel preemption"?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 6 Apr 2007, Robert P. J. Day wrote:

>   in the kernel config menu, does "Voluntary Kernel Preemption" mean
> *only* voluntary preemption, or *in addition to* the regular forced
> preemption?  the help screen strongly suggests "in addition to", but
> i've been burned by bad help content before.  :-P

  never mind, i just RTFS and i think i have the answer.  kernel.h
contains the following snippet:

==========================
#ifdef CONFIG_PREEMPT_VOLUNTARY
extern int cond_resched(void);
# define might_resched() cond_resched()
#else
# define might_resched() do { } while (0)
#endif

#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
  void __might_sleep(char *file, int line);
# define might_sleep() \
        do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0)
#else
# define might_sleep() do { might_resched(); } while (0)
#endif

#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
==========================

  so selecting voluntary preemption simply defines possible preemption
whenever you invoke "might_sleep()" or "might_sleep_if()", that's all.
regular (forced) preemption is, of course, still in effect.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux