Re: [PATCH v2] fix mlocked page counter mistmatch

KOSAKI Motohiro
2009-02-04T02:51:56Z

> > Could you please teach me why this issue doesn't happend on munlockall()?
> > your scenario seems to don't depend on exit_mmap().
>
>
> Good question.
> It's a different issue.
> It is related to mmap_sem locking issue.
>
> Actually, I am about to make a patch.
> But, I can't understand that Why try_do_mlock_page should downgrade mm_sem ?
> Is it necessary ?
>
> In munlockall path, mmap_sem already is holding in write-mode of mmap_sem.
> so, try_to_mlock_page always fail to downgrade mmap_sem.
> It's why it looks like working well about mlocked counter.

lastest linus tree don't have downgrade mmap_sem.
(recently it was removed)

please see it.