linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] mm: easy preliminaries to THPagecache
@ 2016-04-05 20:37 Hugh Dickins
  2016-04-05 20:40 ` [PATCH 01/10] mm: update_lru_size warn and reset bad lru_size Hugh Dickins
                   ` (9 more replies)
  0 siblings, 10 replies; 24+ messages in thread
From: Hugh Dickins @ 2016-04-05 20:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Kirill A. Shutemov, Andrea Arcangeli, Andres Lagar-Cavilla,
	Yang Shi, Ning Qu, Hugh Dickins, linux-kernel, linux-mm

I've rebased my huge tmpfs series against v4.6-rc2, and split it into
two sets.  This is a set of miscellaneous premliminaries that I think
we can agree to put into mmotm right away, to be included in v4.7: or
if not, then I later rework the subsequent huge tmpfs series to avoid
or include them; but for now it expects these go in ahead.

These don't assume or commit us to any particular implementation of
huge tmpfs, though most of them are tidyups that came from that work.
01-04 are similar to what I posted in February 2015, I think 05 is the
only interesting patch here, if 06 is rejected then we can just keep
it for our own testing, 07-10 clear away some small obstructions.

But this is a weird 00/10 because it includes a patch at the bottom
itself: v4.6-rc2 missed out Kirill's page_cache_* removal, but that
is assumed in the following patches; so 00/10 should be applied if
you're basing on top of v4.6-rc2, but not applied to a later tree.

00 mm: get rid of a few rc2 page_cache_*
01 mm: update_lru_size warn and reset bad lru_size
02 mm: update_lru_size do the __mod_zone_page_state
03 mm: use __SetPageSwapBacked and dont ClearPageSwapBacked
04 tmpfs: preliminary minor tidyups
05 tmpfs: mem_cgroup charge fault to vm_mm not current mm
06 mm: /proc/sys/vm/stat_refresh to force vmstat update
07 huge mm: move_huge_pmd does not need new_vma
08 huge pagecache: extend mremap pmd rmap lockout to files
09 huge pagecache: mmap_sem is unlocked when truncation splits pmd
10 arch: fix has_transparent_hugepage()

 Documentation/sysctl/vm.txt                  |   14 +
 arch/arc/include/asm/hugepage.h              |    2 
 arch/arm/include/asm/pgtable-3level.h        |    5 
 arch/arm64/include/asm/pgtable.h             |    5 
 arch/mips/include/asm/pgtable.h              |    1 
 arch/mips/mm/tlb-r4k.c                       |   21 +-
 arch/powerpc/include/asm/book3s/64/pgtable.h |    1 
 arch/powerpc/include/asm/pgtable.h           |    1 
 arch/s390/include/asm/pgtable.h              |    1 
 arch/sparc/include/asm/pgtable_64.h          |    2 
 arch/tile/include/asm/pgtable.h              |    1 
 arch/x86/include/asm/pgtable.h               |    1 
 include/asm-generic/pgtable.h                |    8 
 include/linux/huge_mm.h                      |    4 
 include/linux/memcontrol.h                   |    6 
 include/linux/mempolicy.h                    |    6 
 include/linux/mm_inline.h                    |   24 ++
 include/linux/vmstat.h                       |    4 
 kernel/sysctl.c                              |    7 
 mm/filemap.c                                 |    4 
 mm/huge_memory.c                             |    7 
 mm/memcontrol.c                              |   26 ++
 mm/memory.c                                  |   17 -
 mm/migrate.c                                 |    6 
 mm/mremap.c                                  |   47 ++---
 mm/rmap.c                                    |    4 
 mm/shmem.c                                   |  148 +++++++----------
 mm/swap_state.c                              |    3 
 mm/vmscan.c                                  |   23 +-
 mm/vmstat.c                                  |   58 ++++++
 30 files changed, 271 insertions(+), 186 deletions(-)

[PATCH 00/10] mm: get rid of a few rc2 page_cache_*

