Re: [PATCH v2 28/29] multipathd: sanitize uxsock_listen()

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

 



On Mon, 2020-10-19 at 18:33 -0500, Benjamin Marzinski wrote:
> 
> I have one nitpick. This code looks like it's pretending to allocate
> pages of memory, when it's not. Malloc's bookeeping space means that
> this memory chunk will be larger than a page. Even if it was page
> sized,
> unless userspace is specifically asking for page-aligned memory, it
> most
> like won't get it. Since AFAIK there is no benefit to mallocing
> memory
> in a specific size increment, it doesn't seem woirth adding any
> complexity to make sure our mallocs do that.

I agree about the bookkeeping space, and about the "pretending", too.
This was not about alignment. It's just a habit to use powers of 2 for
array sizes.

The point of increasing the memory area in chunks was simply to call
realloc() less often. I believe that's a good thing.
I plan to do this for our vector implementation, too, some day.

Thanks,
Martin



--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux