Commit 0e06f5c0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'akpm' (patches from Andrew)

Merge updates from Andrew Morton:

 - a few misc bits

 - ocfs2

 - most(?) of MM

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (125 commits)
  thp: fix comments of __pmd_trans_huge_lock()
  cgroup: remove unnecessary 0 check from css_from_id()
  cgroup: fix idr leak for the first cgroup root
  mm: memcontrol: fix documentation for compound parameter
  mm: memcontrol: remove BUG_ON in uncharge_list
  mm: fix build warnings in <linux/compaction.h>
  mm, thp: convert from optimistic swapin collapsing to conservative
  mm, thp: fix comment inconsistency for swapin readahead functions
  thp: update Documentation/{vm/transhuge,filesystems/proc}.txt
  shmem: split huge pages beyond i_size under memory pressure
  thp: introduce CONFIG_TRANSPARENT_HUGE_PAGECACHE
  khugepaged: add support of collapse for tmpfs/shmem pages
  shmem: make shmem_inode_info::lock irq-safe
  khugepaged: move up_read(mmap_sem) out of khugepaged_alloc_page()
  thp: extract khugepaged from mm/huge_memory.c
  shmem, thp: respect MADV_{NO,}HUGEPAGE for file mappings
  shmem: add huge pages support
  shmem: get_unmapped_area align huge page
  shmem: prepare huge= mount option and sysfs knob
  mm, rmap: account shmem thp pages
  ...
parents f7816ad0 8f19b0c0
Loading
Loading
Loading
Loading
+46 −36
Original line number Original line Diff line number Diff line
@@ -83,6 +83,16 @@ pre-created. Default: 1.
	#select lzo compression algorithm
	#select lzo compression algorithm
	echo lzo > /sys/block/zram0/comp_algorithm
	echo lzo > /sys/block/zram0/comp_algorithm


For the time being, the `comp_algorithm' content does not necessarily
show every compression algorithm supported by the kernel. We keep this
list primarily to simplify device configuration and one can configure
a new device with a compression algorithm that is not listed in
`comp_algorithm'. The thing is that, internally, ZRAM uses Crypto API
and, if some of the algorithms were built as modules, it's impossible
to list all of them using, for instance, /proc/crypto or any other
method. This, however, has an advantage of permitting the usage of
custom crypto compression modules (implementing S/W or H/W compression).

4) Set Disksize
4) Set Disksize
Set disk size by writing the value to sysfs node 'disksize'.
Set disk size by writing the value to sysfs node 'disksize'.
The value can be either in bytes or you can use mem suffixes.
The value can be either in bytes or you can use mem suffixes.
+9 −5
Original line number Original line Diff line number Diff line
@@ -195,7 +195,9 @@ prototypes:
	int (*releasepage) (struct page *, int);
	int (*releasepage) (struct page *, int);
	void (*freepage)(struct page *);
	void (*freepage)(struct page *);
	int (*direct_IO)(struct kiocb *, struct iov_iter *iter);
	int (*direct_IO)(struct kiocb *, struct iov_iter *iter);
	bool (*isolate_page) (struct page *, isolate_mode_t);
	int (*migratepage)(struct address_space *, struct page *, struct page *);
	int (*migratepage)(struct address_space *, struct page *, struct page *);
	void (*putback_page) (struct page *);
	int (*launder_page)(struct page *);
	int (*launder_page)(struct page *);
	int (*is_partially_uptodate)(struct page *, unsigned long, unsigned long);
	int (*is_partially_uptodate)(struct page *, unsigned long, unsigned long);
	int (*error_remove_page)(struct address_space *, struct page *);
	int (*error_remove_page)(struct address_space *, struct page *);
