|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] tools/libxengnttab: correct size of allocated memory
Juergen Gross writes ("[PATCH] tools/libxengnttab: correct size of allocated
memory"):
> The size of the memory allocated for the IOCTL_GNTDEV_MAP_GRANT_REF
> ioctl() parameters is calculated wrong, which results in too much
> memory allocated.
Added Roger to CC.
Firstly,
Reviewed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Thank you.
But, looking at this code, why on earth what the ?
The FreeBSD code checks to see if it's less than a page and if so uses
malloc and otherwise uses mmap ! Why not unconditionally use malloc ?
Likewise, the Linux code has its own mmap-based memory-obtainer. ISTM
that malloc is probably going to be better. Often it will be able to
give out even a substantial amount without making a syscall.
Essentially, we have two (similar but not identical) tiny custom
memory allocators here. Also, the Linux and FreeBSD code are
remarkably similar which bothers me.
Anyway, these observations are no criticism of Juergen's patch.
Regards,
Ian.
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |