From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 7/7] xen: sched_rt: print useful affinity info when dumping Date: Tue, 17 Mar 2015 13:51:07 +0000 Message-ID: <1426600262.32500.76.camel@citrix.com> References: <20150316165642.10279.86684.stgit@Solace.station> <20150316170544.10279.13073.stgit@Solace.station> <55072987.6000507@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4091441804448156630==" Return-path: In-Reply-To: <55072987.6000507@eu.citrix.com> Content-Language: en-US List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: "Keir (Xen.org)" , "xumengpanda@gmail.com" , "JBeulich@suse.com" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============4091441804448156630== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-LfZbJX6+TGAHxRIWZzHJ" --=-LfZbJX6+TGAHxRIWZzHJ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2015-03-16 at 19:05 +0000, George Dunlap wrote: > On 03/16/2015 05:05 PM, Dario Faggioli wrote: > > @@ -218,7 +224,6 @@ __q_elem(struct list_head *elem) > > static void > > rt_dump_vcpu(const struct scheduler *ops, const struct rt_vcpu *svc) > > { > > - char cpustr[1024]; > > cpumask_t *cpupool_mask; > > =20 > > ASSERT(svc !=3D NULL); > > @@ -229,10 +234,22 @@ rt_dump_vcpu(const struct scheduler *ops, const s= truct rt_vcpu *svc) > > return; > > } > > =20 > > - cpumask_scnprintf(cpustr, sizeof(cpustr), svc->vcpu->cpu_hard_affi= nity); > > + cpupool_mask =3D cpupool_scheduler_cpumask(svc->vcpu->domain->cpup= ool); > > + /* > > + * We can't just use 'cpumask_scratch' because the dumping can > > + * happen from a pCPU outside of this scheduler's cpupool, and > > + * hence it's not right to use the pCPU's scratch mask (which > > + * may even not exist!). On the other hand, it is safe to use > > + * svc->vcpu->processor's own scratch space, since we own the > > + * runqueue lock. >=20 > Since we *hold* the lock. >=20 Right, thanks. > > + */ > > + cpumask_and(_cpumask_scratch[svc->vcpu->processor], cpupool_mask, > > + svc->vcpu->cpu_hard_affinity); > > + cpulist_scnprintf(keyhandler_scratch, sizeof(keyhandler_scratch), > > + _cpumask_scratch[svc->vcpu->processor]); >=20 > Just a suggestion, would it be worth making a local variable to avoid > typing this long thing twice? =20 > It probably would. > Then you could also put the comment about > using the svc->vcpu->processor's scratch space above the place where you > set the local variable, while avoiding breaking up the logic of the > cpumask operations. >=20 I like this, will do. Regards, Dario --=-LfZbJX6+TGAHxRIWZzHJ 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 iEYEABECAAYFAlUIMUcACgkQk4XaBE3IOsSkZACeL8jRhKnHCecoM/XPz3QJn1e9 fPkAniOtXp6Z50aKvJGTN2NHE9ti2pID =/Lil -----END PGP SIGNATURE----- --=-LfZbJX6+TGAHxRIWZzHJ-- --===============4091441804448156630== 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 --===============4091441804448156630==--