@@ -219,7 +221,9 @@ invalidatepage: yes
releasepage:		yes
releasepage:		yes
freepage:		yes
freepage:		yes
direct_IO:
direct_IO:
isolate_page:		yes
migratepage:		yes (both)
migratepage:		yes (both)
putback_page:		yes
launder_page:		yes
launder_page:		yes
is_partially_uptodate:	yes
is_partially_uptodate:	yes
error_remove_page:	yes
error_remove_page:	yes
@@ -544,13 +548,13 @@ subsequent truncate), and then return with VM_FAULT_LOCKED, and the page
locked. The VM will unlock the page.
locked. The VM will unlock the page.


	->map_pages() is called when VM asks to map easy accessible pages.
	->map_pages() is called when VM asks to map easy accessible pages.
Filesystem should find and map pages associated with offsets from "pgoff"
Filesystem should find and map pages associated with offsets from "start_pgoff"
till "max_pgoff". ->map_pages() is called with page table locked and must
till "end_pgoff". ->map_pages() is called with page table locked and must
not block.  If it's not possible to reach a page without blocking,
not block.  If it's not possible to reach a page without blocking,
filesystem should skip it. Filesystem should use do_set_pte() to setup
filesystem should skip it. Filesystem should use do_set_pte() to setup
page table entry. Pointer to entry associated with offset "pgoff" is
page table entry. Pointer to entry associated with the page is passed in
passed in "pte" field in vm_fault structure. Pointers to entries for other
"pte" field in fault_env structure. Pointers to entries for other offsets
offsets should be calculated relative to "pte".
should be calculated relative to "pte".


	->page_mkwrite() is called when a previously read-only pte is
	->page_mkwrite() is called when a previously read-only pte is
about to become writeable. The filesystem again must ensure that there are
about to become writeable. The filesystem again must ensure that there are
+4 −2
Original line number Original line Diff line number Diff line
@@ -49,6 +49,7 @@ These block devices may be used for inspiration:
- axonram: Axon DDR2 device driver
- axonram: Axon DDR2 device driver
- brd: RAM backed block device driver
- brd: RAM backed block device driver
- dcssblk: s390 dcss block device driver
- dcssblk: s390 dcss block device driver
- pmem: NVDIMM persistent memory driver




Implementation Tips for Filesystem Writers
Implementation Tips for Filesystem Writers
@@ -75,8 +76,9 @@ calls to get_block() (for example by a page-fault racing with a read()
or a write()) work correctly.
or a write()) work correctly.


These filesystems may be used for inspiration:
These filesystems may be used for inspiration:
- ext2: the second extended filesystem, see Documentation/filesystems/ext2.txt
- ext2: see Documentation/filesystems/ext2.txt
- ext4: the fourth extended filesystem, see Documentation/filesystems/ext4.txt
- ext4: see Documentation/filesystems/ext4.txt
- xfs:  see Documentation/filesystems/xfs.txt




Handling Media Errors
Handling Media Errors
+9 −0
Original line number Original line Diff line number Diff line
@@ -436,6 +436,7 @@ Private_Dirty: 0 kB
Referenced:          892 kB
Referenced:          892 kB
Anonymous:             0 kB
Anonymous:             0 kB
AnonHugePages:         0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
Shared_Hugetlb:        0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
Swap:                  0 kB
@@ -464,6 +465,8 @@ accessed.
a mapping associated with a file may contain anonymous pages: when MAP_PRIVATE
a mapping associated with a file may contain anonymous pages: when MAP_PRIVATE
and a page is modified, the file page is replaced by a private anonymous copy.
and a page is modified, the file page is replaced by a private anonymous copy.
"AnonHugePages" shows the ammount of memory backed by transparent hugepage.
"AnonHugePages" shows the ammount of memory backed by transparent hugepage.
"ShmemPmdMapped" shows the ammount of shared (shmem/tmpfs) memory backed by
huge pages.
"Shared_Hugetlb" and "Private_Hugetlb" show the ammounts of memory backed by
"Shared_Hugetlb" and "Private_Hugetlb" show the ammounts of memory backed by
hugetlbfs page which is *not* counted in "RSS" or "PSS" field for historical
hugetlbfs page which is *not* counted in "RSS" or "PSS" field for historical
reasons. And these are not included in {Shared,Private}_{Clean,Dirty} field.
reasons. And these are not included in {Shared,Private}_{Clean,Dirty} field.
@@ -868,6 +871,9 @@ VmallocTotal: 112216 kB
VmallocUsed:       428 kB
VmallocUsed:       428 kB
VmallocChunk:   111088 kB
VmallocChunk:   111088 kB
AnonHugePages:   49152 kB
AnonHugePages:   49152 kB
ShmemHugePages:      0 kB
ShmemPmdMapped:      0 kB



    MemTotal: Total usable ram (i.e. physical ram minus a few reserved
    MemTotal: Total usable ram (i.e. physical ram minus a few reserved
              bits and the kernel binary code)
              bits and the kernel binary code)
