lkml.org 
[lkml]   [2018]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [v2 PATCH] mm: introduce arg_lock to protect arg_start|end and env_start|end in mm_struct
    From
    Date


    On 3/26/18 11:29 PM, Michal Hocko wrote:
    > On Tue 27-03-18 02:20:39, Yang Shi wrote:
    > [...]
    > The patch looks reasonable to me. Maybe it would be better to be more
    > explicit about the purpose of the patch. As others noticed, this alone
    > wouldn't solve the mmap_sem contention issues. I _think_ that if you
    > were more explicit about the mmap_sem abuse it would trigger less
    > questions.
    >
    > I have just one more question. Now that you are touching this area,
    > would you be willing to remove the following ugliness?
    >
    >> diff --git a/kernel/sys.c b/kernel/sys.c
    >> index f2289de..17bddd2 100644
    >> --- a/kernel/sys.c
    >> +++ b/kernel/sys.c
    >> @@ -1959,7 +1959,7 @@ static int prctl_set_mm_map(int opt, const void __user *addr, unsigned long data
    >> return error;
    >> }
    >>
    >> - down_write(&mm->mmap_sem);
    >> + down_read(&mm->mmap_sem);
    > Why do we need to hold mmap_sem here and call find_vma, when only
    > PR_SET_MM_ENV_END: is consuming it? I guess we can replace it wit the
    > new lock and take the mmap_sem only for PR_SET_MM_ENV_END.

    Sorry for taking a little bit longer to get back since I was traveling.
    I think all the stuff can be protected by the new arg_lock except
    mm->brk since arg_lock can't prevent from concurrent writing from sys_brk().

    We may use arg_lock to protect everything else other than mm->brk. The
    complexity sounds acceptable.

    Of course, as Cyrill mentioned, he prefers to deprecating prctl_set_mm
    since C/R is the only user of it. We may wait until he is done?

    Thanks,
    Yang

    >
    > Thanks!

    \
     
     \ /
      Last update: 2018-04-02 03:59    [W:2.804 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site