From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 03/16] xen: sched: make implementing .alloc_pdata optional Date: Tue, 5 Apr 2016 18:01:13 +0200 Message-ID: <1459872073.3166.40.camel@citrix.com> References: <20160318185524.8117.74837.stgit@Solace.station> <20160318190416.8117.57233.stgit@Solace.station> <56F009BC.4020807@suse.com> <56F01C3D02000078000DEE5B@prv-mh.provo.novell.com> <1459530078.5082.289.camel@citrix.com> <5702223F02000078000E28D6@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1082935946495266903==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anTSq-0002pp-Gj for xen-devel@lists.xenproject.org; Tue, 05 Apr 2016 16:04:24 +0000 In-Reply-To: <5702223F02000078000E28D6@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Jan Beulich Cc: Juergen Gross , George Dunlap , Robert VanVossen , Josh Whitehead , Meng Xu , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org --===============1082935946495266903== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-UPFJ8TAR5mlCSHBV0Inv" --=-UPFJ8TAR5mlCSHBV0Inv Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2016-04-04 at 00:13 -0600, Jan Beulich wrote: > > > > On 01.04.16 at 19:01, wrote: > > Ok, I'll do: > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0sd->sched_priv =3D SCHED_OP(&ops, alloc_pdata, = cpu); > > =C2=A0=C2=A0=C2=A0=C2=A0if ( IS_ERR(sd->sched_priv) ) > > =C2=A0=C2=A0=C2=A0=C2=A0{ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int err =3D PTR_ERR(sd-= >sched_priv); > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0sd->sched_priv =3D NULL= ; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return err; > > =C2=A0=C2=A0=C2=A0=C2=A0} > >=20 > > Is this ok? > Depends: Can ->sched_priv be looked at by another CPU between > the first and second assignments? If yes, you need to use an > intermediary local variable. >=20 Mmm... good point. I don't see this happening, but using a local variable is more "defensive programming oriented", so I'm going for it. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-UPFJ8TAR5mlCSHBV0Inv 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 iEYEABECAAYFAlcD4UkACgkQk4XaBE3IOsRHnQCdHII73iCOd0uk9Yr5gXfrYZmB ygEAn0Akw7L1+dFj6AXETInP26vHLPEB =ko/z -----END PGP SIGNATURE----- --=-UPFJ8TAR5mlCSHBV0Inv-- --===============1082935946495266903== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============1082935946495266903==--