Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8065be8d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'akpm' (second patchbomb from Andrew Morton)

Merge more incoming from Andrew Morton:
 "Two new syscalls:

     memfd_create in "shm: add memfd_create() syscall"
     kexec_file_load in "kexec: implementation of new syscall kexec_file_load"

  And:

   - Most (all?) of the rest of MM

   - Lots of the usual misc bits

   - fs/autofs4

   - drivers/rtc

   - fs/nilfs

   - procfs

   - fork.c, exec.c

   - more in lib/

   - rapidio

   - Janitorial work in filesystems: fs/ufs, fs/reiserfs, fs/adfs,
     fs/cramfs, fs/romfs, fs/qnx6.

   - initrd/initramfs work

   - "file sealing" and the memfd_create() syscall, in tmpfs

   - add pci_zalloc_consistent, use it in lots of places

   - MAINTAINERS maintenance

   - kexec feature work"

* emailed patches from Andrew Morton <akpm@linux-foundation.org: (193 commits)
  MAINTAINERS: update nomadik patterns
  MAINTAINERS: update usb/gadget patterns
  MAINTAINERS: update DMA BUFFER SHARING patterns
  kexec: verify the signature of signed PE bzImage
  kexec: support kexec/kdump on EFI systems
  kexec: support for kexec on panic using new system call
  kexec-bzImage64: support for loading bzImage using 64bit entry
  kexec: load and relocate purgatory at kernel load time
  purgatory: core purgatory functionality
  purgatory/sha256: provide implementation of sha256 in purgaotory context
  kexec: implementation of new syscall kexec_file_load
  kexec: new syscall kexec_file_load() declaration
  kexec: make kexec_segment user buffer pointer a union
  resource: provide new functions to walk through resources
  kexec: use common function for kimage_normal_alloc() and kimage_crash_alloc()
  kexec: move segment verification code in a separate function
  kexec: rename unusebale_pages to unusable_pages
  kernel: build bin2c based on config option CONFIG_BUILD_BIN2C
  bin2c: move bin2c in scripts/basic
  shm: wait for pins to be released when sealing
  ...
parents 27d438c5 ecc265fe
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1381,6 +1381,9 @@ S: 17 rue Danton
S: F - 94270 Le Kremlin-Bicêtre
S: France

N: Jack Hammer
D: IBM ServeRAID RAID (ips) driver maintenance

N: Greg Hankins
E: gregh@cc.gatech.edu
D: fixed keyboard driver to separate LED and locking status
@@ -1691,6 +1694,10 @@ S: Reading
S: RG6 2NU
S: United Kingdom

N: Dave Jeffery
E: dhjeffery@gmail.com
D: SCSI hacks and IBM ServeRAID RAID driver maintenance

N: Jakub Jelinek
E: jakub@redhat.com
W: http://sunsite.mff.cuni.cz/~jj
+269 −0
Original line number Diff line number Diff line

What:		/sys/fs/nilfs2/features/revision
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show current revision of NILFS file system driver.
		This value informs about file system revision that
		driver is ready to support.

What:		/sys/fs/nilfs2/features/README
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Describe attributes of /sys/fs/nilfs2/features group.

What:		/sys/fs/nilfs2/<device>/revision
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show NILFS file system revision on volume.
		This value informs about metadata structures'
		revision on mounted volume.

What:		/sys/fs/nilfs2/<device>/blocksize
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show volume's block size in bytes.

What:		/sys/fs/nilfs2/<device>/device_size
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show volume size in bytes.

What:		/sys/fs/nilfs2/<device>/free_blocks
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show count of free blocks on volume.

What:		/sys/fs/nilfs2/<device>/uuid
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show volume's UUID (Universally Unique Identifier).

What:		/sys/fs/nilfs2/<device>/volume_name
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show volume's label.

What:		/sys/fs/nilfs2/<device>/README
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Describe attributes of /sys/fs/nilfs2/<device> group.

What:		/sys/fs/nilfs2/<device>/superblock/sb_write_time
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show last write time of super block in human-readable
		format.

What:		/sys/fs/nilfs2/<device>/superblock/sb_write_time_secs
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show last write time of super block in seconds.

What:		/sys/fs/nilfs2/<device>/superblock/sb_write_count
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show current write count of super block.

What:		/sys/fs/nilfs2/<device>/superblock/sb_update_frequency
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show/Set interval of periodical update of superblock
		(in seconds).

What:		/sys/fs/nilfs2/<device>/superblock/README
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Describe attributes of /sys/fs/nilfs2/<device>/superblock
		group.

What:		/sys/fs/nilfs2/<device>/segctor/last_pseg_block
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show start block number of the latest segment.

What:		/sys/fs/nilfs2/<device>/segctor/last_seg_sequence
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show sequence value of the latest segment.

What:		/sys/fs/nilfs2/<device>/segctor/last_seg_checkpoint
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show checkpoint number of the latest segment.

What:		/sys/fs/nilfs2/<device>/segctor/current_seg_sequence
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show segment sequence counter.

What:		/sys/fs/nilfs2/<device>/segctor/current_last_full_seg
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show index number of the latest full segment.

What:		/sys/fs/nilfs2/<device>/segctor/next_full_seg
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show index number of the full segment index
		to be used next.

What:		/sys/fs/nilfs2/<device>/segctor/next_pseg_offset
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show offset of next partial segment in the current
		full segment.

What:		/sys/fs/nilfs2/<device>/segctor/next_checkpoint
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show next checkpoint number.

What:		/sys/fs/nilfs2/<device>/segctor/last_seg_write_time
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show write time of the last segment in
		human-readable format.

What:		/sys/fs/nilfs2/<device>/segctor/last_seg_write_time_secs
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show write time of the last segment in seconds.

What:		/sys/fs/nilfs2/<device>/segctor/last_nongc_write_time
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show write time of the last segment not for cleaner
		operation in human-readable format.

What:		/sys/fs/nilfs2/<device>/segctor/last_nongc_write_time_secs
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show write time of the last segment not for cleaner
		operation in seconds.

What:		/sys/fs/nilfs2/<device>/segctor/dirty_data_blocks_count
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show number of dirty data blocks.

What:		/sys/fs/nilfs2/<device>/segctor/README
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Describe attributes of /sys/fs/nilfs2/<device>/segctor
		group.

What:		/sys/fs/nilfs2/<device>/segments/segments_number
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show number of segments on a volume.

What:		/sys/fs/nilfs2/<device>/segments/blocks_per_segment
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show number of blocks in segment.

What:		/sys/fs/nilfs2/<device>/segments/clean_segments
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show count of clean segments.

What:		/sys/fs/nilfs2/<device>/segments/dirty_segments
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show count of dirty segments.

What:		/sys/fs/nilfs2/<device>/segments/README
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Describe attributes of /sys/fs/nilfs2/<device>/segments
		group.

What:		/sys/fs/nilfs2/<device>/checkpoints/checkpoints_number
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show number of checkpoints on volume.

What:		/sys/fs/nilfs2/<device>/checkpoints/snapshots_number
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show number of snapshots on volume.

What:		/sys/fs/nilfs2/<device>/checkpoints/last_seg_checkpoint
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show checkpoint number of the latest segment.

What:		/sys/fs/nilfs2/<device>/checkpoints/next_checkpoint
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show next checkpoint number.

What:		/sys/fs/nilfs2/<device>/checkpoints/README
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Describe attributes of /sys/fs/nilfs2/<device>/checkpoints
		group.

What:		/sys/fs/nilfs2/<device>/mounted_snapshots/README
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Describe content of /sys/fs/nilfs2/<device>/mounted_snapshots
		group.

What:		/sys/fs/nilfs2/<device>/mounted_snapshots/<id>/inodes_count
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show number of inodes for snapshot.

What:		/sys/fs/nilfs2/<device>/mounted_snapshots/<id>/blocks_count
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Show number of blocks for snapshot.

What:		/sys/fs/nilfs2/<device>/mounted_snapshots/<id>/README
Date:		April 2014
Contact:	"Vyacheslav Dubeyko" <slava@dubeyko.com>
Description:
		Describe attributes of /sys/fs/nilfs2/<device>/mounted_snapshots/<id>
		group.
+11 −149
Original line number Diff line number Diff line
@@ -24,64 +24,27 @@ Please note that implementation details can be changed.

   a page/swp_entry may be charged (usage += PAGE_SIZE) at

	mem_cgroup_charge_anon()
	  Called at new page fault and Copy-On-Write.

	mem_cgroup_try_charge_swapin()
	  Called at do_swap_page() (page fault on swap entry) and swapoff.
	  Followed by charge-commit-cancel protocol. (With swap accounting)
	  At commit, a charge recorded in swap_cgroup is removed.

	mem_cgroup_charge_file()
	  Called at add_to_page_cache()

	mem_cgroup_cache_charge_swapin()
	  Called at shmem's swapin.

	mem_cgroup_prepare_migration()
	  Called before migration. "extra" charge is done and followed by
	  charge-commit-cancel protocol.
	  At commit, charge against oldpage or newpage will be committed.
	mem_cgroup_try_charge()

2. Uncharge
  a page/swp_entry may be uncharged (usage -= PAGE_SIZE) by

	mem_cgroup_uncharge_page()
	  Called when an anonymous page is fully unmapped. I.e., mapcount goes
	  to 0. If the page is SwapCache, uncharge is delayed until
	  mem_cgroup_uncharge_swapcache().

	mem_cgroup_uncharge_cache_page()
	  Called when a page-cache is deleted from radix-tree. If the page is
	  SwapCache, uncharge is delayed until mem_cgroup_uncharge_swapcache().

	mem_cgroup_uncharge_swapcache()
	  Called when SwapCache is removed from radix-tree. The charge itself
	  is moved to swap_cgroup. (If mem+swap controller is disabled, no
	  charge to swap occurs.)
	mem_cgroup_uncharge()
	  Called when a page's refcount goes down to 0.

	mem_cgroup_uncharge_swap()
	  Called when swp_entry's refcnt goes down to 0. A charge against swap
	  disappears.

	mem_cgroup_end_migration(old, new)
	At success of migration old is uncharged (if necessary), a charge
	to new page is committed. At failure, charge to old page is committed.

3. charge-commit-cancel
	In some case, we can't know this "charge" is valid or not at charging
	(because of races).
	To handle such case, there are charge-commit-cancel functions.
		mem_cgroup_try_charge_XXX
		mem_cgroup_commit_charge_XXX
		mem_cgroup_cancel_charge_XXX
	these are used in swap-in and migration.
	Memcg pages are charged in two steps:
		mem_cgroup_try_charge()
		mem_cgroup_commit_charge() or mem_cgroup_cancel_charge()

	At try_charge(), there are no flags to say "this page is charged".
	at this point, usage += PAGE_SIZE.

	At commit(), the function checks the page should be charged or not
	and set flags or avoid charging.(usage -= PAGE_SIZE)
	At commit(), the page is associated with the memcg.

	At cancel(), simply usage -= PAGE_SIZE.

@@ -91,18 +54,6 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
	Anonymous page is newly allocated at
		  - page fault into MAP_ANONYMOUS mapping.
		  - Copy-On-Write.
 	It is charged right after it's allocated before doing any page table
	related operations. Of course, it's uncharged when another page is used
	for the fault address.

	At freeing anonymous page (by exit() or munmap()), zap_pte() is called
	and pages for ptes are freed one by one.(see mm/memory.c). Uncharges
	are done at page_remove_rmap() when page_mapcount() goes down to 0.

	Another page freeing is by page-reclaim (vmscan.c) and anonymous
	pages are swapped out. In this case, the page is marked as
	PageSwapCache(). uncharge() routine doesn't uncharge the page marked
	as SwapCache(). It's delayed until __delete_from_swap_cache().

	4.1 Swap-in.
	At swap-in, the page is taken from swap-cache. There are 2 cases.
@@ -111,41 +62,6 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
	(b) If the SwapCache has been mapped by processes, it has been
	    charged already.

	This swap-in is one of the most complicated work. In do_swap_page(),
	following events occur when pte is unchanged.

	(1) the page (SwapCache) is looked up.
	(2) lock_page()
	(3) try_charge_swapin()
	(4) reuse_swap_page() (may call delete_swap_cache())
	(5) commit_charge_swapin()
	(6) swap_free().

	Considering following situation for example.

	(A) The page has not been charged before (2) and reuse_swap_page()
	    doesn't call delete_from_swap_cache().
	(B) The page has not been charged before (2) and reuse_swap_page()
	    calls delete_from_swap_cache().
	(C) The page has been charged before (2) and reuse_swap_page() doesn't
	    call delete_from_swap_cache().
	(D) The page has been charged before (2) and reuse_swap_page() calls
	    delete_from_swap_cache().

	    memory.usage/memsw.usage changes to this page/swp_entry will be
	 Case          (A)      (B)       (C)     (D)
         Event
       Before (2)     0/ 1     0/ 1      1/ 1    1/ 1
          ===========================================
          (3)        +1/+1    +1/+1     +1/+1   +1/+1
          (4)          -       0/ 0       -     -1/ 0
          (5)         0/-1     0/ 0     -1/-1    0/ 0
          (6)          -       0/-1       -      0/-1
          ===========================================
       Result         1/ 1     1/ 1      1/ 1    1/ 1

       In any cases, charges to this page should be 1/ 1.

	4.2 Swap-out.
	At swap-out, typical state transition is below.

