Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Mar 2015 00:55:06 +0300
From:      Sergey Kandaurov <pluknet@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r279699 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <CAE-mSOKhuTm-cRdHOvQ4E8EE5jjfae1QMEnjh1KZQgtQRGtb4g@mail.gmail.com>
In-Reply-To: <201503062034.t26KYSP2063973@svn.freebsd.org>
References:  <201503062034.t26KYSP2063973@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6 March 2015 at 23:34, John Baldwin <jhb@freebsd.org> wrote:
> Author: jhb
> Date: Fri Mar  6 20:34:28 2015
> New Revision: 279699
> URL: https://svnweb.freebsd.org/changeset/base/279699
>
> Log:
>   Only schedule interrupts on a single hyperthread of a modern Intel CPU core
>   by default.  Previously we used a single hyperthread on Pentium4-era
>   cores but used both hyperthreads on more recent CPUs.
>
>   MFC after:    2 weeks
>
> Modified:
>   head/sys/amd64/amd64/mp_machdep.c
>   head/sys/i386/i386/mp_machdep.c
>
> Modified: head/sys/amd64/amd64/mp_machdep.c
> ==============================================================================
> --- head/sys/amd64/amd64/mp_machdep.c   Fri Mar  6 16:43:54 2015        (r279698)
> +++ head/sys/amd64/amd64/mp_machdep.c   Fri Mar  6 20:34:28 2015        (r279699)
> @@ -828,8 +828,8 @@ set_interrupt_apic_ids(void)
>                         continue;
>
>                 /* Don't let hyperthreads service interrupts. */
> -               if (hyperthreading_cpus > 1 &&
> -                   apic_id % hyperthreading_cpus != 0)
> +               if (cpu_logical > 1 &&
> +                   apic_id % cpu_logical != 0)
>                         continue;
>
>                 intr_add_cpu(i);
>
> Modified: head/sys/i386/i386/mp_machdep.c
> ==============================================================================
> --- head/sys/i386/i386/mp_machdep.c     Fri Mar  6 16:43:54 2015        (r279698)
> +++ head/sys/i386/i386/mp_machdep.c     Fri Mar  6 20:34:28 2015        (r279699)
> @@ -842,8 +842,8 @@ set_interrupt_apic_ids(void)
>                         continue;
>
>                 /* Don't let hyperthreads service interrupts. */
> -               if (hyperthreading_cpus > 1 &&
> -                   apic_id % hyperthreading_cpus != 0)
> +               if (cpu_logical > 1 &&
> +                   apic_id % cpu_logical != 0)
>                         continue;
>
>                 intr_add_cpu(i);
>

There are another two similar cases at sys/i386/xen/mp_machdep.c
Both look like a no-op: static global never gets written data,
the condition is never satisfied.
I guess these variables can be safely reduced for clarity there:
hyperthreading_cpus, hyperthreading_cpus_mask under i386/xen.

-- 
wbr,
pluknet



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE-mSOKhuTm-cRdHOvQ4E8EE5jjfae1QMEnjh1KZQgtQRGtb4g>