From: Ingo Molnar <mingo@elte.hu>
To: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [patch 1/2] x86, x2apic: minimize IPI register writes using cluster groups v4
Date: Mon, 2 May 2011 15:22:32 +0200 [thread overview]
Message-ID: <20110502132232.GA3873@elte.hu> (raw)
In-Reply-To: <20110502114024.222582172@openvz.org>
* Cyrill Gorcunov <gorcunov@openvz.org> wrote:
> In the case of x2apic cluster mode we can group
> IPI register writes based on the cluster group
> instead of individual per-cpu destiantion messages.
typo.
> This reduces the apic register writes and reduces
> the amount of IPI messages (in the best case we can
> reduce it by a factor of 16).
>
> With this change, microbenchmark measuring the cost
> of flush_tlb_others(), with the flush tlb IPI being
> sent from a cpu in the socket-1 to all the logical
> cpus in socket-2 (on a Westmere-EX system that has
> 20 logical cpus in a socket) is 3x times better now
> (compared to the former 'send one-by-one' algorithm).
What kind of microbenchmark was this, could the actual results and measurement
methods be shared as well?
> v2: Suresh fixed cpumask allocation to be dynamic,
> stack allocation is not acceptable for such things
> because can be exhausted.
>
> v3: Address Ingo concerns on code style, also a note
> added just to not forget that we need merge
> probe_64/32 into some common structure.
>
> v4: Suresh discovered (and fixed) that cluster
> infomation must be updated at CPU_UP_PREPARE
> state otherwise if IPI happens too early we
> will be in touble having incomplete cluster
> sibling map.
>
> Tested-by: Suresh Siddha <suresh.b.siddha@intel.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
> ---
> arch/x86/include/asm/apic.h | 2
> arch/x86/kernel/apic/probe_64.c | 13 ++
> arch/x86/kernel/apic/x2apic_cluster.c | 167 ++++++++++++++++++++++++----------
> 3 files changed, 136 insertions(+), 46 deletions(-)
>
> Index: tip-linux-2.6/arch/x86/include/asm/apic.h
> ===================================================================
> --- tip-linux-2.6.orig/arch/x86/include/asm/apic.h
> +++ tip-linux-2.6/arch/x86/include/asm/apic.h
> @@ -178,6 +178,8 @@ extern int x2apic_phys;
> extern void check_x2apic(void);
> extern void enable_x2apic(void);
> extern void x2apic_icr_write(u32 low, u32 id);
> +extern void x2apic_init_cpu_notifier(void);
> +
> static inline int x2apic_enabled(void)
> {
> u64 msr;
> Index: tip-linux-2.6/arch/x86/kernel/apic/probe_64.c
> ===================================================================
> --- tip-linux-2.6.orig/arch/x86/kernel/apic/probe_64.c
> +++ tip-linux-2.6/arch/x86/kernel/apic/probe_64.c
> @@ -55,6 +55,15 @@ static int apicid_phys_pkg_id(int initia
> void __init default_setup_apic_routing(void)
> {
>
> + /*
> + * FIXME:
> + *
> + * Cleanup the apic routing selection by having an apic driver specific
> + * selection routine. Then all we need to do here is iterate through
> + * them to finalize the apic selection. That would get rid of the
> + * ifdef mess and most of the code here.
> + */
> +
> enable_IR_x2apic();
>
> #ifdef CONFIG_X86_X2APIC
> @@ -71,7 +80,9 @@ void __init default_setup_apic_routing(v
> #endif
>
> if (apic == &apic_flat && num_possible_cpus() > 8)
> - apic = &apic_physflat;
> + apic = &apic_physflat;
> + else if (apic == &apic_x2apic_cluster)
> + x2apic_init_cpu_notifier();
Why is there an x2apic specific function in the generic
default_setup_apic_routing() function?
Instead of that it would be cleaner to extend the apic driver functions with an
init method, which would be filled in for x2apic and left NULL for the others.
Thanks,
Ingo
next prev parent reply other threads:[~2011-05-02 13:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-02 11:34 [patch 0/2] x2apic optimization, v4 log updated Cyrill Gorcunov
2011-05-02 11:34 ` [patch 1/2] x86, x2apic: minimize IPI register writes using cluster groups v4 Cyrill Gorcunov
2011-05-02 13:22 ` Ingo Molnar [this message]
2011-05-02 14:02 ` Cyrill Gorcunov
2011-05-02 14:23 ` Cyrill Gorcunov
2011-05-02 15:05 ` Ingo Molnar
2011-05-02 15:16 ` Cyrill Gorcunov
2011-05-03 6:31 ` Ingo Molnar
2011-05-03 6:59 ` Cyrill Gorcunov
2011-05-02 18:27 ` Suresh Siddha
2011-05-02 11:34 ` [patch 2/2] x86, x2apic: Move the common bits of physical and cluster modes to x2apic.h v4 Cyrill Gorcunov
-- strict thread matches above, loose matches on Subject: below --
2011-04-30 17:14 [patch 0/2] x2apic optimization, round 4 Cyrill Gorcunov
2011-04-30 17:15 ` [patch 1/2] x86, x2apic: minimize IPI register writes using cluster groups v4 Cyrill Gorcunov
2011-05-01 17:18 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110502132232.GA3873@elte.hu \
--to=mingo@elte.hu \
--cc=gorcunov@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=suresh.b.siddha@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox