linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: MinChan Kim <barrioskmc@gmail.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: MinChan Kim <minchan.kim@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux mm <linux-mm@kvack.org>,
	linux kernel <linux-kernel@vger.kernel.org>,
	Nick Piggin <npiggin@suse.de>, Rik van Riel <riel@redhat.com>,
	Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Subject: Re: [PATCH v2] fix mlocked page counter mistmatch
Date: Thu, 5 Feb 2009 11:32:36 +0900	[thread overview]
Message-ID: <44c63dc40902041832n47d6a313h6b388c5a08dc58bf@mail.gmail.com> (raw)
In-Reply-To: <20090205111507.803B.KOSAKI.MOTOHIRO@jp.fujitsu.com>

On Thu, Feb 5, 2009 at 11:17 AM, KOSAKI Motohiro
<kosaki.motohiro@jp.fujitsu.com> wrote:
>> > and, I think current try_to_mlock_page() is correct. no need change.
>> > Why?
>> >
>> > 1. Generally, mmap_sem holding is necessary when vma->vm_flags accessed.
>> >    that's vma's basic rule.
>> > 2. However, try_to_unmap_one() doesn't held mamp_sem. but that's ok.
>> >    it often get incorrect result. but caller consider incorrect value safe.
>> > 3. try_to_mlock_page() need mmap_sem because it obey rule (1).
>> > 4. in try_to_mlock_page(), if down_read_trylock() is failure,
>> >    we can't move the page to unevictable list. but that's ok.
>> >    the page in evictable list is periodically try to reclaim. and
>> >    be called try_to_unmap().
>> >    try_to_unmap() (and its caller) also move the unevictable page to unevictable list.
>> >    Therefore, in long term view, the page leak is not happend.
>>
>> Thanks for clarification.
>> In long term view, you're right.
>>
>> but My concern is that munlock[all] pathes always hold down of mmap_sem.
>> After all, down_read_trylock always wil fail for such cases.
>>
>> So, current task's mlocked pages only can be reclaimed
>> by background or direct reclaim path if the task don't exit.
>>
>> I think it can increase reclaim overhead unnecessary
>> if there are lots of such tasks.
>>
>> What's your opinion ?
>
> I have 2 comment.
>
> 1. typical application never munlock()ed at all.

Sometime application of embedded can do it.
That's becuase they want deterministic page allocation in some situation.
However, It's not a matter in here.

>   and exit() path is already efficient.
>   then, I don't like hacky apploach.
> 2. I think we should drop mmap_sem holding in munlock path in the future.
>   at that time, this issue disappear automatically.
>   it's clean way more.

If we can drop mmap_sem in munlock path, I am happy, too.
Please, CCed me if you make a patch for it.

By that time, I will fold this issue. :)

>
> What do you think it?
>
>
>



-- 
Thanks,
MinChan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2009-02-05  2:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03  4:24 MinChan Kim
2009-02-03 16:44 ` KOSAKI Motohiro
2009-02-03 23:44   ` MinChan Kim
2009-02-04  2:12     ` KOSAKI Motohiro
2009-02-04  2:44       ` MinChan Kim
2009-02-04  2:51         ` KOSAKI Motohiro
2009-02-04  4:57           ` MinChan Kim
2009-02-04 10:28             ` KOSAKI Motohiro
2009-02-04 14:07               ` Lee Schermerhorn
2009-02-04 23:38                 ` MinChan Kim
2009-02-04 23:35               ` MinChan Kim
2009-02-05  2:17                 ` KOSAKI Motohiro
2009-02-05  2:32                   ` MinChan Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44c63dc40902041832n47d6a313h6b388c5a08dc58bf@mail.gmail.com \
    --to=barrioskmc@gmail.com \
    --cc=Lee.Schermerhorn@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan.kim@gmail.com \
    --cc=npiggin@suse.de \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox