Dan Magenheimer
2008-Oct-15 17:47 UTC
[Xen-devel] [RFC][PATCH] add tlsf option for xmalloc
This patch is a first step for replacing the current xmalloc engine with a tlsf-based engine. The first patch simply adds Nitin Gupta''s current tlsf-kmod files to Xen and the second modifies them (and xmalloc) to adapt them to work with Xen. The tlsf engine can be turned on (and then overrides the xmalloc engine) with a Xen boot option of "tlsf". This defaults to off, so the patch should have no effect without the boot option. Note that this is compile-tested but not run tested yet. I thought I''d get feedback on the approach before I get much further. Thanks, Dan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Oct-15 18:09 UTC
Re: [Xen-devel] [RFC][PATCH] add tlsf option for xmalloc
On 15/10/08 18:47, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:> Note that this is compile-tested but not run tested yet. I > thought I''d get feedback on the approach before I get much > further.The approach is fine as far as I''m concerned. It should just replace the existing xmalloc.c of course: no point in keeping the old one around. Therefore may as well put the whole implementation in xmalloc.c, or call it xmalloc_tlsf.c if you''re really keen to keep the name of the algorithm in the file name (in which case xmalloc.c should be entirely deleted; or perhaps temporarily make it a build option which .c file gets built if really worried that the new xmalloc implementation may have subtle bugs and we''d like to be able to revert for testing). Structure definitions and the like which are private to TLSF should live at the top of the .c file: I prefer that to the <xen/*_int.h> approach as it keeps private non-shared stuff all in one place. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dan Magenheimer
2008-Oct-15 19:59 UTC
RE: [Xen-devel] [RFC][PATCH] add tlsf option for xmalloc
> > Note that this is compile-tested but not run tested yet. I > > thought I''d get feedback on the approach before I get much > > further. > > The approach is fine as far as I''m concerned. It should just > replace the > existing xmalloc.c of course: no point in keeping the old one around. > Therefore may as well put the whole implementation in > xmalloc.c, or call it > xmalloc_tlsf.c if you''re really keen to keep the name of the > algorithm in > the file name (in which case xmalloc.c should be entirely deleted; or > perhaps temporarily make it a build option which .c file gets built if > really worried that the new xmalloc implementation may have > subtle bugs and > we''d like to be able to revert for testing). > > Structure definitions and the like which are private to TLSF > should live at > the top of the .c file: I prefer that to the <xen/*_int.h> > approach as it > keeps private non-shared stuff all in one place.Sounds good. You may note that the tlsf files borrowed from Nitin Gupta use Linux-style indentation/formatting. One of my reasons for not merging the tlsf allocation with xmalloc is I was too lazy to reformat ;-) Do I need to do that or can I leave it as is or do you have a tool that will auto-reformat it to meet the Xen style requirements? Thanks, Dan P.S. Posted patch boots fine. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Oct-15 20:06 UTC
Re: [Xen-devel] [RFC][PATCH] add tlsf option for xmalloc
On 15/10/08 20:59, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:>> Structure definitions and the like which are private to TLSF >> should live at >> the top of the .c file: I prefer that to the <xen/*_int.h> >> approach as it >> keeps private non-shared stuff all in one place. > > Sounds good. > > You may note that the tlsf files borrowed from Nitin Gupta use Linux-style > indentation/formatting. One of my reasons for not merging the tlsf > allocation with xmalloc is I was too lazy to reformat ;-) Do I need > to do that or can I leave it as is or do you have a tool that will > auto-reformat it to meet the Xen style requirements?If the patch is actually working fine then I can take it and do the necessary reformatting. It only takes a short while even to do it manually. You need to provide a signed-off-by line, by the way. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel