On Wed, Jun 15, 2011 at 5:57 PM, Stefan Hajnoczi <stefa...@gmail.com> wrote: > Anyway, bdrv_getlength() will return the total_sectors value instead > of calling into raw-posix.c .bdrv_getlength(). That's why it should > be cheap.
Yeah, I see it now after a closer look in the drivers code. It looks like I get this 9% slowdown just because for my particular test bdrv_get_geometry() is called 37,348,536 times, which is a big number even for function which calls another function which checks a few IFs and returns a multiplication of two numbers. Anyway, I think that caching the geometry is a good thing to do, so I believe that the second version of the patch is good enough. -- Dmitry Konishchev mailto:konishc...@gmail.com