On Sat, Sep 26, 2015 at 7:15 PM, Richard Henderson <r...@twiddle.net> wrote:
> On 09/24/2015 01:32 AM, Alvise Rigo wrote: > > + if (cpu == smp_cpus) { > > + if (smp_cpus >= EXCL_BITMAP_CELL_SZ) { > > + return bitmap[EXCL_BITMAP_GET_BYTE_OFFSET(addr)]; > > + } else { > > + return bitmap[EXCL_BITMAP_GET_BYTE_OFFSET(addr)] & > > + ((1 << smp_cpus) - 1); > > + } > > + } else { > > + return bitmap[EXCL_BITMAP_GET_BYTE_OFFSET(addr)] & (1 << > EXCL_IDX(cpu)); > > + } > > How can more than one cpu have the same address exclusively? > The bitmap is used to track which cpus have the EXCL flag set for that particular page. A bit set to 0 assures that all the corresponding cpus are following the slow-path in that page. > > Isn't this scheme giving a whole page to a cpu, not a cacheline? > The actual exclusive range in set in CPUArchState, this is the information that we evaluate to see whether there was a conflict or not. Regards, alvise > That's going to cause ll/sc conflicts where real hardware wouldn't. > > > > r~ >