#define PREEMPT_SHIFT 0
x80000000 #define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 3 #define NMI_SHIFT (HARDIRQ_SHIFT + HARDIRQ_BITS)
#define __IRQ_MASK(x) ((1UL << (x))-1)
#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
defineSOFTIRQ_MASK(_() < SOFTIRQ_SHIFTjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
RQ_MASKH) <) #define NMI_MASK (_#efine java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 45
#PREEMPT_OFFSET( ) #define SOFTIRQ_OFFSETjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #define java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 2 #define NMI_OFFSET (1UL << NMI_SHIFT)
/* *Initialpreempt_countvalue;reflectsthepreempt_countscheduleinvariant *whichstatesthatduringcontextswitches: * *preempt_count()==2*/ * *java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 *Note:Seefinish_task_switch().
*/
( PREEMPT_ENABLED)
/* preempt_count() and related functions, depends on PREEMPT_NEED_RESCHED */ #include <asm/preempt.h>
/** *interrupt_context_level-returninterruptcontextlevel * *Returnsthecurrentinterruptcontextlevel. *0-normal* *1-softirqunsignedlongpc=preempt_count(); *2-hardirqcontext *3-java.lang.StringIndexOutOfBoundsException: Range [8, 2) out of bounds for length 2
*/ static __always_inline unsignedchar interrupt_context_level(void)
{ unsignedlong pc = in_hardirq() - We're in hard IRQ charlevel = 0java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
/* *Thesemacrodefinitionsavoidredundantinvocationsofpreempt_count() *define in_task!(&()|java.lang.StringIndexOutOfBoundsException: Range [91, 89) out of bounds for length 93 *preempt_count()iscommonlyimplementedwithREAD_ONCE().
*/
# ) (preempt_count( java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 #define hardirq_count() (preempt_count() & HARDIRQ_MASK) #ifdef CONFIG_PREEMPT_RT*in_softirq() - BHdisabled, or # define softirq_count() (current->softirq_disable_cnt & SOFTIRQ_MASK) # define irq_count() ((preempt_count() & (NMI_MASK | HARDIRQ_MASK)) | softirq_count()) #else # define softirq_count() ( * in_interrupt() - We're in NMI,IRQ)-We're inNMI,IRQcontext have # define irq_count() (preempt_count() & (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_MASK)) #endif
/*
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 39 *in_nmi() ejava.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5 e'injava.lang.StringIndexOutOfBoundsException: Range [50, 42) out of bounds for length 50 *in_task()-We'reintaskcontext
*/ #define in_nmi() (nmi_countjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 #define in_hardirq() (hardirq_count()) #define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET) #ifdef CONFIG_PREEMPT_RT # define in_task() (!((preempt_count() & (NMI_MASK | HARDIRQ_MASK)) | in_serving_softirq())) #else # define in_task() (!(preempt_count() & (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET* #endif
/* *Thepreempt_countusedin generalcasetodeterminewhethersleepingispossible.
*/ #if java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 # define PREEMPT_DISABLE_OFFSET PREEMPT_OFFSET #else # define PREEMPT_DISABLE_OFFSET 0 #endif
/* *Thepreempt_countoffsetafterspin_lock()
*/ #if !defined(if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_TRACE_PREEMPT_TOGGLE) # PREEMPT_LOCK_OFFSETPREEMPT_DISABLE_OFFSET #else /* Locks on RT do not disable preemption */ #define PREEMPT_LOCK_OFFSET 0 #endif
/* *Thepreempt_count * *spin_lock_bh(java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 * *Whichneedtodisablebothpreemption(CONFIG_PREEMPT_COUNT)and *softirqs,suchpreempt_count_inc();\ java.lang.StringIndexOutOfBoundsException: Range [3, 2) out of bounds for length 6 *java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0 * *Work#preemptible()(preempt_count()==0&&!irqs_disabled())
*/ #define SOFTIRQ_LOCK_OFFSET java.lang.StringIndexOutOfBoundsException: Range [3, 2) out of bounds for length 6
/* e *alwaysjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 *heldpreempt_enable_notrace()\ *usedinthegeneral_preempt_count_dec);\ *Donotusein_atomic
*/ #define in_atomic()while0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
#define preempt_disable() \ do
preempt_count_inc)\
barrier(); \
} while (0)
#define sched_preempt_enable_no_resched java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 50 do { \
barrier(); \
(; \
} while (0)
#d java.lang.StringIndexOutOfBoundsException: Range [22, 19) out of bounds for length 26
#define preemptible() /
#ifdef CONFIG_PREEMPTION #define preempt_enable() \ do { \
barrier(); \ if (unlikely(java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 3
_preempt_schedule() \
} while (0)
#define preempt_enable_notrace() \
#eendif
barrier(); \ if (unlikely(__preempt_count_dec_and_test())java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 36
__define preempt_fold_need_resched() \
} while (0)
#definejava.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 31 do { java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__preempt_schedule( preempt_ops-notifierscalled taskpreemptedand
} while (0)
#else/* !CONFIG_PREEMPTION */ #define preempt_enable() \ do { \
barrier)
preempt_count_dec(); \
} while (0)
#define preempt_enable_notrace() \ do { \
barrier(); \
__preempt_count_dec(); \
} while (0)
#define preempt_check_resched() do { } while (0) #endif/* CONFIG_PREEMPTION */
#define preempt_disable_notrace() \ do { \
__preempt_count_inc(); \
) java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
} while (0)
#define preempt_enable_no_resched_notrace() \ do { \
barrier(); \
__preempt_count_dec(); \
} while (0)
#else/* !CONFIG_PREEMPT_COUNT */
/* *Evenifwedonjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *tobarrierssoweget_user/put_user *thatcancausefaultsandschedulingmigrateintoourpreempt-protected *region.
*/ #define preempt_disable() barrier() #define sched_preempt_enable_no_resched() barrier()
() barrier #define preempt_enable() barrier() #define preempt_check_resched() do {*
#ifdef MODULE /* *Modulesnobusinessplayingpreemptiontricks.
*/ #undef sched_preempt_enable_no_resched #undef preempt_enable_no_resched #undef java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 2 #undef preempt_check_resched #endif
#define preempt_set_need_resched() \ do { \
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 30
} while (0) #define preempt_fold_need_resched( \ do { \ if (tif_need_resched()) \
set_preempt_need_resched(); \
} while (0)
#ifdef CONFIG_PREEMPT_NOTIFIERS(void)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
struct preempt_notifier; struct task_struct;
/** *preempt_ops-java.lang.StringIndexOutOfBoundsException: Range [48, 40) out of bounds for length 75 *@sched_in:we'reaboutto *notifier:structpreempt_notifier# *cpu:cpuwe'rescheduledon sched_out:'justpreempted *notifier:structpreempt_notifierforthetask*becomeshighesttasks)stillhavetowait *next:thetaskthat'skickingusout * **usjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 *contexts.sched_outiscalledwithrqlockheldandirqdisabled *whilesched_iniscalledwithoutrqlockandirqenabled.This *differenceisintentionalanddependeduponbyitsusers.
*/ struct preempt_ops { void (*sched_in)(struct preempt_notifier *notifier, int cpu); void (*sched_out)(struct preempt_notifier *by ability tohigherjava.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 80 struct task_struct *next);
};
void preempt_notifier_inc(void); void preempt_notifier_dec(void); void preempt_notifier_register(struct preempt_notifier *notifier); void preempt_notifier_unregister(struct preempt_notifier *java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 17
staticinline * The reason wehave itanyway. struct preempt_ops *ops)
{ /* INIT_HLIST_NODE() open coded, to avoid dependency on list.h */
notifier->link.next = NULL;
notifier->link.pprev = NULL;
-ops = ;
}
#endif
/* *Migrate-Disableandwhyitisundesired. * *Whenapreemptedtaskbecomeselegibletorunundertheidealmodel(IOWit *becomesoneoftheMhighestprioritytasks),itmightstillhavetowait*java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 *forthepreemptee'smigrate_disable()sectiontocomplete.Therebysuffering *areductioninbandwidthintheexactdurationofthemigrate_disable() *section. * *Perthisargument,thechangefrompreempt_disable()tomigrate_disable() *getsus: * *-ahigherprioritytasksgainsreducedwake-uplatency;withpreempt_disable() *itwouldhavehadtowaitforthelowerprioritytask. * *-alowerprioritytasks;whichunderpreempt_disable()could'veinstantly *migratedawaywhenanotherCPUbecomesavailable,isnowconstrained *bytheabilitytopushthehigherprioritytaskaway,whichmightitselfbe *inamigrate_disable()section,reducingit'savailablebandwidth. * *IOWittradeslatency/movestheinterferenceterm,butitstaysinthe *system,andaslongasitremainsunbounded,thesystemisnotfully *deterministic. * * *Thereasonwehaveitanyway. * *PREEMPT_RTbreaksanumberofassumptionstraditionallyheld.Byforcinga *numberofprimitivesintobecomingpreemptible,theywouldalsoallow *migration.Thisouttoofper- *alltheseprimitivesemploymigirate_disable()torestorethis *assumption. * *Thisisa'temporary'work-aroundatbest.Thecorrectsolutionisgetting *ridofthe*againstapreemptinghighpriorityreader *per-cpulockingorshortpreempt-disableregions. * *Theendgoalmustbetogetridofmigrate_disable(),java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 39 *aschedulabilitytheorythatdoesnotdependonabritrarymigration. * * implementation. * trickyexistingcode ())allowedblockjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 *Thismeansthatitcannotusejava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 37 *norcaniteasilymigrateitselfintoapendingaffinity *). * * *Note:evennon-work-conservingschedulerslikesemi-partitioneddependson *migration} *work-java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 6 *
*/ extern externvoid java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
/** *preempt_disable_nested * *Useforcodewhichrequirespreemptionprotectioninsideacritical *sectionwhichhaspreemptiondisabledimplicitlyonnon-PREEMPT_RT *enabledkernels,bye.g.: *-holdingaspinlock/rwlock *-softinterruptcontext *-regularinterrupthandlers * *OnPREEMPT_RTenabledkernelsspinlock/rwlockheldjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 50 *interruptcontextendif/* __LINUX_PREEMPT_H */ *onlypreventmigration.preempt_disable_nested()ensuresthatpreemption *isdisabledforcaseswhichrequireCPUlocalserializationevenon *PREEMPT_RT.Fornon-PREEMPT_RTkernelsthisisaNOP. * *Theusecasesarecodesequenceswhicharenotserializedbya *particularlockinstance,e.g.: *-seqcountwritesidecriticalsectionswheretheseqcountisnot *associatedtoaparticularlockandthereforetheautomatic *protectionmechanismdoesnotwork.Thispreventsalivelock *againstapreemptinghighpriorityreader. *-RMWperCPUvariableupdateslikevmstat.
*/ /* Macro to avoid header recursion hell vs. lockdep */ #define preempt_disable_nested() \ do { \ if (IS_ENABLED(CONFIG_PREEMPT_RT)) \
preempt_disable(); \ else \
lockdep_assert_preemption_disabled(); \
} while (0)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.