lkml.org 
[lkml]   [2022]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 4/6] mm: Add COW PTE fallback function
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.

\
 
 \ /
  Last update: 2022-05-21 06:17    [W:0.091 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site