My understanding is that on Linux, if I mmap e.g. 1TiB of memory but don't actually use it, that is "free" because of overcommit, in the sense that it won't actually allocate 1TiB of physical memory, only virtual address space. In particular, all the virtual pages are backed by the shared zero page.
However, 1TiB is > 200 million 4KiB pages, so will this cause 200 million page table entries to be inserted into the page table, so this seems like quite a lot of bookkeeping overhead.
My question is, are all of those page table entries actually created immediately? Or is there also some mechanism for allocating those lazily as well, e.g. with page table entries that have a larger range than just one page.