[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v9 07/10] xen: delay allocation of grant table sub structures
On 22/09/17 16:43, Jan Beulich wrote: >>>> On 22.09.17 at 13:41, <jgross@xxxxxxxx> wrote: >> Delay the allocation of the grant table sub structures in order to >> allow modifying parameters needed for sizing of these structures at a >> per domain basis. Allocate the structures and the table frames only >> from grant_table_set_limits() (dom0: from grant_table_create()). > > I think this last part is stale now - it's uniformly grant_table_init() > where this happens. > >> + if ( d->domain_id == 0 ) >> { >> - if ( (t->shared_raw[i] = alloc_xenheap_page()) == NULL ) >> - goto no_mem_4; >> - clear_page(t->shared_raw[i]); >> + grant_write_lock(t); >> + ret = grant_table_init(d, t); >> + grant_write_unlock(t); >> } > > With this and ... > >> @@ -3653,8 +3650,9 @@ int grant_table_set_limits(struct domain *d, unsigned >> int grant_frames, >> >> grant_write_lock(gt); >> >> - ret = 0; >> - /* Set limits, alloc needed arrays. */ >> + /* Set limits. */ >> + if ( !gt->active ) >> + ret = grant_table_init(d, gt); >> >> grant_write_unlock(gt); > > ... this, wouldn't it be more natural now to acquire and release the > lock in grant_table_init()? Right. The test for !gt->active can be dropped, as grant_table_init() will return -EBUSY in this case anyway. Juergen _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |