From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Bader Subject: Re: Question about apic ipi interface Date: Tue, 28 May 2013 14:50:48 +0200 Message-ID: <51A4A828.5040602@canonical.com> References: <51765D56.1000906@canonical.com> <518A7CC0.6030504@canonical.com> <20130522194007.GE10617@phenom.dumpdata.com> <519DE068.1050205@canonical.com> <20130528124308.GA26214@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2338876446264259850==" Return-path: In-Reply-To: <20130528124308.GA26214@phenom.dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: Ben Guthro , "xen-devel@lists.xensource.com" , zhenzhong.duan@oracle.com, Lin Ming List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============2338876446264259850== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig99C04E48934AE2AF315C05D1" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig99C04E48934AE2AF315C05D1 Content-Type: multipart/mixed; boundary="------------000605070705010409060203" This is a multi-part message in MIME format. --------------000605070705010409060203 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 28.05.2013 14:43, Konrad Rzeszutek Wilk wrote: > On Thu, May 23, 2013 at 11:24:56AM +0200, Stefan Bader wrote: >> On 22.05.2013 21:40, Konrad Rzeszutek Wilk wrote: >>> On Wed, May 08, 2013 at 06:26:40PM +0200, Stefan Bader wrote: >>>> On 23.04.2013 12:07, Stefan Bader wrote: >>>>> I was looking at some older patch and there is one thing I do not u= nderstand. >>>>> >>>>> commit f447d56d36af18c5104ff29dcb1327c0c0ac3634 >>>>> xen: implement apic ipi interface >>>>> >>>>> Specifically there the implementation of xen_send_IPI_mask_allbutse= lf(). >>>>> >>>>> void xen_send_IPI_mask_allbutself(const struct cpumask *mask, >>>>> int vector) >>>>> { >>>>> unsigned cpu; >>>>> unsigned int this_cpu =3D smp_processor_id(); >>>>> >>>>> if (!(num_online_cpus() > 1)) >>>>> return; >>>>> >>>>> for_each_cpu_and(cpu, mask, cpu_online_mask) { >>>>> if (this_cpu =3D=3D cpu) >>>>> continue; >>>>> >>>>> xen_smp_send_call_function_single_ipi(cpu); >>>>> } >>>>> } >>>>> >>>>> Why is this using xen_smp_send_call_function_single_ipi()? This dum= ps the >>>>> supplied vector and always uses XEN_CALL_FUNCTION_SINGLE_VECTOR. In= contrast the >>>>> xen_send_IPI_all() and xen_send_IPI_self() keep the (mapped) vector= =2E >>>>> >>>>> Mildly wondering about whether call function would need special cas= ing (just >>>>> because xen_smp_send_call_function_ipi() is special). But I don't h= ave the big >>>>> picture there. >>>>> >>>> >>>> This never got really answered, so lets try this: Does the following= patch seem >>>> to make sense? I know, it has not caused any obvious regressions but= at least >>>> this would look more in agreement with the other code. It has not bl= own up on a >>>> normal boot either. >>>> Ben, is there a simple way that I would trigger the problem you had?= >>>> >>>> -Stefan >>>> >>>> >>>> From e13703426f367c618f2984d376289b197a8c0402 Mon Sep 17 00:00:00 20= 01 >>>> From: Stefan Bader >>>> Date: Wed, 8 May 2013 16:37:35 +0200 >>>> Subject: [PATCH] xen: Clean up apic ipi interface >>>> >>>> Commit f447d56d36af18c5104ff29dcb1327c0c0ac3634 introduced the >>>> implementation of the PV apic ipi interface. But there were some >>>> odd things (it seems none of which cause really any issue but >>>> maybe they should be cleaned up anyway): >>>> - xen_send_IPI_mask_allbutself (and by that xen_send_IPI_allbutself= ) >>>> ignore the passed in vector and only use the CALL_FUNCTION_SINGLE= >>>> vector. While xen_send_IPI_all and xen_send_IPI_mask use the vect= or. >>>> - physflat_send_IPI_allbutself is declared unnecessarily. It is nev= er >>>> used. >>>> >>>> This patch tries to clean up those things. >>>> >>>> Signed-off-by: Stefan Bader >>> >>> Looks very similar to=20 >>> >>> https://patchwork.kernel.org/patch/2414311/ >>> >>> So two people pointing out the same thing.=20 >> >> Yeah, from this discussion and further looking into it I am relatively= sure this >> has no visible effect either way because there currently is no user of= the "odd" >> implementations. >=20 > OK, could you resend your patch properly please? Somehow I cannot apply= > your patch: >=20 > patching file arch/x86/xen/smp.c > patch: **** malformed patch at line 136: ask *mask, >=20 Thunderbird joy... as attachment this time... -Stefan --------------000605070705010409060203 Content-Type: text/x-diff; name="0001-xen-Clean-up-apic-ipi-interface.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-xen-Clean-up-apic-ipi-interface.patch" =46rom c687d9bcf7d3b3f2fd81dcf1afbbc1ebb4559f29 Mon Sep 17 00:00:00 2001 From: Stefan Bader Date: Wed, 8 May 2013 16:37:35 +0200 Subject: [PATCH] xen: Clean up apic ipi interface Commit f447d56d36af18c5104ff29dcb1327c0c0ac3634 introduced the implementation of the PV apic ipi interface. But there were some odd things (it seems none of which cause really any issue but maybe they should be cleaned up anyway): - xen_send_IPI_mask_allbutself (and by that xen_send_IPI_allbutself) ignore the passed in vector and only use the CALL_FUNCTION_SINGLE vector. While xen_send_IPI_all and xen_send_IPI_mask use the vector. - physflat_send_IPI_allbutself is declared unnecessarily. It is never used. This patch tries to clean up those things. Signed-off-by: Stefan Bader --- arch/x86/xen/smp.c | 10 ++++------ arch/x86/xen/smp.h | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 8ff3799..fb44426 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c @@ -576,24 +576,22 @@ void xen_send_IPI_mask_allbutself(const struct cpum= ask *mask, { unsigned cpu; unsigned int this_cpu =3D smp_processor_id(); + int xen_vector =3D xen_map_vector(vector); =20 - if (!(num_online_cpus() > 1)) + if (!(num_online_cpus() > 1) || (xen_vector < 0)) return; =20 for_each_cpu_and(cpu, mask, cpu_online_mask) { if (this_cpu =3D=3D cpu) continue; =20 - xen_smp_send_call_function_single_ipi(cpu); + xen_send_IPI_one(cpu, xen_vector); } } =20 void xen_send_IPI_allbutself(int vector) { - int xen_vector =3D xen_map_vector(vector); - - if (xen_vector >=3D 0) - xen_send_IPI_mask_allbutself(cpu_online_mask, xen_vector); + xen_send_IPI_mask_allbutself(cpu_online_mask, vector); } =20 static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id) diff --git a/arch/x86/xen/smp.h b/arch/x86/xen/smp.h index 8981a76..c7c2d89 100644 --- a/arch/x86/xen/smp.h +++ b/arch/x86/xen/smp.h @@ -5,7 +5,6 @@ extern void xen_send_IPI_mask(const struct cpumask *mask,= extern void xen_send_IPI_mask_allbutself(const struct cpumask *mask, int vector); extern void xen_send_IPI_allbutself(int vector); -extern void physflat_send_IPI_allbutself(int vector); extern void xen_send_IPI_all(int vector); extern void xen_send_IPI_self(int vector); =20 --=20 1.7.9.5 --------------000605070705010409060203-- --------------enig99C04E48934AE2AF315C05D1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQIcBAEBCgAGBQJRpKgpAAoJEOhnXe7L7s6jj30QAI8DTxEQ5hqu2JAAQ0Y+NS6B HEJHceliRcztcQVfTw2fFCNqp11UvGxfFI1Z+vxoyfLlhFoj+GXhDLd9B+sb81o9 nW0M+qTSyaVNF9uTqMZbA4wI9SfZHp4Muh4wD9nHcLVEbsQFmWnPrXBIx/cg4xaF 0K/3qvMbyufqPHhIDrR3rzjJ3KZxKwwv+5T8+4qguQ1XO+gdOiiOPPLWN3hUBwfJ Wi4mQ21/yLMLpXZFHPYQLUX7x+CMUTVpkxTND9NGHXX+i2xjsiDTRQfjicH6olh/ 5C/z5V4m6SKXvvFPcbjEATlaPut1wu6AReumNTA+IAKwGXbt3lK3puL+3cb3wbF0 h0OiXBAnIqA+xWnX5xjDKwWM6zB+b1eYAhoBK6PlKKFGi12Y3k3wYAnMK2C9fXEX LFvtgBaF8j5JU/KOKLBxX9nKSC6behzLlomHwM4Dh31R/mtGDrrdQc6S4WOvFAzP iLEq5Weafx5rq7Zo2U/Vm/bLDI5vxiKQXhM874ftS/4LkSBD5wfzQt75PRq60VdJ TWX9kVnFKLIq8QrFWFvZaPpTKBqFmRkFIErbVREjRQZqaQuZMUd+RhwXkhZCt8wz Q9rJH+5yYFzoie3PgEL48ElZ8lttiQn8ruUKvtUjOJY/Aj0uKbALKIW6SXpAtzWB 25gbqfeFi4wWvQXxzOcd =jyyR -----END PGP SIGNATURE----- --------------enig99C04E48934AE2AF315C05D1-- --===============2338876446264259850== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============2338876446264259850==--