lkml.org 
[lkml]   [2023]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH 12/41] mm: add per-VMA lock and helper functions to control it
    On Tue, Jan 17, 2023 at 7:07 AM Michal Hocko <mhocko@suse.com> wrote:
    >
    > On Mon 09-01-23 12:53:07, Suren Baghdasaryan wrote:
    > > diff --git a/kernel/fork.c b/kernel/fork.c
    > > index 5986817f393c..c026d75108b3 100644
    > > --- a/kernel/fork.c
    > > +++ b/kernel/fork.c
    > > @@ -474,6 +474,7 @@ struct vm_area_struct *vm_area_dup(struct vm_area_struct *orig)
    > > */
    > > *new = data_race(*orig);
    > > INIT_LIST_HEAD(&new->anon_vma_chain);
    > > + vma_init_lock(new);
    > > dup_anon_vma_name(orig, new);
    > > }
    > > return new;
    > > @@ -1145,6 +1146,9 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,
    > > seqcount_init(&mm->write_protect_seq);
    > > mmap_init_lock(mm);
    > > INIT_LIST_HEAD(&mm->mmlist);
    > > +#ifdef CONFIG_PER_VMA_LOCK
    > > + WRITE_ONCE(mm->mm_lock_seq, 0);
    > > +#endif
    >
    > The mm shouldn't be visible so why WRITE_ONCE?

    True. Will change to a simple assignment.

    >
    > --
    > Michal Hocko
    > SUSE Labs

    \
     
     \ /
      Last update: 2023-03-26 23:45    [W:3.443 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site