lkml.org 
[lkml]   [2020]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] mm: Do early cow for pinned pages during fork() for ptes
On Tue, Sep 22, 2020 at 08:44:00PM +0200, Oleg Nesterov wrote:
> On 09/22, Peter Xu wrote:
> >
> > Or I can also do it in inverted order if you think better:
> >
> > if (unlikely(copy_ret == COPY_MM_BREAK_COW)) {
> > WARN_ON_ONCE(!data.cow_new_page);
> > ...
> > }
>
> Peter, let me say this again. I don't understand this code enough, you
> can safely ignore me ;)

Why? I appreciate every single comment from you! :)

>
> However. Personally I strongly prefer the above. Personally I really
> dislike this part of 4/5:
>
> again:
> + /* We don't reset this for COPY_MM_BREAK_COW */
> + memset(&data, 0, sizeof(data));
> +
> +again_break_cow:
>
> If we rely on "copy_ret == COPY_MM_BREAK_COW" we can unify "again" and
> "again_break_cow", we don't need to clear ->cow_new_page, this makes the
> logic more understandable. To me at least ;)

I see your point. I'll definitely try it out. I think I'll at least use what
you preferred above since it's actually the same as before, logically. Then
I'll consider drop the again_break_cow, as long as I'm still as confident after
I do the change on not leaking anything :).

Thanks,

--
Peter Xu

\
 
 \ /
  Last update: 2020-09-23 03:04    [W:0.102 / U:32.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site