Not-harebrained Linus forgot to apply Kirill's PAGE_CACHE_* page_cache_*
riddance in rc2, but did so the next day: this and the huge tmpfs series
assume that those changes have been made, so if applying these series to
vanilla v4.6-rc2 as intended, this patch resolves the few clashes first.

Signed-off-by: Hugh Dickins <hughd@google.com>
---
 mm/filemap.c |    4 ++--
 mm/memory.c  |    6 +++---
 mm/rmap.c    |    2 +-
 mm/shmem.c   |   18 +++++++++---------
 4 files changed, 15 insertions(+), 15 deletions(-)

--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2178,8 +2178,8 @@ repeat:
 		if (page->mapping != mapping || !PageUptodate(page))
 			goto unlock;
 
-		size = round_up(i_size_read(mapping->host), PAGE_CACHE_SIZE);
-		if (page->index >= size >> PAGE_CACHE_SHIFT)
+		size = round_up(i_size_read(mapping->host), PAGE_SIZE);
+		if (page->index >= size >> PAGE_SHIFT)
 			goto unlock;
 
 		pte = vmf->pte + page->index - vmf->pgoff;
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2807,7 +2807,7 @@ static int __do_fault(struct vm_area_str
 	if (unlikely(PageHWPoison(vmf.page))) {
 		if (ret & VM_FAULT_LOCKED)
 			unlock_page(vmf.page);
-		page_cache_release(vmf.page);
+		put_page(vmf.page);
 		return VM_FAULT_HWPOISON;
 	}
 
@@ -2996,7 +2996,7 @@ static int do_read_fault(struct mm_struc
 	if (unlikely(!pte_same(*pte, orig_pte))) {
 		pte_unmap_unlock(pte, ptl);
 		unlock_page(fault_page);
-		page_cache_release(fault_page);
+		put_page(fault_page);
 		return ret;
 	}
 	do_set_pte(vma, address, fault_page, pte, false, false);
@@ -3105,7 +3105,7 @@ static int do_shared_fault(struct mm_str
 	if (unlikely(!pte_same(*pte, orig_pte))) {
 		pte_unmap_unlock(pte, ptl);
 		unlock_page(fault_page);
-		page_cache_release(fault_page);
+		put_page(fault_page);
 		return ret;
 	}
 	do_set_pte(vma, address, fault_page, pte, true, false);
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1541,7 +1541,7 @@ static int try_to_unmap_one(struct page
 
 discard:
 	page_remove_rmap(page, PageHuge(page));
-	page_cache_release(page);
+	put_page(page);
 
 out_unmap:
 	pte_unmap_unlock(pte, ptl);
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -300,7 +300,7 @@ static int shmem_add_to_page_cache(struc
 	VM_BUG_ON_PAGE(!PageLocked(page), page);
 	VM_BUG_ON_PAGE(!PageSwapBacked(page), page);
 
-	page_cache_get(page);
+	get_page(page);
 	page->mapping = mapping;
 	page->index = index;
 
@@ -318,7 +318,7 @@ static int shmem_add_to_page_cache(struc
 	} else {
 		page->mapping = NULL;
 		spin_unlock_irq(&mapping->tree_lock);
-		page_cache_release(page);
+		put_page(page);
 	}
 	return error;
 }
@@ -530,7 +530,7 @@ static void shmem_undo_range(struct inod
 		struct page *page = NULL;
 		shmem_getpage(inode, start - 1, &page, SGP_READ, NULL);
 		if (page) {
-			unsigned int top = PAGE_CACHE_SIZE;
+			unsigned int top = PAGE_SIZE;
 			if (start > end) {
 				top = partial_end;
 				partial_end = 0;
@@ -1145,7 +1145,7 @@ static int shmem_getpage_gfp(struct inod
 	int once = 0;
 	int alloced = 0;
 
-	if (index > (MAX_LFS_FILESIZE >> PAGE_CACHE_SHIFT))
+	if (index > (MAX_LFS_FILESIZE >> PAGE_SHIFT))
 		return -EFBIG;
 repeat:
 	swap.val = 0;
@@ -1156,7 +1156,7 @@ repeat:
 	}
 
 	if (sgp != SGP_WRITE && sgp != SGP_FALLOC &&
-	    ((loff_t)index << PAGE_CACHE_SHIFT) >= i_size_read(inode)) {
+	    ((loff_t)index << PAGE_SHIFT) >= i_size_read(inode)) {
 		error = -EINVAL;
 		goto unlock;
 	}
@@ -1327,7 +1327,7 @@ clear:
 
 	/* Perhaps the file has been truncated since we checked */
 	if (sgp != SGP_WRITE && sgp != SGP_FALLOC &&
-	    ((loff_t)index << PAGE_CACHE_SHIFT) >= i_size_read(inode)) {
+	    ((loff_t)index << PAGE_SHIFT) >= i_size_read(inode)) {
 		if (alloced) {
 			ClearPageDirty(page);
 			delete_from_page_cache(page);
@@ -1355,7 +1355,7 @@ failed:
 unlock:
 	if (page) {
 		unlock_page(page);
-		page_cache_release(page);
+		put_page(page);
 	}
 	if (error == -ENOSPC && !once++) {
 		info = SHMEM_I(inode);
@@ -1635,8 +1635,8 @@ static ssize_t shmem_file_read_iter(stru
 	if (!iter_is_iovec(to))
 		sgp = SGP_DIRTY;
 
-	index = *ppos >> PAGE_CACHE_SHIFT;
-	offset = *ppos & ~PAGE_CACHE_MASK;
+	index = *ppos >> PAGE_SHIFT;
+	offset = *ppos & ~PAGE_MASK;
 
 	for (;;) {
 		struct page *page = NULL;

--
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>

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

end of thread, other threads:[~2016-04-16  4:55 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-05 20:37 [PATCH 00/10] mm: easy preliminaries to THPagecache Hugh Dickins
2016-04-05 20:40 ` [PATCH 01/10] mm: update_lru_size warn and reset bad lru_size Hugh Dickins
2016-04-14 11:56   ` Vlastimil Babka
2016-04-05 20:42 ` [PATCH 02/10] mm: update_lru_size do the __mod_zone_page_state Hugh Dickins
2016-04-05 20:44 ` [PATCH 03/10] mm: use __SetPageSwapBacked and dont ClearPageSwapBacked Hugh Dickins
2016-04-06  9:52   ` Mel Gorman
2016-04-05 20:45 ` [PATCH 04/10] tmpfs: preliminary minor tidyups Hugh Dickins
2016-04-05 20:47 ` [PATCH 05/10] tmpfs: mem_cgroup charge fault to vm_mm not current mm Hugh Dickins
2016-04-05 20:49 ` [PATCH 06/10] mm: /proc/sys/vm/stat_refresh to force vmstat update Hugh Dickins
2016-04-05 20:51 ` [PATCH 07/10] huge mm: move_huge_pmd does not need new_vma Hugh Dickins
2016-04-11 10:28   ` Kirill A. Shutemov
2016-04-05 20:52 ` [PATCH 08/10] huge pagecache: extend mremap pmd rmap lockout to files Hugh Dickins
2016-04-11 10:32   ` Kirill A. Shutemov
2016-04-05 20:55 ` [PATCH 09/10] huge pagecache: mmap_sem is unlocked when truncation splits pmd Hugh Dickins
2016-04-11 10:35   ` Kirill A. Shutemov
2016-04-14 17:39   ` Matthew Wilcox
2016-04-16  4:55     ` Andrew Morton
2016-04-05 21:02 ` [PATCH 10/10] arch: fix has_transparent_hugepage() Hugh Dickins
2016-04-05 23:25   ` David Miller
2016-04-06  3:22   ` Vineet Gupta
2016-04-06  6:58   ` Ingo Molnar
2016-04-06 12:29     ` Chris Metcalf
2016-04-06 21:58       ` Ingo Molnar
2016-04-06 11:56   ` Gerald Schaefer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).