@@ -912,6 +918,9 @@ MemAvailable: An estimate of how much memory is available for starting new
AnonHugePages: Non-file backed huge pages mapped into userspace page tables
AnonHugePages: Non-file backed huge pages mapped into userspace page tables
      Mapped: files which have been mmaped, such as libraries
      Mapped: files which have been mmaped, such as libraries
       Shmem: Total memory used by shared memory (shmem) and tmpfs
       Shmem: Total memory used by shared memory (shmem) and tmpfs
ShmemHugePages: Memory used by shared memory (shmem) and tmpfs allocated
              with huge pages
ShmemPmdMapped: Shared memory mapped into userspace with huge pages
        Slab: in-kernel data structures cache
        Slab: in-kernel data structures cache
SReclaimable: Part of Slab, that might be reclaimed, such as caches
SReclaimable: Part of Slab, that might be reclaimed, such as caches
  SUnreclaim: Part of Slab, that cannot be reclaimed on memory pressure
  SUnreclaim: Part of Slab, that cannot be reclaimed on memory pressure
+11 −0
Original line number Original line Diff line number Diff line
@@ -592,9 +592,14 @@ struct address_space_operations {
	int (*releasepage) (struct page *, int);
	int (*releasepage) (struct page *, int);
	void (*freepage)(struct page *);
	void (*freepage)(struct page *);
	ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter);
	ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter);
	/* isolate a page for migration */
	bool (*isolate_page) (struct page *, isolate_mode_t);
	/* migrate the contents of a page to the specified target */
	/* migrate the contents of a page to the specified target */
	int (*migratepage) (struct page *, struct page *);
	int (*migratepage) (struct page *, struct page *);
	/* put migration-failed page back to right list */
	void (*putback_page) (struct page *);
	int (*launder_page) (struct page *);
	int (*launder_page) (struct page *);

	int (*is_partially_uptodate) (struct page *, unsigned long,
	int (*is_partially_uptodate) (struct page *, unsigned long,
					unsigned long);
					unsigned long);
	void (*is_dirty_writeback) (struct page *, bool *, bool *);
	void (*is_dirty_writeback) (struct page *, bool *, bool *);
@@ -747,6 +752,10 @@ struct address_space_operations {
        and transfer data directly between the storage and the
        and transfer data directly between the storage and the
        application's address space.
        application's address space.


  isolate_page: Called by the VM when isolating a movable non-lru page.
	If page is successfully isolated, VM marks the page as PG_isolated
	via __SetPageIsolated.

  migrate_page:  This is used to compact the physical memory usage.
  migrate_page:  This is used to compact the physical memory usage.
        If the VM wants to relocate a page (maybe off a memory card
        If the VM wants to relocate a page (maybe off a memory card
        that is signalling imminent failure) it will pass a new page
        that is signalling imminent failure) it will pass a new page
@@ -754,6 +763,8 @@ struct address_space_operations {
	transfer any private data across and update any references
	transfer any private data across and update any references
        that it has to the page.
        that it has to the page.


  putback_page: Called by the VM when isolated page's migration fails.

  launder_page: Called before freeing a page - it writes back the dirty page. To
  launder_page: Called before freeing a page - it writes back the dirty page. To
  	prevent redirtying the page, it is kept locked during the whole
  	prevent redirtying the page, it is kept locked during the whole
	operation.
	operation.
Loading