lkml.org 
[lkml]   [2022]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 1/3] mm: refactor vm_area_struct::anon_vma_name usage code
On Thu, Feb 24, 2022 at 12:36 AM Michal Hocko <mhocko@suse.com> wrote:
>
> On Wed 23-02-22 07:36:11, Suren Baghdasaryan wrote:
> > Avoid mixing strings and their anon_vma_name referenced pointers
> > by using struct anon_vma_name whenever possible. This simplifies
> > the code and allows easier sharing of anon_vma_name structures when
> > they represent the same name.
> >
> > Suggested-by: Matthew Wilcox <willy@infradead.org>
> > Suggested-by: Michal Hocko <mhocko@suse.com>
> > Signed-off-by: Suren Baghdasaryan <surenb@google.com>
>
> LGTM
> Acked-by: Michal Hocko <mhocko@suse.com>
>
> Thanks and one minor nit below

Addressed all the nits in the next version:
https://lore.kernel.org/all/20220224231834.1481408-1-surenb@google.com/
Thanks!

>
> [...]
> > +static inline void free_anon_vma_name(struct vm_area_struct *vma)
> > {
> > - const char *vma_name = vma_anon_name(vma);
> > + /*
> > + * Not using anon_vma_name because it generates a warning if vma->vm_mm
> > + * is not held, which might be the case here.
>
> s@vma->vm_mm@mmap_lock@
>
> > + */
> > + if (!vma->vm_file)
> > + anon_vma_name_put(vma->anon_name);
> > +}
> >
> > - /* either both NULL, or pointers to same string */
> > - if (vma_name == name)
>
> --
> Michal Hocko
> SUSE Labs

\
 
 \ /
  Last update: 2022-02-25 00:24    [W:0.101 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site