[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: [PATCH 14/15] [swiotlb] Move initialization (swiotlb_init) and its friends in swiotlb-default.c



> > +void __init
> > +swiotlb_init(int verbose)
> > +{
> > +   swiotlb_register_engine(&swiotlb_ops);
> > +   swiotlb_init_with_default_size(&swiotlb_ops, 64 * (1<<20),
> > +                                   verbose);       /* default to 64MB */
> > +}
> 
> I'd expect the swiotlb-default file to have only private impl. of the
> swiotlb_engine.  Shouldn't this and the init stay in swiotlb.c?  Also,

Hmm, were you thinking that it might make sense to pass in
a swiotlb_ops to swiotlb_init so that it can make the right assignments?

The reason why I stuck here was that the swiotlb_ops needed to be
visible to this function, and having it in swiotlb.c would mean it must
now include the header definition for swiotlb-defualt.h.

> would you ever call swiotlb_init w/out register_engine, why not move
> register to the swiotlb_init?

In essence combine swiotlb_register_engine with swiotlb_init_with_default_size?

There would  still be a need for late call mechanism. 
Perhaps having two variants of swiotlb_init?: swiotlb_early_init(struct
swiotlb_engine *swiotlb_ops) and swiotlb_late_init(struct swiotlb_engine
*swiotlb_ops)?

Or perhaps just pass in an argument: swiotlb_init(int late)?

Furthermore have this new swiotlb_init detect if some of the fields
(start ,end, overflow_buffer) have been allocated and if so skip the
default allocation altogether?


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.