From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH for-4.19 4/9] x86/irq: describe how the interrupt CPU movement works
Date: Wed, 29 May 2024 17:28:03 +0200 [thread overview]
Message-ID: <ZldJgwu2nDGv2HJP@macbook> (raw)
In-Reply-To: <24201381-2a43-427e-a3e5-1de316d212b8@suse.com>
On Wed, May 29, 2024 at 03:57:19PM +0200, Jan Beulich wrote:
> On 29.05.2024 11:01, Roger Pau Monne wrote:
> > --- a/xen/arch/x86/include/asm/irq.h
> > +++ b/xen/arch/x86/include/asm/irq.h
> > @@ -28,6 +28,32 @@ typedef struct {
> >
> > struct irq_desc;
> >
> > +/*
> > + * Xen logic for moving interrupts around CPUs allows manipulating interrupts
> > + * that target remote CPUs. The logic to move an interrupt from CPU(s) is as
> > + * follows:
> > + *
> > + * 1. cpu_mask and vector is copied to old_cpu_mask and old_vector.
> > + * 2. New cpu_mask and vector are set, vector is setup at the new destination.
> > + * 3. move_in_progress is set.
> > + * 4. Interrupt source is updated to target new CPU and vector.
> > + * 5. Interrupts arriving at old_cpu_mask are processed normally.
> > + * 6. When an interrupt is delivered at the new destination (cpu_mask) as part
> > + * of acking the interrupt move_in_progress is cleared and move_cleanup_count
>
> Nit: A comma after "interrupt" may help reading.
>
> > + * is set to the weight of online CPUs in old_cpu_mask.
> > + * IRQ_MOVE_CLEANUP_VECTOR is sent to all CPUs in old_cpu_mask.
>
> These last two steps aren't precise enough, compared to what the code does.
> old_cpu_mask is first reduced to online CPUs therein. If the result is non-
> empty, what you describe is done. If, however, the result is empty, the
> vector is released right away (this code may be there just in case, but I
> think it shouldn't be omitted here).
I've left that out because I got the impression it made the text more
complex to follow (with the extra branch) for no real benefit, but I'm
happy to attempt to add it.
>
> > + * 7. When receiving IRQ_MOVE_CLEANUP_VECTOR CPUs in old_cpu_mask clean the
> > + * vector entry and decrease the count in move_cleanup_count. The CPU that
> > + * sets move_cleanup_count to 0 releases the vector.
> > + *
> > + * Note that when interrupt movement (either move_in_progress or
> > + * move_cleanup_count set) is in progress it's not possible to move the
> > + * interrupt to yet a different CPU.
> > + *
> > + * By keeping the vector in the old CPU(s) configured until the interrupt is
> > + * acked on the new destination Xen allows draining any pending interrupts at
> > + * the old destinations.
> > + */
> > struct arch_irq_desc {
> > s16 vector; /* vector itself is only 8 bits, */
> > s16 old_vector; /* but we use -1 for unassigned */
>
> I take it that it is not a goal to (also) describe under what conditions
> an IRQ move may actually be initiated (IRQ_MOVE_PENDING)? I ask not the
> least because the 2nd from last paragraph lightly touches that area.
Right, I was mostly focused on moves (forcefully) initiated from
fixup_irqs(), which is different from the opportunistic affinity
changes signaled by IRQ_MOVE_PENDING.
Not sure whether I want to mention this ahead of the list in a
paragraph, or just add it as a step. Do you have any preference?
Thanks, Roger.
next prev parent reply other threads:[~2024-05-29 15:28 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 9:01 [PATCH for-4.19 0/9] x86/irq: fixes for CPU hot{,un}plug Roger Pau Monne
2024-05-29 9:01 ` [PATCH for-4.19 1/9] x86/irq: remove offline CPUs from old CPU mask when adjusting move_cleanup_count Roger Pau Monne
2024-05-29 12:40 ` Jan Beulich
2024-05-29 15:15 ` Roger Pau Monné
2024-05-29 15:27 ` Jan Beulich
2024-05-29 15:34 ` Roger Pau Monné
2024-05-29 9:01 ` [PATCH for-4.19 2/9] xen/cpu: do not get the CPU map in stop_machine_run() Roger Pau Monne
2024-05-29 13:04 ` Jan Beulich
2024-05-29 15:20 ` Roger Pau Monné
2024-05-29 15:31 ` Jan Beulich
2024-05-29 15:48 ` Roger Pau Monné
2024-05-29 9:01 ` [PATCH for-4.19 3/9] xen/cpu: ensure get_cpu_maps() returns false if CPU operations are underway Roger Pau Monne
2024-05-29 13:35 ` Jan Beulich
2024-05-29 15:03 ` Roger Pau Monné
2024-05-29 15:49 ` Jan Beulich
2024-05-29 16:14 ` Roger Pau Monné
2024-05-31 7:02 ` Jan Beulich
2024-05-31 7:31 ` Roger Pau Monné
2024-05-31 8:33 ` Jan Beulich
2024-05-31 9:15 ` Roger Pau Monné
2024-05-29 9:01 ` [PATCH for-4.19 4/9] x86/irq: describe how the interrupt CPU movement works Roger Pau Monne
2024-05-29 13:57 ` Jan Beulich
2024-05-29 15:28 ` Roger Pau Monné [this message]
2024-05-31 7:06 ` Jan Beulich
2024-05-31 7:39 ` Roger Pau Monné
2024-05-29 9:01 ` [PATCH for-4.19 5/9] x86/irq: limit interrupt movement done by fixup_irqs() Roger Pau Monne
2024-05-29 9:01 ` [PATCH for-4.19 6/9] x86/irq: restrict CPU movement in set_desc_affinity() Roger Pau Monne
2024-05-29 9:01 ` [PATCH for-4.19 7/9] x86/irq: deal with old_cpu_mask for interrupts in movement in fixup_irqs() Roger Pau Monne
2024-05-29 9:01 ` [PATCH for-4.19 8/9] x86/irq: handle moving interrupts in _assign_irq_vector() Roger Pau Monne
2024-05-29 9:01 ` [PATCH for-4.19 9/9] x86/irq: forward pending interrupts to new destination in fixup_irqs() Roger Pau Monne
2024-05-29 9:33 ` Andrew Cooper
2024-05-29 9:37 ` [PATCH for-4.19 0/9] x86/irq: fixes for CPU hot{,un}plug Oleksii K.
2024-06-11 13:25 ` Jan Beulich
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=ZldJgwu2nDGv2HJP@macbook \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.