Пример #1
0
static bool __cpuinit match_mc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
{
	if (c->phys_proc_id == o->phys_proc_id)
		return topology_sane(c, o, "mc");

	return false;
}
static bool __cpuinit match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
{
    if (cpu_has_topoext) {
        int cpu1 = c->cpu_index, cpu2 = o->cpu_index;

        if (c->phys_proc_id == o->phys_proc_id &&
                per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2) &&
                c->compute_unit_id == o->compute_unit_id)
            return topology_sane(c, o, "smt");

    } else if (c->phys_proc_id == o->phys_proc_id &&
               c->cpu_core_id == o->cpu_core_id) {
        return topology_sane(c, o, "smt");
    }

    return false;
}
static bool __cpuinit match_mc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
{
    if (c->phys_proc_id == o->phys_proc_id) {
        if (cpu_has(c, X86_FEATURE_AMD_DCM))
            return true;

        return topology_sane(c, o, "mc");
    }
    return false;
}
static bool __cpuinit match_llc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
{
    int cpu1 = c->cpu_index, cpu2 = o->cpu_index;

    if (per_cpu(cpu_llc_id, cpu1) != BAD_APICID &&
            per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2))
        return topology_sane(c, o, "llc");

    return false;
}