From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v2 3/6] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started. Date: Fri, 18 Aug 2017 19:06:20 +0200 Message-ID: <1503075980.7157.10.camel@citrix.com> References: <150290125292.24854.17418548557562763544.stgit@Solace.fritz.box> <150290194976.24854.16620727129787611822.stgit@Solace.fritz.box> <20170817130326.GA19856@deinos.phlegethon.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4834125576017448753==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dilAc-0008Lr-7G for xen-devel@lists.xenproject.org; Fri, 18 Aug 2017 17:34:54 +0000 In-Reply-To: <20170817130326.GA19856@deinos.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Tim Deegan Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Julien Grall , Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org --===============4834125576017448753== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-V6BYk7RGlxM8+YniQ+dZ" --=-V6BYk7RGlxM8+YniQ+dZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2017-08-17 at 14:03 +0100, Tim Deegan wrote: > At 18:45 +0200 on 16 Aug (1502909149), Dario Faggioli wrote: > > + > > +/* > > + * The CPU is becoming idle, so no more read side critical > > + * sections, and one more step toward grace period. > > + */ > > +void rcu_idle_enter(unsigned int cpu) > > +{ > > +=C2=A0=C2=A0=C2=A0=C2=A0/* > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* During non-boot CPU bringup and resume= , until this function > > is > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* called for the first time, it's fine t= o find our bit > > already set. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*/ > > +=C2=A0=C2=A0=C2=A0=C2=A0ASSERT(!cpumask_test_cpu(cpu, &rcu_ctrlblk.idl= e_cpumask) || > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(sys= tem_state < SYS_STATE_active || system_state >=3D > > SYS_STATE_resume)); >=20 > Does every newly started CPU immediately idle?=C2=A0=C2=A0If not, then it= might > run in an RCU read section but excluded from the grace period > mechanism. >=20 They do call startup_cpu_idle_loop() pretty soon, yes (right at the end of start_secondary(), on both x86 and ARM). But technically, yes, there is a window for that. > It seems like it would be better to start with the idle_cpumask > empty, > and rely on online_cpumask to exclude CPUs that aren't running. > I thought about that too, but then ended up doing it the other way (i.e., having the mask fully set). Now, I just tried to initialize it to "all clear"... It works, and I have to admit that I like it better. :-) As I'm going on vacations for a couple of weeks, I'll send v3 right now, with just this changed, so it could even be checked-in, if others too are happy with this, and the rest of the patches (if not, we'll talk about it when I'm back :-P). Thanks and Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-V6BYk7RGlxM8+YniQ+dZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJZlx6MAAoJEBZCeImluHPu9o8QAL+YVXXI8rzdOkjofSaz0jEO 2KGzHsZ4AcRJ61gHZGNf83n3WZuCxdvRfwmgIL/pkn26nl/aDm2rFIamaJPDYXPS We/EXMnke5lgBlEsFbgb1DOSmiYKZcpZLawKH+2BAsNN7lXTiCe8MVZ6F9S+Wull VAlHG9PtCHbRSjz/WoIHrTmGHj5gMKzGIO7z1c87/TF+aYQQCRR6J2hqECgtospl HUUnkFCzMO3oSlHE1sTCGU52Shj4IZ2v4WsqH0N8/t08xgcajIjr9UaC3aQddkGM iQuDYhVmam9EJduNDzAbnY2vihvo64D0lAjANCD6FleWpkIlC3KPH+6U6UnBSDsA yLop7eglUpWJLVPS/UEfEQlIDwj7ICMmi3zylRmU5bY2SK0eKycfvEpzela6BBD5 qKD13bHvETxr6vJ9VtBRYquX9Ny8JKGrkvj5Gd1GulefAa8Duz3w0nxxZk0LKIlH x12VEfGxbjXkTc7EjQlHFqgW8CYsVWoV7xxKuctXCbDFIp3qPgwaV0Ftx+LRRlRj 4fYcJhHka+djpgidyINLVGQonaUNnVWls5gG9eOxlsiFHE/xLHEF9bAg3Qaoy8mC F7+Dr7ac5EmNMy1ONwgD6JysvzVqZKFrYvTc2VeUEbZXvSrXjWyJfERy0JLQPVu+ rPOqvP8qE/TbbhV3Xm89 =5WtT -----END PGP SIGNATURE----- --=-V6BYk7RGlxM8+YniQ+dZ-- --===============4834125576017448753== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============4834125576017448753==--