[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 03/16] xen: sched: make implementing .alloc_pdata optional
On Mon, 2016-04-04 at 00:13 -0600, Jan Beulich wrote: > > > > On 01.04.16 at 19:01, <dario.faggioli@xxxxxxxxxx> wrote: > > Ok, I'll do: > > > > sd->sched_priv = SCHED_OP(&ops, alloc_pdata, cpu); > > if ( IS_ERR(sd->sched_priv) ) > > { > > int err = PTR_ERR(sd->sched_priv); > > > > sd->sched_priv = NULL; > > return err; > > } > > > > 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. > 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 -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) Attachment:
signature.asc _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |