From: Thomas Gleixner <tglx@linutronix.de>
To: Jianyu Zhan <nasa4836@gmail.com>
Cc: mingo@redhat.com, "H. Peter Anvin" <hpa@zytor.com>,
Aravind.Gopalakrishnan@amd.com, brgerst@gmail.com, bp@suse.de,
feng.wu@intel.com, jiang.liu@linux.intel.com,
Tejun Heo <tj@kernel.org>,
dvlasenk@redhat.com, penberg@cs.helsinki.fi,
Yinghai Lu <yhlu.kernel@gmail.com>,
andi@firstfloor.org, Andy Lutomirski <luto@kernel.org>,
ajm@sgi.com, Yinghai Lu <yinghai@kernel.org>,
Akinobu Mita <akinobu.mita@gmail.com>,
x86@kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] x86/irq: update first_system_vector only when X86_LOCAL_PIC is on
Date: Sun, 13 Mar 2016 08:55:07 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.11.1603130847140.3657@nanos> (raw)
In-Reply-To: <CAHz2CGVZocGSuYa2xq4UeCrGg=CU29XejTfLS0KxFitAttrC4g@mail.gmail.com>
On Sun, 13 Mar 2016, Jianyu Zhan wrote:
> On Sun, Mar 13, 2016 at 2:35 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >> On Sun, Mar 13, 2016 at 4:08 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >> > This is pointless, because it's only called when local apic is enabled as all
> >> > call sites of alloc_intr_gate() depend on CONFIG_X86_LOCAL_APIC ....
> >>
> >> Not exactly, currently at least smp_intr_init() DOES NOT depend on
> >> CONFIG_X86_LOCAL_APIC:
> >>
> >> static void __init smp_intr_init(void)
> >> {
> >> #ifdef CONFIG_SMP
> >
> > It does, because CONFIG_SMP enables CONFIG_X86_LOCAL_APIC
> >
>
> It is. Once CONFIG_SMP is on, CONFIG_X86_LOCAL_APIC will be turned on.
>
> So the situation should be described as: first_system_vector will be updated
> on system vector init, on SMP case(which indirectly implies
> CONFIG_X86_LOCAL_APIC)
> and on explicit CONFIG_X86_LOCAL_APIC(X86_UP_APIC).
>
> So initial code:
>
> #ifndef CONFIG_X86_LOCAL_APIC
> #define first_system_vector NR_VECTORS
> #endif
>
> is actually not needed, becaused it won't ever change on !
> CONFIG_X86_LOCAL_APIC
> case.
It will never ever be updated in that case, simply because nothing uses it.
> > Do you actually understand how all that works together?
> >
>
> So the dependency should be reversed, and it should be like this:
>
> Currently we have CONFIG_X86_LOCAL_APIC detangle from CONFIG_SMP
> (we can enable CONFIG_X86_LOCAL_APIC on 32-bit uniprocessor).
And what's the benefit of this?
> Among these stands out IRQ_WORK, which neither depends on SMP nor
> CONFIG_X86_LOCAL_APIC.
>
> So the new init funciton is look like(from [2/3]):
>
> static void __init system_intr_init(void)
> {
> smp_intr_init();
>
> #ifdef CONFIG_IRQ_WORK
> alloc_intr_gate(IRQ_WORK_VECTOR, irq_work_interrupt);
> #endif
And that is completely wrong. IRQ_WORK can work independent of LOCAL_APIC, but
if LOCAL_APIC is disabled it does not use the interrupt, simply because there
is no way to trigger it. That setup is inside #ifdef CONFIG_X86_LOCAL_APIC for
exactly that reason.
Just because IRQ_WORK has no config dependency on LOCAL APIC that does not
mean it uses the interrupt gate unconditionally.
The code is correct as is and there is no reason to shuffle it in circles for
no value.
Thanks,
tglx
next prev parent reply other threads:[~2016-03-13 7:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-12 15:05 [PATCH 0/3] x86/irq: Refactor special vector definition and cleanup Jianyu Zhan
2016-03-12 15:06 ` [PATCH 1/3] x86/asm/irq: Rearrange definitoin of specical irq vectors " Jianyu Zhan
2016-03-12 15:10 ` [PATCH 2/3] x86/irq: refactor native_init_IRQ Jianyu Zhan
2016-03-12 15:30 ` kbuild test robot
2016-03-12 15:36 ` Jianyu Zhan
2016-03-12 16:25 ` kbuild test robot
2016-03-12 15:10 ` [PATCH 3/3] x86/irq: update first_system_vector only when X86_LOCAL_PIC is on Jianyu Zhan
2016-03-12 20:08 ` Thomas Gleixner
2016-03-13 1:28 ` Jianyu Zhan
2016-03-13 6:35 ` Thomas Gleixner
2016-03-13 7:25 ` Jianyu Zhan
2016-03-13 7:41 ` Jianyu Zhan
2016-03-13 7:55 ` Thomas Gleixner [this message]
2016-03-13 8:20 ` Jianyu Zhan
2016-03-13 9:11 ` Thomas Gleixner
2016-03-13 9:29 ` Jianyu Zhan
2016-03-13 9:33 ` Thomas Gleixner
2016-03-13 10:08 ` Jianyu Zhan
2016-03-13 11:12 ` Thomas Gleixner
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=alpine.DEB.2.11.1603130847140.3657@nanos \
--to=tglx@linutronix.de \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=ajm@sgi.com \
--cc=akinobu.mita@gmail.com \
--cc=andi@firstfloor.org \
--cc=bp@suse.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=feng.wu@intel.com \
--cc=hpa@zytor.com \
--cc=jiang.liu@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=nasa4836@gmail.com \
--cc=penberg@cs.helsinki.fi \
--cc=tj@kernel.org \
--cc=x86@kernel.org \
--cc=yhlu.kernel@gmail.com \
--cc=yinghai@kernel.org \
/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
all inboxes | Powered by JetHome®