From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Michael Kerrisk <mtk.manpages@gmail.com>,
Linux API <linux-api@vger.kernel.org>,
Hugh Dickins <hughd@google.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Rik van Riel <riel@redhat.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Mel Gorman <mgorman@suse.de>, Jason Evans <je@fb.com>,
Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Subject: Re: [PATCH v9] mm: support madvise(MADV_FREE)
Date: Tue, 1 Jul 2014 17:50:58 +0300 [thread overview]
Message-ID: <20140701145058.GA2084@node.dhcp.inet.fi> (raw)
In-Reply-To: <1404174975-22019-1-git-send-email-minchan@kernel.org>
On Tue, Jul 01, 2014 at 09:36:15AM +0900, Minchan Kim wrote:
> + do {
> + /*
> + * XXX: We can optimize with supporting Hugepage free
> + * if the range covers.
> + */
> + next = pmd_addr_end(addr, end);
> + if (pmd_trans_huge(*pmd))
> + split_huge_page_pmd(vma, addr, pmd);
Could you implement proper THP support before upstreaming the feature?
It shouldn't be a big deal.
> + /*
> + * Here there can be other concurrent MADV_DONTNEED or
> + * trans huge page faults running, and if the pmd is
> + * none or trans huge it can change under us. This is
> + * because MADV_LAZYFREE holds the mmap_sem in read
> + * mode.
> + */
> + if (pmd_none_or_trans_huge_or_clear_bad(pmd))
> + goto next;
> + next = madvise_free_pte_range(tlb, vma, pmd, addr, next);
> +next:
> + cond_resched();
> + } while (pmd++, addr = next, addr != end);
--
Kirill A. Shutemov
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Michael Kerrisk <mtk.manpages@gmail.com>,
Linux API <linux-api@vger.kernel.org>,
Hugh Dickins <hughd@google.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Rik van Riel <riel@redhat.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Mel Gorman <mgorman@suse.de>, Jason Evans <je@fb.com>,
Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Subject: Re: [PATCH v9] mm: support madvise(MADV_FREE)
Date: Tue, 1 Jul 2014 17:50:58 +0300 [thread overview]
Message-ID: <20140701145058.GA2084@node.dhcp.inet.fi> (raw)
In-Reply-To: <1404174975-22019-1-git-send-email-minchan@kernel.org>
On Tue, Jul 01, 2014 at 09:36:15AM +0900, Minchan Kim wrote:
> + do {
> + /*
> + * XXX: We can optimize with supporting Hugepage free
> + * if the range covers.
> + */
> + next = pmd_addr_end(addr, end);
> + if (pmd_trans_huge(*pmd))
> + split_huge_page_pmd(vma, addr, pmd);
Could you implement proper THP support before upstreaming the feature?
It shouldn't be a big deal.
> + /*
> + * Here there can be other concurrent MADV_DONTNEED or
> + * trans huge page faults running, and if the pmd is
> + * none or trans huge it can change under us. This is
> + * because MADV_LAZYFREE holds the mmap_sem in read
> + * mode.
> + */
> + if (pmd_none_or_trans_huge_or_clear_bad(pmd))
> + goto next;
> + next = madvise_free_pte_range(tlb, vma, pmd, addr, next);
> +next:
> + cond_resched();
> + } while (pmd++, addr = next, addr != end);
--
Kirill A. Shutemov
next prev parent reply other threads:[~2014-07-01 14:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-01 0:36 [PATCH v9] mm: support madvise(MADV_FREE) Minchan Kim
2014-07-01 0:36 ` Minchan Kim
2014-07-01 14:16 ` Rik van Riel
2014-07-01 14:16 ` Rik van Riel
2014-07-01 14:50 ` Kirill A. Shutemov [this message]
2014-07-01 14:50 ` Kirill A. Shutemov
[not found] ` <20140701145058.GA2084-nhfs4B5ZimeFUdmeq17FyvUpdFzICT1y@public.gmane.org>
2014-07-03 1:03 ` Minchan Kim
2014-07-03 1:03 ` Minchan Kim
2014-07-03 1:03 ` Minchan Kim
2014-07-03 7:29 ` Minchan Kim
2014-07-03 7:29 ` Minchan Kim
2014-07-03 8:29 ` Martin Schwidefsky
2014-07-03 8:29 ` Martin Schwidefsky
2014-07-03 8:37 ` Minchan Kim
2014-07-03 8:37 ` Minchan Kim
2014-07-03 16:01 ` Martin Schwidefsky
2014-07-03 16:01 ` Martin Schwidefsky
2014-07-04 6:41 ` Minchan Kim
2014-07-04 6:41 ` Minchan Kim
2014-07-04 6:41 ` Minchan Kim
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=20140701145058.GA2084@node.dhcp.inet.fi \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=je@fb.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=minchan@kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=riel@redhat.com \
--cc=zhangyanfei@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.