On Fri, May 20, 2022 at 02:21:54PM +0000, Christophe Leroy wrote: > > +/* COW PTE fallback to normal PTE: > > + * - two state here > > + * - After break child : [parent, rss=1, ref=1, write=NO , owner=parent] > > + * to [parent, rss=1, ref=1, write=YES, owner=NULL ] > > + * - After break parent: [child , rss=0, ref=1, write=NO , owner=NULL ] > > + * to [child , rss=1, ref=1, write=YES, owner=NULL ] > > + */ > > +void cow_pte_fallback(struct vm_area_struct *vma, pmd_t *pmd, > > + unsigned long addr) > > There should be a prototype in a header somewhere for a non static function. > > You are encouraged to run 'make mm/memory.o C=2' to check sparse reports. > I will do all the above checking before sending the next version. > > +{ > > + struct mm_struct *mm = vma->vm_mm; > > + unsigned long start, end; > > + pmd_t new; > > + > > + BUG_ON(pmd_write(*pmd)); > > You seem to add a lot of BUG_ONs(). Are they really necessary ? See > https://docs.kernel.org/process/deprecated.html?highlight=bug_on#bug-and-bug-on > > You may also use VM_BUG_ON(). > Sure. I added BUG_ON() when doing the debug. I will consider again which one is necessary. And change to use VM_BUG_ON(). Thanks.