linux/lib/smp_processor_id.c
<<
>>
Prefs
   1/*
   2 * lib/smp_processor_id.c
   3 *
   4 * DEBUG_PREEMPT variant of smp_processor_id().
   5 */
   6#include <linux/export.h>
   7#include <linux/kallsyms.h>
   8#include <linux/sched.h>
   9
  10notrace unsigned int debug_smp_processor_id(void)
  11{
  12        unsigned long preempt_count = preempt_count();
  13        int this_cpu = raw_smp_processor_id();
  14
  15        if (likely(preempt_count))
  16                goto out;
  17
  18        if (irqs_disabled())
  19                goto out;
  20
  21        /*
  22         * Kernel threads bound to a single CPU can safely use
  23         * smp_processor_id():
  24         */
  25        if (cpumask_equal(tsk_cpus_allowed(current), cpumask_of(this_cpu)))
  26                goto out;
  27
  28        /*
  29         * It is valid to assume CPU-locality during eurly bE2s3" cl 28        ="comment">    ir_id.c#L20" id="L20" cl3ss="l30e" name="L24">  24         */
  25        isystem_    href="+code=notrsystem_    he" na!ref">this_cpuSYSTEM_RUNNINGref="+code=notrSYSTEM_RUNNINGss="s         */
  26                goto out;
  27
  28        /*
   5        ="comme_process3r_id.c#L26" id="L26" cl3ss="l36e" name="L24">  24         */
likely((  27
  !"sref">likely"> k_r  hli "> k_r  hli irqs_disabled())
    4r_id.c#L20" id="L20" cl4ss="l40e" name="L26">  26                goto _enss="out;
  27
likely"> kuef="+code=notra>"> k="sref">cpumask_of  2stme C">"BUG:glee CPmment">         *  in a>( *
  26  28   stme C">"_of<: %s/%d\n"class=",comment"> *
  26 = p - 1sref">current)>(linef">current)current)>(linef">currentpraw_smp_processorpraw_sm_processor_id();
likely"> _symbo+code=cpumask_eqa>"> _symbo+="sref>  28   stme C">"_s="erent"%s\n"class=", (>   )"sref">likely();
likely  27
  10  27
likely(();
    5r_id.c#L20" id="L20" cl5ss="l5ne" name="L10">  10  27
cpumask_of(();
  27
  10cpumask_ofdebug_sm_processor_id();
  27
(ss="head

esults"
	 >
 de/linuxityer">
The original LXR software by the me="L27">http://sourceforge.net/a>ojects/lxr">LXR emailto:lxr@d.h" .no">lxr@d.h" .noass=.
esults"	 >
 de/linusubxityer">
lxr.d.h" .no kindly hosted by me="L27">http://www.redpill-d.ha>o.no">Redpill L.ha>o ASass=sra>ovidereof L.hux e
s servi hrthrece 1995.
esults"
	/bodys"	/htmlad