@@ -158,28 +74,20 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
	    swp_entry's refcnt -= 1.


	At (b), the page is marked as SwapCache and not uncharged.
	At (d), the page is removed from SwapCache and a charge in page_cgroup
	is moved to swap_cgroup.

	Finally, at task exit,
	(e) zap_pte() is called and swp_entry's refcnt -=1 -> 0.
	Here, a charge in swap_cgroup disappears.

5. Page Cache
   	Page Cache is charged at
	- add_to_page_cache_locked().

	uncharged at
	- __remove_from_page_cache().

	The logic is very clear. (About migration, see below)
	Note: __remove_from_page_cache() is called by remove_from_page_cache()
	and __remove_mapping().

6. Shmem(tmpfs) Page Cache
	Memcg's charge/uncharge have special handlers of shmem. The best way
	to understand shmem's page state transition is to read mm/shmem.c.
	The best way to understand shmem's page state transition is to read
	mm/shmem.c.
	But brief explanation of the behavior of memcg around shmem will be
	helpful to understand the logic.

@@ -192,56 +100,10 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
	It's charged when...
	- A new page is added to shmem's radix-tree.
	- A swp page is read. (move a charge from swap_cgroup to page_cgroup)
	It's uncharged when
	- A page is removed from radix-tree and not SwapCache.
	- When SwapCache is removed, a charge is moved to swap_cgroup.
	- When swp_entry's refcnt goes down to 0, a charge in swap_cgroup
	  disappears.

7. Page Migration
   	One of the most complicated functions is page-migration-handler.
	Memcg has 2 routines. Assume that we are migrating a page's contents
	from OLDPAGE to NEWPAGE.

	Usual migration logic is..
	(a) remove the page from LRU.
	(b) allocate NEWPAGE (migration target)
	(c) lock by lock_page().
	(d) unmap all mappings.
	(e-1) If necessary, replace entry in radix-tree.
	(e-2) move contents of a page.
	(f) map all mappings again.
	(g) pushback the page to LRU.
	(-) OLDPAGE will be freed.

	Before (g), memcg should complete all necessary charge/uncharge to
	NEWPAGE/OLDPAGE.

	The point is....
	- If OLDPAGE is anonymous, all charges will be dropped at (d) because
          try_to_unmap() drops all mapcount and the page will not be
	  SwapCache.

	- If OLDPAGE is SwapCache, charges will be kept at (g) because
	  __delete_from_swap_cache() isn't called at (e-1)

	- If OLDPAGE is page-cache, charges will be kept at (g) because
	  remove_from_swap_cache() isn't called at (e-1)

	memcg provides following hooks.

	- mem_cgroup_prepare_migration(OLDPAGE)
	  Called after (b) to account a charge (usage += PAGE_SIZE) against
	  memcg which OLDPAGE belongs to.

        - mem_cgroup_end_migration(OLDPAGE, NEWPAGE)
	  Called after (f) before (g).
	  If OLDPAGE is used, commit OLDPAGE again. If OLDPAGE is already
	  charged, a charge by prepare_migration() is automatically canceled.
	  If NEWPAGE is used, commit NEWPAGE and uncharge OLDPAGE.

	  But zap_pte() (by exit or munmap) can be called while migration,
	  we have to check if OLDPAGE/NEWPAGE is a valid page after commit().

	mem_cgroup_migrate()

8. LRU
        Each memcg has its own private LRU. Now, its handling is under global
+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ nuvoton,npct501 i2c trusted platform module (TPM)
nxp,pca9556		Octal SMBus and I2C registered interface
nxp,pca9557		8-bit I2C-bus and SMBus I/O port with reset
nxp,pcf8563		Real-time clock/calendar
nxp,pcf85063		Tiny Real-Time Clock
ovti,ov5642		OV5642: Color CMOS QSXGA (5-megapixel) Image Sensor with OmniBSI and Embedded TrueFocus
pericom,pt7c4338	Real-time Clock Module
plx,pex8648		48-Lane, 12-Port PCI Express Gen 2 (5.0 GT/s) Switch
+2 −0
Original line number Diff line number Diff line
@@ -268,6 +268,8 @@ characters, each representing a particular tainted value.
 14: 'E' if an unsigned module has been loaded in a kernel supporting
     module signature.

 15: 'L' if a soft lockup has previously occurred on the system.

The primary reason for the 'Tainted: ' string is to tell kernel
debuggers if this is a clean kernel or if anything unusual has
occurred.  Tainting is permanent: even if an offending module is
Loading