It's tricky, simply because if someone doesn't know the size of their current page, they would generally want to know what size the current page is mapped as, based upon what is currently extant within that address space. So for example, assuming read-only pages, if an as has a PMD-sized THP mapped, it seems as if page_size() for any address within that PMD address range should return the PMD size as compound page head/tail is an implementation issue, not a VM one per se. On the other hand, if another as has a portion of the physical space the THP occupies mapped as a PAGESIZE page, a page_size() for and address within that range should return PAGESIZE. Forgive me if I'm being impossibly naive here.