volatile question

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

 



In the mips, mips64, and even the i386 arch, arch/kernel/smp.c has
this in smp_call_function:

        spin_lock(&call_lock);
        call_data = &data;

        /* Send a message to all other CPUs and wait for them to respond */
        for (i = 0; i < smp_num_cpus; i++)
                if (i != cpu)
                        core_send_ipi(i, SMP_CALL_FUNCTION);

call_data isn't volatile, it's a plain static *. So how can we be sure
that "call_data = &data" does anything other than change a register?

The i386 has a wb() after the assignment; we don't even have that.

greg




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux