How important is this feature?
Without this feature, an application has no way to figure out if a given segment is hugetlb or not. Applications need to know this to be able to handle alignment issues properly.
Also, if the flag is exported via ipcs, the system administrator would have a better idea about how the hugetlb pages she configured on the system are getting used.
I'd suggest that any API which allows us to query the hugeness of a piece
of memory should also work for mmap(hugetld_fd...). IOW: this capability
shouldn't be restricted to sysv shm areas.
But then again, if it was possible to write 100 lines of userspace code, we
wouldn't need this capability at all. I bet if the userspace guys tried a
bit harder they'd work out a way of teaching their applications to remember
what they did.