I am just reading the source code regarding do_brk, which is called by
sys_brk when user space program need to larger its heap.

I don't know whether my understanding is correct, and some points are
not very clear.

do_brk try to find an vma to enlarge or new a vma for the new heap.
But I don't see any code doing the page table setup and page
allocation from the buddy system. Is it a copy-on-write?

If it is copy-on-write, when the user space program first write to the
heap, which page fault handler will be called? do_anonymous_page? And
if it s COW, each time a page fault only one page will be mapped?