All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] MADV_FREE support
@ 2015-10-30  7:01 ` Minchan Kim
  0 siblings, 0 replies; 97+ messages in thread
From: Minchan Kim @ 2015-10-30  7:01 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, linux-mm, Michael Kerrisk, linux-api, Hugh Dickins,
	Johannes Weiner, zhangyanfei, Rik van Riel, Mel Gorman,
	KOSAKI Motohiro, Jason Evans, Daniel Micay, Kirill A. Shutemov,
	Michal Hocko, yalin.wang2010, Shaohua Li, Minchan Kim

MADV_FREE is on linux-next so long time. The reason was two, I think.

1. MADV_FREE code on reclaim path was really mess.

2. Andrew really want to see voice of userland people who want to use
   the syscall.

A few month ago, Daniel Micay(jemalloc active contributor) requested me
to make progress upstreaming but I was busy at that time so it took
so long time for me to revist the code and finally, I clean it up the
mess recently so it solves the #2 issue.

As well, Daniel and Jason(jemalloc maintainer) requested it to Andrew
again recently and they said it would be great to have even though
it has swap dependency now so Andrew decided he will do that for v4.4.

When I test MADV_FREE patches on recent mmotm, there is some
problem with THP-refcount redesign so it's hard for long running
test. Even, there is some dependency with it because patch ordering of
MADV_FREE in mmotm is after THP refcount redesign so I discussed it
with Andrew in hallway this kernel summit and decided to send
patchset based on v4.3-rc7.

I have been tested it on v4.3-rc7 and couldn't find any problem so far.

In the meanwhile, Hugh reviewed all of code and asked me to tidy up
a lot patches related MADV_FREE on mmotm so this is the result of
the request.

In this version, I drop a enhance patch.

        mm: don't split THP page when syscall is called

Because it could delay split of THP page until reclaim path but it
made madvise_free void due to marking all pages(head + sub pages)
PG_dirty and pte_mkdirty when split happens.

I will see we could make THP split inheriting pmd's dirtiness to
subpages and remove adding PG_dirty part unconditionally in
__split_huge_page_refcount but it's rather risky to do it in
this moment(ie, close to merge window and Kirill is changing
that a lot) so I want to do it after closing merge window.
If we dont't do it now, we don't need following patches, either.

	x86-add-pmd_-for-thp.patch
	x86-add-pmd_-for-thp-fix.patch
	sparc-add-pmd_-for-thp.patch
	sparc-add-pmd_-for-thp-fix.patch
	powerpc-add-pmd_-for-thp.patch
	arm-add-pmd_mkclean-for-thp.patch
	arm64-add-pmd_-for-thp.patch

So, I drop those patch too in this version and will resend it
when I send a lazy split patch of THP page.

A final modification since I sent clean up patchset(ie, MADV_FREE
refactoring and fix KSM page), there are three.

 1. Replace description and comment of KSM fix patch with Hugh's suggestion
 2. Avoid forcing SetPageDirty in try_to_unmap_one to avoid clean
    page swapout from Yalin
 3. Adding uapi patch to make value of MADV_FREE for all arches same
    from Chen

About 3, I include it because I thought it was good but Andrew
just missed the patch at that time. But when I read quilt series
file now, it seems Shaohua had some problem with it but I couldn't
find any mail in my mailbox. If it has something wrong,
please tell us.

#mm-support-madvisemadv_free.patch: other-arch syscall numbering mess ("arch: uapi: asm: mman.h: Let MADV_FREE have same value for all architectures"). Shaohua Li <shli@kernel.org> testing disasters.

TODO: I will send man page patch if it would land for v4.4.

Andrew, you could replace all of MADV_FREE related patches with
this. IOW, these are

	# MADV_FREE stuff:
	x86-add-pmd_-for-thp.patch
	x86-add-pmd_-for-thp-fix.patch
	sparc-add-pmd_-for-thp.patch
	sparc-add-pmd_-for-thp-fix.patch
	powerpc-add-pmd_-for-thp.patch
	arm-add-pmd_mkclean-for-thp.patch
	arm64-add-pmd_-for-thp.patch

	mm-support-madvisemadv_free.patch
	mm-support-madvisemadv_free-fix.patch
	mm-support-madvisemadv_free-fix-2.patch
	mm-support-madvisemadv_free-fix-3.patch
	mm-support-madvisemadv_free-vs-thp-rename-split_huge_page_pmd-to-split_huge_pmd.patch
	mm-support-madvisemadv_free-fix-5.patch
	mm-support-madvisemadv_free-fix-6.patch
	mm-mark-stable-page-dirty-in-ksm.patch
	mm-dont-split-thp-page-when-syscall-is-called.patch
	mm-dont-split-thp-page-when-syscall-is-called-fix.patch
	mm-dont-split-thp-page-when-syscall-is-called-fix-2.patch
	mm-dont-split-thp-page-when-syscall-is-called-fix-3.patch
	mm-dont-split-thp-page-when-syscall-is-called-fix-4.patch
	mm-dont-split-thp-page-when-syscall-is-called-fix-5.patch
	mm-dont-split-thp-page-when-syscall-is-called-fix-6.patch
	mm-dont-split-thp-page-when-syscall-is-called-fix-6-fix.patch
	mm-free-swp_entry-in-madvise_free.patch
	mm-move-lazy-free-pages-to-inactive-list.patch
	mm-move-lazy-free-pages-to-inactive-list-fix.patch
	mm-move-lazy-free-pages-to-inactive-list-fix-fix.patch
	mm-move-lazy-free-pages-to-inactive-list-fix-fix-fix.patch

Chen Gang (1):
  arch: uapi: asm: mman.h: Let MADV_FREE have same value for all
    architectures

Minchan Kim (7):
  mm: support madvise(MADV_FREE)
  mm: define MADV_FREE for some arches
  mm: free swp_entry in madvise_free
  mm: move lazily freed pages to inactive list
  mm: lru_deactivate_fn should clear PG_referenced
  mm: clear PG_dirty to mark page freeable
  mm: mark stable page dirty in KSM

 arch/alpha/include/uapi/asm/mman.h     |   1 +
 arch/mips/include/uapi/asm/mman.h      |   1 +
 arch/parisc/include/uapi/asm/mman.h    |   1 +
 arch/xtensa/include/uapi/asm/mman.h    |   1 +
 include/linux/rmap.h                   |   1 +
 include/linux/swap.h                   |   1 +
 include/linux/vm_event_item.h          |   1 +
 include/uapi/asm-generic/mman-common.h |   1 +
 mm/ksm.c                               |   6 ++
 mm/madvise.c                           | 162 +++++++++++++++++++++++++++++++++
 mm/rmap.c                              |   7 ++
 mm/swap.c                              |  44 +++++++++
 mm/swap_state.c                        |   5 +-
 mm/vmscan.c                            |  10 +-
 mm/vmstat.c                            |   1 +
 15 files changed, 238 insertions(+), 5 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 97+ messages in thread

end of thread, other threads:[~2015-11-05  1:11 UTC | newest]

Thread overview: 97+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-30  7:01 [PATCH 0/8] MADV_FREE support Minchan Kim
2015-10-30  7:01 ` Minchan Kim
2015-10-30  7:01 ` Minchan Kim
2015-10-30  7:01 ` [PATCH 1/8] mm: support madvise(MADV_FREE) Minchan Kim
2015-10-30  7:01   ` Minchan Kim
2015-10-30 16:49   ` Shaohua Li
2015-10-30 16:49     ` Shaohua Li
2015-11-03  0:10     ` Minchan Kim
2015-11-03  0:10       ` Minchan Kim
2015-11-03  0:10       ` Minchan Kim
2015-10-30  7:01 ` [PATCH 2/8] mm: define MADV_FREE for some arches Minchan Kim
2015-10-30  7:01   ` Minchan Kim
2015-10-30  7:01 ` [PATCH 3/8] arch: uapi: asm: mman.h: Let MADV_FREE have same value for all architectures Minchan Kim
2015-10-30  7:01   ` Minchan Kim
2015-10-30  7:01   ` Minchan Kim
2015-11-02  0:08   ` Hugh Dickins
2015-11-02  0:08     ` Hugh Dickins
2015-11-02  0:08     ` Hugh Dickins
2015-11-02  0:08     ` Hugh Dickins
2015-11-03  2:32     ` Minchan Kim
2015-11-03  2:32       ` Minchan Kim
2015-11-03  2:32       ` Minchan Kim
2015-11-03  2:32       ` Minchan Kim
2015-11-03  2:36       ` Minchan Kim
2015-11-03  2:36         ` Minchan Kim
2015-11-03  2:36         ` Minchan Kim
2015-11-03  2:36         ` Minchan Kim
2015-11-03  3:36         ` David Miller
2015-11-03  3:36           ` David Miller
2015-11-03  3:36           ` David Miller
2015-11-03  4:31           ` Minchan Kim
2015-11-03  4:31             ` Minchan Kim
2015-11-03  4:31             ` Minchan Kim
2015-10-30  7:01 ` [PATCH 4/8] mm: free swp_entry in madvise_free Minchan Kim
2015-10-30  7:01   ` Minchan Kim
2015-10-30 12:28   ` Michal Hocko
2015-10-30 12:28     ` Michal Hocko
2015-11-03  0:53     ` Minchan Kim
2015-11-03  0:53       ` Minchan Kim
2015-11-03  0:53       ` Minchan Kim
2015-10-30  7:01 ` [PATCH 5/8] mm: move lazily freed pages to inactive list Minchan Kim
2015-10-30  7:01   ` Minchan Kim
2015-10-30 17:22   ` Shaohua Li
2015-10-30 17:22     ` Shaohua Li
2015-10-30 17:22     ` Shaohua Li
2015-11-03  0:52     ` Minchan Kim
2015-11-03  0:52       ` Minchan Kim
2015-11-03  0:52       ` Minchan Kim
2015-11-04  8:15       ` Michal Hocko
2015-11-04  8:15         ` Michal Hocko
2015-11-04 17:53       ` Shaohua Li
2015-11-04 17:53         ` Shaohua Li
2015-11-04 17:53         ` Shaohua Li
2015-11-04 18:20         ` Shaohua Li
2015-11-04 18:20           ` Shaohua Li
2015-11-05  1:11           ` Minchan Kim
2015-11-05  1:11             ` Minchan Kim
2015-11-05  1:03         ` Minchan Kim
2015-11-05  1:03           ` Minchan Kim
2015-11-05  1:03           ` Minchan Kim
2015-11-04 20:55   ` Johannes Weiner
2015-11-04 20:55     ` Johannes Weiner
2015-11-04 20:55     ` Johannes Weiner
2015-11-04 21:48     ` Daniel Micay
2015-11-04 21:48       ` Daniel Micay
2015-11-04 22:55       ` Johannes Weiner
2015-11-04 22:55         ` Johannes Weiner
2015-11-04 22:55         ` Johannes Weiner
2015-11-04 23:36         ` Daniel Micay
2015-11-04 23:49           ` Daniel Micay
2015-11-04 23:49             ` Daniel Micay
2015-10-30  7:01 ` [PATCH 6/8] mm: lru_deactivate_fn should clear PG_referenced Minchan Kim
2015-10-30  7:01   ` Minchan Kim
2015-10-30 12:47   ` Michal Hocko
2015-10-30 12:47     ` Michal Hocko
2015-10-30 12:47     ` Michal Hocko
2015-11-03  1:10     ` Minchan Kim
2015-11-03  1:10       ` Minchan Kim
2015-11-04  8:22       ` Michal Hocko
2015-11-04  8:22         ` Michal Hocko
2015-11-04  8:22         ` Michal Hocko
2015-10-30  7:01 ` [PATCH 7/8] mm: clear PG_dirty to mark page freeable Minchan Kim
2015-10-30  7:01   ` Minchan Kim
2015-10-30 12:55   ` Michal Hocko
2015-10-30 12:55     ` Michal Hocko
2015-10-30 12:55     ` Michal Hocko
2015-10-30  7:01 ` [PATCH 8/8] mm: mark stable page dirty in KSM Minchan Kim
2015-10-30  7:01   ` Minchan Kim
2015-11-01  4:51 ` [PATCH 0/8] MADV_FREE support David Rientjes
2015-11-01  4:51   ` David Rientjes
2015-11-01  4:51   ` David Rientjes
2015-11-01  6:29   ` Daniel Micay
2015-11-03  2:23     ` Minchan Kim
2015-11-03  2:23       ` Minchan Kim
2015-11-03  2:23       ` Minchan Kim
2015-11-04 20:19     ` David Rientjes
2015-11-04 20:19       ` David Rientjes

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.