linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mmotm 2015-08-05-17-06 uploaded
@ 2015-08-06  0:06 akpm
  2015-08-06 12:53 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2015-08-06  0:06 UTC (permalink / raw)
  To: mm-commits, linux-kernel, linux-mm, linux-fsdevel, linux-next,
	sfr, mhocko

The mm-of-the-moment snapshot 2015-08-05-17-06 has been uploaded to

   http://www.ozlabs.org/~akpm/mmotm/

mmotm-readme.txt says

README for mm-of-the-moment:

http://www.ozlabs.org/~akpm/mmotm/

This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
more than once a week.

You will need quilt to apply these patches to the latest Linus release (4.x
or 4.x-rcY).  The series file is in broken-out.tar.gz and is duplicated in
http://ozlabs.org/~akpm/mmotm/series

The file broken-out.tar.gz contains two datestamp files: .DATE and
.DATE-yyyy-mm-dd-hh-mm-ss.  Both contain the string yyyy-mm-dd-hh-mm-ss,
followed by the base kernel version against which this patch series is to
be applied.

This tree is partially included in linux-next.  To see which patches are
included in linux-next, consult the `series' file.  Only the patches
within the #NEXT_PATCHES_START/#NEXT_PATCHES_END markers are included in
linux-next.

A git tree which contains the memory management portion of this tree is
maintained at git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git
by Michal Hocko.  It contains the patches which are between the
"#NEXT_PATCHES_START mm" and "#NEXT_PATCHES_END" markers, from the series
file, http://www.ozlabs.org/~akpm/mmotm/series.


A full copy of the full kernel tree with the linux-next and mmotm patches
already applied is available through git within an hour of the mmotm
release.  Individual mmotm releases are tagged.  The master branch always
points to the latest release, so it's constantly rebasing.

http://git.cmpxchg.org/cgit.cgi/linux-mmotm.git/

To develop on top of mmotm git:

  $ git remote add mmotm git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git
  $ git remote update mmotm
  $ git checkout -b topic mmotm/master
  <make changes, commit>
  $ git send-email mmotm/master.. [...]

To rebase a branch with older patches to a new mmotm release:

  $ git remote update mmotm
  $ git rebase --onto mmotm/master <topic base> topic




The directory http://www.ozlabs.org/~akpm/mmots/ (mm-of-the-second)
contains daily snapshots of the -mm tree.  It is updated more frequently
than mmotm, and is untested.

A git copy of this tree is available at

	http://git.cmpxchg.org/cgit.cgi/linux-mmots.git/

and use of this tree is similar to
http://git.cmpxchg.org/cgit.cgi/linux-mmotm.git/, described above.


This mmotm tree contains the following patches against 4.2-rc5:
(patches marked "*" will be included in linux-next)

  origin.patch
  arch-alpha-kernel-systblss-remove-debug-check.patch
* ipc-modify-message-queue-accounting-to-not-take-kernel-data-structures-into-account.patch
* mm-meminit-allow-early_pfn_to_nid-to-be-used-during-runtime.patch
* mm-meminit-replace-rwsem-with-completion.patch
* fs-file-table-reinit-files_statmax_files-after-deferred-memory-initialisation.patch
* ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work.patch
* ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work-v2.patch
* signal-fix-information-leak-in-copy_siginfo_from_user32.patch
* signal-fix-information-leak-in-copy_siginfo_to_user.patch
* signalfd-fix-information-leak-in-signalfd_copyinfo.patch
* mm-slub-allow-merging-when-slab_debug_free-is-set.patch
* iommu-common-do-not-use-64-bit-constant-0xffffffffffffffffl-for-computing-align_mask.patch
* fsnotify-fix-oops-in-fsnotify_clear_marks_by_group_flags.patch
* kthread-export-kthread-functions.patch
* user_ns-use-correct-check-for-single-threadedness.patch
* ocfs2-fix-shift-left-overflow.patch
* mm-initialize-hotplugged-pages-as-reserved.patch
* ipc-use-private-shmem-or-hugetlbfs-inodes-for-shm-segments.patch
* mm-memory-failure-unlock_page-before-put_page.patch
* mm-memory-failure-fix-race-in-counting-num_poisoned_pages.patch
* mm-memory-failure-give-up-error-handling-for-non-tail-refcounted-thp.patch
* mm-check-__pg_hwpoison-separately-from-page_flags_check_at_.patch
* mm-memory-failure-set-pagehwpoison-before-migrate_pages.patch
* writeback-fix-initial-dirty-limit.patch
* kernel-kthreadc-kthread_create_on_node-clarify-documentation.patch
* kernel-kthreadc-kthread_create_on_node-clarify-documentation-fix.patch
* capabilities-ambient-capabilities.patch
* capabilities-add-a-securebit-to-disable-pr_cap_ambient_raise.patch
* clk_register_clkdev-handle-callers-needing-format-string.patch
* fs-optimize-inotify-fsnotify-code-for-unwatched-files.patch
* fsnotify-fix-check-in-inotify-fdinfo-printing.patch
* fsnotify-document-mark-locking.patch
* fsnotify-remove-mark-free_list.patch
* fsnotify-get-rid-of-fsnotify_destroy_mark_locked.patch
* scripts-spellingtxt-adding-misspelled-word-for-check.patch
* scripts-spellingtxt-adding-misspelled-word-for-check-fix.patch
* scripts-spellingtxt-spelling-of-uninitialized.patch
* kerneldoc-convert-error-messages-to-gnu-error-message-format.patch
* lindent-handle-missing-indent-gracefully.patch
* scripts-decode_stacktrace-fix-arm-architecture-decoding.patch
* ntfs-deletion-of-unnecessary-checks-before-the-function-call-iput.patch
* fs-ext4-fsyncc-generic_file_fsync-call-based-on-barrier-flag.patch
* ocfs2-fix-race-between-dio-and-recover-orphan.patch
* ocfs2-fix-several-issues-of-append-dio.patch
* ocfs2-do-not-bug-if-buffer-not-uptodate-in-__ocfs2_journal_access.patch
* ocfs2-do-not-log-twice-error-messages.patch
* ocfs2-clean-up-unused-local-variables-in-ocfs2_file_write_iter.patch
* ocfs2-adjust-code-to-match-locking-unlocking-order.patch
* ocfs2-set-filesytem-read-only-when-ocfs2_delete_entry-failed.patch
* ocfs2-set-filesytem-read-only-when-ocfs2_delete_entry-failed-v2.patch
* ocfs2-trusted-xattr-missing-cap_sys_admin-check.patch
* ocfs2-flush-inode-data-to-disk-and-free-inode-when-i_count-becomes-zero.patch
* add-errors=continue.patch
* acknowledge-return-value-of-ocfs2_error.patch
* clear-the-rest-of-the-buffers-on-error.patch
* ocfs2-fix-a-tiny-case-that-inode-can-not-removed.patch
* ocfs2-add-ip_alloc_sem-in-direct-io-to-protect-allocation-changes.patch
* ocfs2-extend-transaction-for-ocfs2_remove_rightmost_path-and-ocfs2_update_edge_lengths-before-to-avoid-inconsistency-between-inode-and-et.patch
* ocfs2-do-not-set-fs-read-only-if-rec-is-empty-while-committing-truncate.patch
* extend-enough-credits-for-freeing-one-truncate-record-while-replaying-truncate-records.patch
* resubmit-bug_onlockres-l_level-=-dlm_lock_ex-checkpointed-tripped-in-ocfs2_ci_checkpointed.patch
* resubmit-ocfs2_iop_set-get_acl-called-from-the-vfs-so-take-inode-lock-v2second-version.patch
* ocfs2-fix-race-between-crashed-dio-and-rm.patch
* ocfs2-use-64bit-variables-to-track-heartbeat-time.patch
* ocfs2-call-ocfs2_journal_access_di-before-ocfs2_journal_dirty-in-ocfs2_write_end_nolock.patch
* ocfs2-avoid-access-invalid-address-when-read-o2dlm-debug-messages.patch
* ocfs2-neaten-do_error-ocfs2_error-and-ocfs2_abort.patch
* ocfs2-export-ocfs2_kset-for-online-file-check.patch
* ocfs2-sysfile-interfaces-for-online-file-check.patch
* ocfs2-sysfile-interfaces-for-online-file-check-fix.patch
* ocfs2-sysfile-interfaces-for-online-file-check-fix-2.patch
* ocfs2-create-remove-sysfile-for-online-file-check.patch
* ocfs2-check-fix-inode-block-for-online-file-check.patch
* ocfs2-add-feature-document-for-online-file-check.patch
* block-restore-proc-partitions-to-not-display-non-partitionable-removable-devices.patch
* 9p-do-not-overwrite-return-code-when-locking-fails.patch
* smpboot-fix-memory-leak-on-error-handling.patch
* smpboot-make-cleanup-to-mirror-setup.patch
* smpboot-allow-to-pass-the-cpumask-on-per-cpu-thread-registration.patch
* smpboot-allow-to-pass-the-cpumask-on-per-cpu-thread-registration-fix.patch
* watchdog-simplify-housekeeping-affinity-with-the-appropriate-mask.patch
* watchdog-move-nmi-function-header-declarations-from-watchdogh-to-nmih.patch
* watchdog-move-nmi-function-header-declarations-from-watchdogh-to-nmih-v2.patch
* watchdog-introduce-watchdog_park_threads-and-watchdog_unpark_threads.patch
* watchdog-introduce-watchdog_suspend-and-watchdog_resume.patch
* watchdog-introduce-watchdog_suspend-and-watchdog_resume-fix.patch
* watchdog-use-park-unpark-functions-in-update_watchdog_all_cpus.patch
* watchdog-use-suspend-resume-interface-in-fixup_ht_bug.patch
* watchdog-use-suspend-resume-interface-in-fixup_ht_bug-fix.patch
  mm.patch
* slub-fix-spelling-succedd-to-succeed.patch
* slab-infrastructure-for-bulk-object-allocation-and-freeing.patch
* slub-bulk-alloc-extract-objects-from-the-per-cpu-slab.patch
* slub-improve-bulk-alloc-strategy.patch
* slub-initial-bulk-free-implementation.patch
* slub-add-support-for-kmem_cache_debug-in-bulk-calls.patch
* mm-slub-move-slab-initialization-into-irq-enabled-region.patch
* mm-slub-fix-slab-double-free-in-case-of-duplicate-sysfs-filename.patch
* slab-fix-the-unexpected-index-mapping-result-of-kmalloc_sizeindex_node-1.patch
* mm-slub-dont-wait-for-high-order-page-allocation.patch
* userfaultfd-linux-documentation-vm-userfaultfdtxt.patch
* userfaultfd-linux-documentation-vm-userfaultfdtxt-fix.patch
* userfaultfd-waitqueue-add-nr-wake-parameter-to-__wake_up_locked_key.patch
* userfaultfd-uapi.patch
* userfaultfd-uapi-add-missing-include-typesh.patch
* userfaultfd-linux-userfaultfd_kh.patch
* userfaultfd-add-vm_userfaultfd_ctx-to-the-vm_area_struct.patch
* userfaultfd-add-vm_uffd_missing-and-vm_uffd_wp.patch
* userfaultfd-call-handle_userfault-for-userfaultfd_missing-faults.patch
* userfaultfd-teach-vma_merge-to-merge-across-vma-vm_userfaultfd_ctx.patch
* userfaultfd-prevent-khugepaged-to-merge-if-userfaultfd-is-armed.patch
* userfaultfd-add-new-syscall-to-provide-memory-externalization.patch
* userfaultfd-add-new-syscall-to-provide-memory-externalization-fix.patch
* userfaultfd-add-new-syscall-to-provide-memory-externalization-fix-fix.patch
* userfaultfd-add-new-syscall-to-provide-memory-externalization-fix-fix-fix.patch
* userfaultfd-rename-uffd_apibits-into-features.patch
* userfaultfd-rename-uffd_apibits-into-features-fixup.patch
* userfaultfd-change-the-read-api-to-return-a-uffd_msg.patch
* userfaultfd-change-the-read-api-to-return-a-uffd_msg-fix.patch
* userfaultfd-change-the-read-api-to-return-a-uffd_msg-fix-2.patch
* userfaultfd-change-the-read-api-to-return-a-uffd_msg-fix-2-fix.patch
* userfaultfd-wake-pending-userfaults.patch
* userfaultfd-optimize-read-and-poll-to-be-o1.patch
* userfaultfd-optimize-read-and-poll-to-be-o1-fix.patch
* userfaultfd-allocate-the-userfaultfd_ctx-cacheline-aligned.patch
* userfaultfd-solve-the-race-between-uffdio_copyzeropage-and-read.patch
* userfaultfd-buildsystem-activation.patch
* userfaultfd-activate-syscall.patch
* userfaultfd-activate-syscall-fix.patch
* userfaultfd-uffdio_copyuffdio_zeropage-uapi.patch
* userfaultfd-mcopy_atomicmfill_zeropage-uffdio_copyuffdio_zeropage-preparation.patch
* userfaultfd-avoid-mmap_sem-read-recursion-in-mcopy_atomic.patch
* userfaultfd-avoid-mmap_sem-read-recursion-in-mcopy_atomic-fix.patch
* userfaultfd-uffdio_copy-and-uffdio_zeropage.patch
* userfaultfd-require-uffdio_api-before-other-ioctls.patch
* userfaultfd-allow-signals-to-interrupt-a-userfault.patch
* userfaultfd-propagate-the-full-address-in-thp-faults.patch
* userfaultfd-avoid-missing-wakeups-during-refile-in-userfaultfd_read.patch
* userfaultfd-selftest.patch
* mm-mlock-refactor-mlock-munlock-and-munlockall-code.patch
* mm-mlock-refactor-mlock-munlock-and-munlockall-code-checkpatch-fixes.patch
* mm-mlock-add-new-mlock-system-call.patch
* mm-mlock-add-new-mlock-system-call-checkpatch-fixes.patch
* mm-introduce-vm_lockonfault.patch
* mm-introduce-vm_lockonfault-checkpatch-fixes.patch
* mm-mlock-add-mlock-flags-to-enable-vm_lockonfault-usage.patch
* selftests-vm-add-tests-for-lock-on-fault.patch
* mips-add-entry-for-new-mlock2-syscall.patch
* x86-mm-trace-when-an-ipi-is-about-to-be-sent.patch
* mm-send-one-ipi-per-cpu-to-tlb-flush-all-entries-after-unmapping-pages.patch
* mm-send-one-ipi-per-cpu-to-tlb-flush-all-entries-after-unmapping-pages-fix.patch
* mm-defer-flush-of-writable-tlb-entries.patch
* documentation-features-vm-add-feature-description-and-arch-support-status-for-batched-tlb-flush-after-unmap.patch
* mm-memblock-warn_on-when-nid-differs-from-overlap-region.patch
* genalloc-add-name-arg-to-gen_pool_get-and-devm_gen_pool_create.patch
* genalloc-add-name-arg-to-gen_pool_get-and-devm_gen_pool_create-fix.patch
* genalloc-add-name-arg-to-gen_pool_get-and-devm_gen_pool_create-v2.patch
* genalloc-add-support-of-multiple-gen_pools-per-device.patch
* genalloc-add-support-of-multiple-gen_pools-per-device-fix.patch
* genalloc-add-support-of-multiple-gen_pools-per-device-fix-2.patch
* mm-memcontrol-bring-back-the-vm_bug_on-in-mem_cgroup_swapout.patch
* mm-fix-status-code-move_pages-returns-for-zero-page.patch
* mm-make-gup-handle-pfn-mapping-unless-foll_get-is-requested.patch
* mm-make-gup-handle-pfn-mapping-unless-foll_get-is-requested-fix.patch
* hugetlb-make-the-function-vma_shareable-bool.patch
* mremap-dont-leak-new_vma-if-f_op-mremap-fails.patch
* mm-move-mremap-from-file_operations-to-vm_operations_struct.patch
* mm-move-mremap-from-file_operations-to-vm_operations_struct-v3.patch
* mremap-dont-do-mm_populatenew_addr-on-failure.patch
* mremap-dont-do-uneccesary-checks-if-new_len-==-old_len.patch
* mremap-simplify-the-overlap-check-in-mremap_to.patch
* mm-remove-struct-node_active_region.patch
* mm-change-function-return-from-int-to-bool-for-the-function-is_page_busy.patch
* memory-make-the-function-tlb_next_batch-bool-now.patch
* mm-make-the-function-madvise_behaviour_valid-bool.patch
* mm-make-the-function-vma_has_reserves-bool.patch
* mm-introduce-vma_is_anonymousvma-helper.patch
* mmap-fix-the-usage-of-vm_pgoff-in-special_mapping-paths.patch
* mremap-fix-the-wrong-vma-vm_file-check-in-copy_vma.patch
* thp-vma_adjust_trans_huge-adjust-file-backed-vma-too.patch
* dax-move-dax-related-functions-to-a-new-header.patch
* dax-revert-userfaultfd-change.patch
* thp-prepare-for-dax-huge-pages.patch
* thp-prepare-for-dax-huge-pages-fix.patch
* mm-add-a-pmd_fault-handler.patch
* mm-export-various-functions-for-the-benefit-of-dax.patch
* mm-add-vmf_insert_pfn_pmd.patch
* dax-add-huge-page-fault-support.patch
* ext2-huge-page-fault-support.patch
* ext4-huge-page-fault-support.patch
* xfs-huge-page-fault-support.patch
* fs-daxc-fix-typo-in-endif-comment.patch
* ext4-use-ext4_get_block_write-for-dax.patch
* thp-change-insert_pfns-return-type-to-void.patch
* dax-improve-comment-about-truncate-race.patch
* ext4-add-ext4_get_block_dax.patch
* ext4-start-transaction-before-calling-into-dax.patch
* dax-fix-race-between-simultaneous-faults.patch
* thp-decrement-refcount-on-huge-zero-page-if-it-is-split.patch
* thp-fix-zap_huge_pmd-for-dax.patch
* dax-dont-use-set_huge_zero_page.patch
* dax-ensure-that-zero-pages-are-removed-from-other-processes.patch
* dax-use-linear_page_index.patch
* mm-page-refine-the-calculation-of-highest-possible-node-id.patch
* mm-page-remove-unused-variable-of-free_area_init_core.patch
* mm-memblock-warn_on-when-flags-differs-from-overlap-region.patch
* mm-rip-put_page_unless_one-as-it-has-no-callers.patch
* pagemap-check-permissions-and-capabilities-at-open-time.patch
* pagemap-switch-to-the-new-format-and-do-some-cleanup.patch
* pagemap-rework-hugetlb-and-thp-report.patch
* pagemap-hide-physical-addresses-from-non-privileged-users.patch
* pagemap-add-mmap-exclusive-bit-for-marking-pages-mapped-only-here.patch
* pagemap-add-mmap-exclusive-bit-for-marking-pages-mapped-only-here-fix.patch
* pagemap-update-documentation.patch
* pagemap-update-documentation-fix.patch
* memtest-use-kstrtouint-instead-of-simple_strtoul.patch
* memtest-cleanup-log-messages.patch
* memtest-cleanup-log-messages-fix.patch
* memtest-remove-unused-header-files.patch
* mm-show-proportional-swap-share-of-the-mapping.patch
* mm-show-proportional-swap-share-of-the-mapping-fix.patch
* fs-do-not-prefault-sys_write-user-buffer-pages.patch
* mm-improve-__gfp_noretry-comment-based-on-implementation.patch
* mm-improve-__gfp_noretry-comment-based-on-implementation-fix.patch
* mm-make-the-function-set_recommended_min_free_kbytes-have-a-return-type-of-void.patch
* mm-oom-organize-oom-context-into-struct.patch
* mm-oom-pass-an-oom-order-of-1-when-triggered-by-sysrq.patch
* mm-oom-do-not-panic-for-oom-kills-triggered-from-sysrq.patch
* mm-oom-add-description-of-struct-oom_control.patch
* mm-oom-remove-unnecessary-variable.patch
* mm-slab_common-allow-null-cache-pointer-in-kmem_cache_destroy.patch
* mm-mempool-allow-null-pool-pointer-in-mempool_destroy.patch
* mm-dmapool-allow-null-pool-pointer-in-dma_pool_destroy.patch
* sparc32-do-not-include-swaph-from-pgtable_32h-export-struct-mem_cgroup.patch
* memcg-export-struct-mem_cgroup.patch
* memcg-export-struct-mem_cgroup-fix.patch
* memcg-export-struct-mem_cgroup-fix-2.patch
* memcg-get-rid-of-mem_cgroup_root_css-for-config_memcg.patch
* memcg-get-rid-of-extern-for-functions-in-memcontrolh.patch
* memcg-restructure-mem_cgroup_can_attach.patch
* memcg-tcp_kmem-check-for-cg_proto-in-sock_update_memcg.patch
* memcg-move-memcg_proto_active-from-sockh.patch
* lib-show_memc-correct-reserved-memory-calculation.patch
* mm-page_isolation-remove-bogus-tests-for-isolated-pages.patch
* mm-page_isolation-remove-bogus-tests-for-isolated-pages-fix.patch
* mm-rename-and-move-get-set_freepage_migratetype.patch
* mm-rename-and-move-get-set_freepage_migratetype-v2.patch
* mm-hugetlb-add-cache-of-descriptors-to-resv_map-for-region_add.patch
* mm-hugetlb-add-cache-of-descriptors-to-resv_map-for-region_add-fix.patch
* mm-hugetlb-add-region_del-to-delete-a-specific-range-of-entries.patch
* mm-hugetlb-expose-hugetlb-fault-mutex-for-use-by-fallocate.patch
* hugetlbfs-hugetlb_vmtruncate_list-needs-to-take-a-range-to-delete.patch
* hugetlbfs-truncate_hugepages-takes-a-range-of-pages.patch
* mm-hugetlb-vma_has_reserves-needs-to-handle-fallocate-hole-punch.patch
* mm-hugetlb-alloc_huge_page-handle-areas-hole-punched-by-fallocate.patch
* hugetlbfs-new-huge_add_to_page_cache-helper-routine.patch
* hugetlbfs-add-hugetlbfs_fallocate.patch
* hugetlbfs-add-hugetlbfs_fallocate-fix.patch
* mm-madvise-allow-remove-operation-for-hugetlbfs.patch
* memblock-make-memblock_overlaps_region-return-bool.patch
* mem-hotplug-handle-node-hole-when-initializing-numa_meminfo.patch
* mm-srcu-ify-shrinkers.patch
* mm-srcu-ify-shrinkers-fix.patch
* mm-srcu-ify-shrinkers-fix-fix.patch
* mempolicy-get-rid-of-duplicated-check-for-vmavm_pfnmap-in-queue_pages_range.patch
* mm-page_isolation-make-set-unset_migratetype_isolate-file-local.patch
* bootmem-avoid-freeing-to-bootmem-after-bootmem-is-done.patch
* vm_flags-vm_flags_t-and-__nocast.patch
* mm-vmscan-never-isolate-more-pages-than-necessary.patch
* vmscan-fix-increasing-nr_isolated-incurred-by-putback-unevictable-pages.patch
* mm-add-support-for-__gfp_zero-flag-to-dma_pool_alloc.patch
* mm-add-dma_pool_zalloc-call-to-dma-api.patch
* pci-mm-add-pci_pool_zalloc-call.patch
* coccinelle-mm-scripts-coccinelle-api-alloc-pool_zalloc-simplecocci.patch
* mm-compaction-more-robust-check-for-scanners-meeting.patch
* mm-compaction-simplify-handling-restart-position-in-free-pages-scanner.patch
* mm-compaction-encapsulate-resetting-cached-scanner-positions.patch
* mm-compaction-skip-compound-pages-by-order-in-free-scanner.patch
* reverted-selftests-add-hugetlbfstest.patch
* selftests-vm-point-to-libhugetlbfs-for-regression-testing.patch
* documentation-update-libhugetlbfs-location-and-use-for-testing.patch
* page-flags-trivial-cleanup-for-pagetrans-helpers.patch
* page-flags-introduce-page-flags-policies-wrt-compound-pages.patch
* page-flags-define-pg_locked-behavior-on-compound-pages.patch
* page-flags-define-behavior-of-fs-io-related-flags-on-compound-pages.patch
* page-flags-define-behavior-of-lru-related-flags-on-compound-pages.patch
* page-flags-define-behavior-of-lru-related-flags-on-compound-pages-fix.patch
* page-flags-define-behavior-of-lru-related-flags-on-compound-pages-fix-fix.patch
* page-flags-define-behavior-slb-related-flags-on-compound-pages.patch
* page-flags-define-behavior-of-xen-related-flags-on-compound-pages.patch
* page-flags-define-pg_reserved-behavior-on-compound-pages.patch
* page-flags-define-pg_swapbacked-behavior-on-compound-pages.patch
* page-flags-define-pg_swapcache-behavior-on-compound-pages.patch
* page-flags-define-pg_mlocked-behavior-on-compound-pages.patch
* page-flags-define-pg_uncached-behavior-on-compound-pages.patch
* page-flags-define-pg_uptodate-behavior-on-compound-pages.patch
* page-flags-look-on-head-page-if-the-flag-is-encoded-in-page-mapping.patch
* mm-sanitize-page-mapping-for-tail-pages.patch
* include-linux-page-flagsh-rename-macros-to-avoid-collisions.patch
* memcg-add-page_cgroup_ino-helper.patch
* memcg-add-page_cgroup_ino-helper-fix.patch
* hwpoison-use-page_cgroup_ino-for-filtering-by-memcg.patch
* memcg-zap-try_get_mem_cgroup_from_page.patch
* proc-add-kpagecgroup-file.patch
* mmu-notifier-add-clear_young-callback.patch
* mmu-notifier-add-clear_young-callback-fix.patch
* proc-add-kpageidle-file.patch
* proc-add-kpageidle-file-fix.patch
* proc-add-kpageidle-file-fix-2.patch
* proc-add-kpageidle-file-fix-3.patch
* proc-add-kpageidle-file-fix-4.patch
* proc-add-kpageidle-file-fix-5.patch
* proc-add-kpageidle-file-fix-6.patch
* proc-add-kpageidle-file-fix-6-fix.patch
* proc-export-idle-flag-via-kpageflags.patch
* proc-export-idle-flag-via-kpageflags-fix.patch
* proc-add-cond_resched-to-proc-kpage-read-write-loop.patch
* mm-increase-swap_cluster_max-to-batch-tlb-flushes.patch
* mm-vmscan-fix-the-page-state-calculation-in-too_many_isolated.patch
* mm-page_isolation-check-pfn-validity-before-access.patch
* mm-fix-invalid-use-of-pfn_valid_within-in-test_pages_in_a_zone.patch
* fs-mpagec-forgotten-write_sync-in-case-of-data-integrity-write.patch
* 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-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-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
* zsmalloc-drop-unused-variable-nr_to_migrate.patch
* zsmalloc-always-keep-per-class-stats.patch
* zsmalloc-introduce-zs_can_compact-function.patch
* zsmalloc-cosmetic-compaction-code-adjustments.patch
* zsmalloc-zram-introduce-zs_pool_stats-api.patch
* zsmalloc-account-the-number-of-compacted-pages.patch
* zsmalloc-use-shrinker-to-trigger-auto-compaction.patch
* zsmalloc-partial-page-ordering-within-a-fullness_list.patch
* zsmalloc-consider-zs_almost_full-as-migrate-source.patch
* zsmalloc-use-class-pages_per_zspage.patch
* zsmalloc-do-not-take-class-lock-in-zs_shrinker_count.patch
* zsmalloc-remove-null-check-from-destroy_handle_cache.patch
* mm-swap-zswap-maybe_preload-refactoring.patch
* mm-zpool-constify-the-zpool_ops.patch
* mm-zbud-constify-the-zbud_ops.patch
* zpool-add-zpool_has_pool.patch
* zswap-dynamic-pool-creation.patch
* zswap-dynamic-pool-creation-fix.patch
* zswap-change-zpool-compressor-at-runtime.patch
* procfs-always-expose-proc-pid-map_files-and-make-it-readable.patch
* procfs-always-expose-proc-pid-map_files-and-make-it-readable-fix.patch
* procfs-always-expose-proc-pid-map_files-and-make-it-readable-fix-fix.patch
* proc-change-proc_subdir_lock-to-a-rwlock.patch
* fix-list_poison12-offset.patch
* use-poison_pointer_delta-for-poison-pointers.patch
* remove-not-used-poison-pointer-macros.patch
* extable-remove-duplicated-include-from-extablec.patch
* printk-include-pr_fmt-in-pr_debug_ratelimited.patch
* lib-vsprintf-add-%pt-format-specifier.patch
* maintainers-credits-mark-maxraid-as-orphan-move-anil-ravindranath-to-credits.patch
* kstrto-accept-0-for-signed-conversion.patch
* add-parse_integer-replacement-for-simple_strto.patch
* parse_integer-add-runtime-testsuite.patch
* parse-integer-rewrite-kstrto.patch
* parse_integer-add-checkpatchpl-notice.patch
* parse_integer-convert-scanf.patch
* scanf-fix-type-range-overflow.patch
* parse_integer-convert-lib.patch
* parse_integer-convert-mm.patch
* parse_integer-convert-mm-fix.patch
* parse_integer-convert-fs.patch
* parse_integer-convert-fs-cachefiles.patch
* parse_integer-convert-ext2-ext3-ext4.patch
* parse_integer-convert-fs-ocfs2.patch
* parse_integer-convert-fs-9p.patch
* parse_integer-convert-fs-exofs.patch
* proc-convert-to-kstrto-kstrto_from_user.patch
* sound-convert-to-parse_integer.patch
* lib-bitmapc-correct-a-code-style-and-do-some-optimization.patch
* lib-bitmapc-fix-a-special-string-handling-bug-in-__bitmap_parselist.patch
* lib-bitmapc-bitmap_parselist-can-accept-string-with-whitespaces-on-head-or-tail.patch
* hexdump-do-not-print-debug-dumps-for-config_debug.patch
* lib-string_helpers-clarify-esc-arg-in-string_escape_mem.patch
* lib-string_helpers-rename-esc-arg-to-only.patch
* test_user_copy-check-legit-kernel-accesses.patch
* test_user_copy-check-unchecked-accessors.patch
* test_user_copy-check-__clear_user-clear_user.patch
* test_user_copy-check-__copy_in_user-copy_in_user.patch
* test_user_copy-check-__copy_tofrom_user_inatomic.patch
* test_user_copy-check-user-string-accessors.patch
* test_user_copy-check-user-checksum-functions.patch
* mm-utilc-add-kstrimdup.patch
* lib-add-crc64-ecma-module.patch
* checkpatch-warn-on-bare-sha-1-commit-ids-in-commit-logs.patch
* checkpatch-add-warning-on-bug-bug_on-use.patch
* checkpatch-improve-suspect_code_indent-test.patch
* checkpatch-allow-longer-declaration-macros.patch
* checkpatch-add-some-foo_destroy-functions-to-needless_if-tests.patch
* checkpatch-report-the-right-line-when-using-emacs-and-file.patch
* checkpatch-always-check-block-comment-styles.patch
* checkpatch-make-strict-the-default-for-drivers-staging-files-and-patches.patch
* checkpatch-emit-an-error-on-formats-with-0x%decimal.patch
* checkpatch-avoid-some-commit-message-long-line-warnings.patch
* fs-coda-fix-readlink-buffer-overflow.patch
* fs-coda-fix-readlink-buffer-overflow-checkpatch-fixes.patch
* hfshfsplus-cache-pages-correctly-between-bnode_create-and-bnode_free.patch
* hfs-fix-b-tree-corruption-after-insertion-at-position-0.patch
* fat-add-fat_fallocate-operation.patch
* fat-skip-cluster-allocation-on-fallocated-region.patch
* fat-permit-to-return-phy-block-number-by-fibmap-in-fallocated-region.patch
* documentation-filesystems-vfattxt-update-the-limitation-for-fat-fallocate.patch
* fs-if-a-coredump-already-exists-unlink-and-recreate-with-o_excl.patch
* fs-dont-dump-core-if-the-corefile-would-become-world-readable.patch
* seq_file-provide-an-analogue-of-print_hex_dump.patch
* crypto-qat-use-seq_hex_dump-to-dump-buffers.patch
* parisc-use-seq_hex_dump-to-dump-buffers.patch
* zcrypt-use-seq_hex_dump-to-dump-buffers.patch
* kmemleak-use-seq_hex_dump-to-dump-buffers.patch
* wil6210-use-seq_hex_dump-to-dump-buffers.patch
* kexec-split-kexec_file-syscall-code-to-kexec_filec.patch
* kexec-split-kexec_load-syscall-from-kexec-core-code.patch
* kexec-split-kexec_load-syscall-from-kexec-core-code-checkpatch-fixes.patch
* kexec-remove-the-unnecessary-conditional-judgement-to-simplify-the-code-logic.patch
* kdump-vmcoreinfo-report-actual-value-of-phys_base.patch
* fs-char_devc-fix-incorrect-documentation-for-unregister_chrdev_region.patch
* sysctl-fix-int-unsigned-long-assignments-in-int_min-case.patch
* make-affs-root-lookup-from-blkdev-logical-size.patch
* w1-masters-omap_hdq-add-support-for-1-wire-mode.patch
* ipc-convert-invalid-scenarios-to-use-warn_on.patch
* ipc-msgc-msgsnd-use-freezable-blocking-call.patch
* msgrcv-use-freezable-blocking-call.patch
  linux-next.patch
  linux-next-rejects.patch
  userfaultfd-selftest-update-userfaultfd-x86-32bit-syscall-number.patch
* drivers-gpu-drm-i915-intel_spritec-fix-build.patch
* drivers-gpu-drm-i915-intel_tvc-fix-build.patch
* net-netfilter-ipset-work-around-gcc-444-initializer-bug.patch
* arm-mm-do-not-use-virt_to_idmap-for-nommu-systems.patch
* namei-fix-warning-while-make-xmldocs-caused-by-nameic.patch
* fs-seq_file-convert-int-seq_vprint-seq_printf-etc-returns-to-void.patch
* fs-seq_file-convert-int-seq_vprint-seq_printf-etc-returns-to-void-fix.patch
* mm-mark-most-vm_operations_struct-const.patch
* mm-mpx-add-vm_flags_t-vm_flags-arg-to-do_mmap_pgoff.patch
* mm-mpx-add-vm_flags_t-vm_flags-arg-to-do_mmap_pgoff-fix.patch
* mm-mpx-add-vm_flags_t-vm_flags-arg-to-do_mmap_pgoff-fix-checkpatch-fixes.patch
* mm-make-sure-all-file-vmas-have-vm_ops-set.patch
* mm-use-vma_is_anonymous-in-create_huge_pmd-and-wp_huge_pmd.patch
* mm-madvise-use-vma_is_anonymous-to-check-for-anon-vma.patch
* linux-bitmap-force-inlining-of-bitmap-weight-functions.patch
* x86-hweight-force-inlining-of-__arch_hweight3264.patch
* jiffies-force-inlining-of-mumsecs_to_jiffies.patch
* w1-call-put_device-if-device_register-fails.patch
  mm-add-strictlimit-knob-v2.patch
  do_shared_fault-check-that-mmap_sem-is-held.patch
  make-sure-nobodys-leaking-resources.patch
  releasing-resources-with-children.patch
  make-frame_pointer-default=y.patch
  kernel-forkc-export-kernel_thread-to-modules.patch
  mutex-subsystem-synchro-test-module.patch
  slab-leaks3-default-y.patch
  add-debugging-aid-for-memory-initialisation-problems.patch
  workaround-for-a-pci-restoring-bug.patch

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

* Re: mmotm 2015-08-05-17-06 uploaded
  2015-08-06  0:06 mmotm 2015-08-05-17-06 uploaded akpm
@ 2015-08-06 12:53 ` Michal Hocko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2015-08-06 12:53 UTC (permalink / raw)
  To: akpm; +Cc: mm-commits, linux-kernel, linux-mm, linux-fsdevel, linux-next, sfr

Andrew, it seems that proc-add-kpageidle-file-fix-6.patch
(pasted below) is incomplete. Unlike the original patch
(http://marc.info/?l=linux-mm&m=143826131310409&w=2) it is missing hunks
which are removing struct page_ext_operations page_idle_ops = {} and
others from
fs/proc/page.c and that leads to
fs/built-in.o:(.data+0xa4dc): multiple definition of `page_idle_ops'
mm/built-in.o:(.data+0x979c): first defined here
make: *** [vmlinux] Error 1

I have applied the original patch for my git tree. 
---
From: Vladimir Davydov <vdavydov@parallels.com>
Subject: Move /proc/kpageidle to /sys/kernel/mm/page_idle/bitmap

Since IDLE_PAGE_TRACKING does not need to depend on PROC_FS anymore,
this patch also moves the code from fs/proc/page.c to mm/page_idle.c and
introduces a dedicated header file include/linux/page_idle.h.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Andres Lagar-Cavilla <andreslc@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 Documentation/vm/idle_page_tracking.txt |   38 +--
 Documentation/vm/pagemap.txt            |    5 
 fs/proc/page.c                          |    8 
 fs/proc/task_mmu.c                      |    1 
 include/linux/mm.h                      |   98 ---------
 include/linux/page_idle.h               |  110 ++++++++++
 mm/Kconfig                              |    3 
 mm/Makefile                             |    1 
 mm/huge_memory.c                        |    1 
 mm/migrate.c                            |    1 
 mm/page_ext.c                           |    1 
 mm/page_idle.c                          |  232 ++++++++++++++++++++++
 mm/rmap.c                               |    1 
 mm/swap.c                               |    1 
 14 files changed, 373 insertions(+), 128 deletions(-)

diff -puN Documentation/vm/idle_page_tracking.txt~proc-add-kpageidle-file-fix-6 Documentation/vm/idle_page_tracking.txt
--- a/Documentation/vm/idle_page_tracking.txt~proc-add-kpageidle-file-fix-6
+++ a/Documentation/vm/idle_page_tracking.txt
@@ -6,10 +6,12 @@ estimating the workload's working set si
 account when configuring the workload parameters, setting memory cgroup limits,
 or deciding where to place the workload within a compute cluster.
 
+It is enabled by CONFIG_IDLE_PAGE_TRACKING=y.
+
 USER API
 
-If CONFIG_IDLE_PAGE_TRACKING was enabled on compile time, a new read-write file
-is present on the proc filesystem, /proc/kpageidle.
+The idle page tracking API is located at /sys/kernel/mm/page_idle. Currently,
+it consists of the only read-write file, /sys/kernel/mm/page_idle/bitmap.
 
 The file implements a bitmap where each bit corresponds to a memory page. The
 bitmap is represented by an array of 8-byte integers, and the page at PFN #i is
@@ -30,24 +32,25 @@ and hence such pages are never reported
 For huge pages the idle flag is set only on the head page, so one has to read
 /proc/kpageflags in order to correctly count idle huge pages.
 
-Reading from or writing to /proc/kpageidle will return -EINVAL if you are not
-starting the read/write on an 8-byte boundary, or if the size of the read/write
-is not a multiple of 8 bytes. Writing to this file beyond max PFN will return
--ENXIO.
+Reading from or writing to /sys/kernel/mm/page_idle/bitmap will return
+-EINVAL if you are not starting the read/write on an 8-byte boundary, or
+if the size of the read/write is not a multiple of 8 bytes. Writing to
+this file beyond max PFN will return -ENXIO.
 
 That said, in order to estimate the amount of pages that are not used by a
 workload one should:
 
- 1. Mark all the workload's pages as idle by setting corresponding bits in the
-    /proc/kpageidle bitmap. The pages can be found by reading /proc/pid/pagemap
-    if the workload is represented by a process, or by filtering out alien pages
-    using /proc/kpagecgroup in case the workload is placed in a memory cgroup.
+ 1. Mark all the workload's pages as idle by setting corresponding bits in
+    /sys/kernel/mm/page_idle/bitmap. The pages can be found by reading
+    /proc/pid/pagemap if the workload is represented by a process, or by
+    filtering out alien pages using /proc/kpagecgroup in case the workload is
+    placed in a memory cgroup.
 
  2. Wait until the workload accesses its working set.
 
- 3. Read /proc/kpageidle and count the number of bits set. If one wants to
-    ignore certain types of pages, e.g. mlocked pages since they are not
-    reclaimable, he or she can filter them out using /proc/kpageflags.
+ 3. Read /sys/kernel/mm/page_idle/bitmap and count the number of bits set. If
+    one wants to ignore certain types of pages, e.g. mlocked pages since they
+    are not reclaimable, he or she can filter them out using /proc/kpageflags.
 
 See Documentation/vm/pagemap.txt for more information about /proc/pid/pagemap,
 /proc/kpageflags, and /proc/kpagecgroup.
@@ -74,8 +77,9 @@ When a dirty page is written to swap or
 exceeding the dirty memory limit, it is not marked referenced.
 
 The idle memory tracking feature adds a new page flag, the Idle flag. This flag
-is set manually, by writing to /proc/kpageidle (see the USER API section), and
-cleared automatically whenever a page is referenced as defined above.
+is set manually, by writing to /sys/kernel/mm/page_idle/bitmap (see the USER API
+section), and cleared automatically whenever a page is referenced as defined
+above.
 
 When a page is marked idle, the Accessed bit must be cleared in all PTEs it is
 mapped to, otherwise we will not be able to detect accesses to the page coming
@@ -90,5 +94,5 @@ Since the idle memory tracking feature i
 it only works with pages that are on an LRU list, other pages are silently
 ignored. That means it will ignore a user memory page if it is isolated, but
 since there are usually not many of them, it should not affect the overall
-result noticeably. In order not to stall scanning of /proc/kpageidle, locked
-pages may be skipped too.
+result noticeably. In order not to stall scanning of the idle page bitmap,
+locked pages may be skipped too.
diff -puN Documentation/vm/pagemap.txt~proc-add-kpageidle-file-fix-6 Documentation/vm/pagemap.txt
--- a/Documentation/vm/pagemap.txt~proc-add-kpageidle-file-fix-6
+++ a/Documentation/vm/pagemap.txt
@@ -5,7 +5,7 @@ pagemap is a new (as of 2.6.25) set of i
 userspace programs to examine the page tables and related information by
 reading files in /proc.
 
-There are five components to pagemap:
+There are four components to pagemap:
 
  * /proc/pid/pagemap.  This file lets a userspace process find out which
    physical frame each virtual page is mapped to.  It contains one 64-bit
@@ -75,9 +75,6 @@ There are five components to pagemap:
    memory cgroup each page is charged to, indexed by PFN. Only available when
    CONFIG_MEMCG is set.
 
- * /proc/kpageidle.  This file comprises API of the idle page tracking feature.
-   See Documentation/vm/idle_page_tracking.txt for more details.
-
 Short descriptions to the page flags:
 
  0. LOCKED
diff -puN fs/proc/page.c~proc-add-kpageidle-file-fix-6 fs/proc/page.c
--- a/fs/proc/page.c~proc-add-kpageidle-file-fix-6
+++ a/fs/proc/page.c
@@ -5,20 +5,18 @@
 #include <linux/ksm.h>
 #include <linux/mm.h>
 #include <linux/mmzone.h>
-#include <linux/rmap.h>
-#include <linux/mmu_notifier.h>
 #include <linux/huge_mm.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/hugetlb.h>
 #include <linux/memcontrol.h>
+#include <linux/page_idle.h>
 #include <linux/kernel-page-flags.h>
 #include <asm/uaccess.h>
 #include "internal.h"
 
 #define KPMSIZE sizeof(u64)
 #define KPMMASK (KPMSIZE - 1)
-#define KPMBITS (KPMSIZE * BITS_PER_BYTE)
 
 /* /proc/kpagecount - an array exposing page counts
  *
@@ -500,10 +498,6 @@ static int __init proc_page_init(void)
 #ifdef CONFIG_MEMCG
 	proc_create("kpagecgroup", S_IRUSR, NULL, &proc_kpagecgroup_operations);
 #endif
-#ifdef CONFIG_IDLE_PAGE_TRACKING
-	proc_create("kpageidle", S_IRUSR | S_IWUSR, NULL,
-		    &proc_kpageidle_operations);
-#endif
 	return 0;
 }
 fs_initcall(proc_page_init);
diff -puN fs/proc/task_mmu.c~proc-add-kpageidle-file-fix-6 fs/proc/task_mmu.c
--- a/fs/proc/task_mmu.c~proc-add-kpageidle-file-fix-6
+++ a/fs/proc/task_mmu.c
@@ -13,6 +13,7 @@
 #include <linux/swap.h>
 #include <linux/swapops.h>
 #include <linux/mmu_notifier.h>
+#include <linux/page_idle.h>
 
 #include <asm/elf.h>
 #include <asm/uaccess.h>
diff -puN include/linux/mm.h~proc-add-kpageidle-file-fix-6 include/linux/mm.h
--- a/include/linux/mm.h~proc-add-kpageidle-file-fix-6
+++ a/include/linux/mm.h
@@ -2191,103 +2191,5 @@ void __init setup_nr_node_ids(void);
 static inline void setup_nr_node_ids(void) {}
 #endif
 
-#ifdef CONFIG_IDLE_PAGE_TRACKING
-#ifdef CONFIG_64BIT
-static inline bool page_is_young(struct page *page)
-{
-	return PageYoung(page);
-}
-
-static inline void set_page_young(struct page *page)
-{
-	SetPageYoung(page);
-}
-
-static inline bool test_and_clear_page_young(struct page *page)
-{
-	return TestClearPageYoung(page);
-}
-
-static inline bool page_is_idle(struct page *page)
-{
-	return PageIdle(page);
-}
-
-static inline void set_page_idle(struct page *page)
-{
-	SetPageIdle(page);
-}
-
-static inline void clear_page_idle(struct page *page)
-{
-	ClearPageIdle(page);
-}
-#else /* !CONFIG_64BIT */
-/*
- * If there is not enough space to store Idle and Young bits in page flags, use
- * page ext flags instead.
- */
-extern struct page_ext_operations page_idle_ops;
-
-static inline bool page_is_young(struct page *page)
-{
-	return test_bit(PAGE_EXT_YOUNG, &lookup_page_ext(page)->flags);
-}
-
-static inline void set_page_young(struct page *page)
-{
-	set_bit(PAGE_EXT_YOUNG, &lookup_page_ext(page)->flags);
-}
-
-static inline bool test_and_clear_page_young(struct page *page)
-{
-	return test_and_clear_bit(PAGE_EXT_YOUNG,
-				  &lookup_page_ext(page)->flags);
-}
-
-static inline bool page_is_idle(struct page *page)
-{
-	return test_bit(PAGE_EXT_IDLE, &lookup_page_ext(page)->flags);
-}
-
-static inline void set_page_idle(struct page *page)
-{
-	set_bit(PAGE_EXT_IDLE, &lookup_page_ext(page)->flags);
-}
-
-static inline void clear_page_idle(struct page *page)
-{
-	clear_bit(PAGE_EXT_IDLE, &lookup_page_ext(page)->flags);
-}
-#endif /* CONFIG_64BIT */
-#else /* !CONFIG_IDLE_PAGE_TRACKING */
-static inline bool page_is_young(struct page *page)
-{
-	return false;
-}
-
-static inline void set_page_young(struct page *page)
-{
-}
-
-static inline bool test_and_clear_page_young(struct page *page)
-{
-	return false;
-}
-
-static inline bool page_is_idle(struct page *page)
-{
-	return false;
-}
-
-static inline void set_page_idle(struct page *page)
-{
-}
-
-static inline void clear_page_idle(struct page *page)
-{
-}
-#endif /* CONFIG_IDLE_PAGE_TRACKING */
-
 #endif /* __KERNEL__ */
 #endif /* _LINUX_MM_H */
diff -puN /dev/null include/linux/page_idle.h
--- /dev/null
+++ a/include/linux/page_idle.h
@@ -0,0 +1,110 @@
+#ifndef _LINUX_MM_PAGE_IDLE_H
+#define _LINUX_MM_PAGE_IDLE_H
+
+#include <linux/bitops.h>
+#include <linux/page-flags.h>
+#include <linux/page_ext.h>
+
+#ifdef CONFIG_IDLE_PAGE_TRACKING
+
+#ifdef CONFIG_64BIT
+static inline bool page_is_young(struct page *page)
+{
+	return PageYoung(page);
+}
+
+static inline void set_page_young(struct page *page)
+{
+	SetPageYoung(page);
+}
+
+static inline bool test_and_clear_page_young(struct page *page)
+{
+	return TestClearPageYoung(page);
+}
+
+static inline bool page_is_idle(struct page *page)
+{
+	return PageIdle(page);
+}
+
+static inline void set_page_idle(struct page *page)
+{
+	SetPageIdle(page);
+}
+
+static inline void clear_page_idle(struct page *page)
+{
+	ClearPageIdle(page);
+}
+#else /* !CONFIG_64BIT */
+/*
+ * If there is not enough space to store Idle and Young bits in page flags, use
+ * page ext flags instead.
+ */
+extern struct page_ext_operations page_idle_ops;
+
+static inline bool page_is_young(struct page *page)
+{
+	return test_bit(PAGE_EXT_YOUNG, &lookup_page_ext(page)->flags);
+}
+
+static inline void set_page_young(struct page *page)
+{
+	set_bit(PAGE_EXT_YOUNG, &lookup_page_ext(page)->flags);
+}
+
+static inline bool test_and_clear_page_young(struct page *page)
+{
+	return test_and_clear_bit(PAGE_EXT_YOUNG,
+				  &lookup_page_ext(page)->flags);
+}
+
+static inline bool page_is_idle(struct page *page)
+{
+	return test_bit(PAGE_EXT_IDLE, &lookup_page_ext(page)->flags);
+}
+
+static inline void set_page_idle(struct page *page)
+{
+	set_bit(PAGE_EXT_IDLE, &lookup_page_ext(page)->flags);
+}
+
+static inline void clear_page_idle(struct page *page)
+{
+	clear_bit(PAGE_EXT_IDLE, &lookup_page_ext(page)->flags);
+}
+#endif /* CONFIG_64BIT */
+
+#else /* !CONFIG_IDLE_PAGE_TRACKING */
+
+static inline bool page_is_young(struct page *page)
+{
+	return false;
+}
+
+static inline void set_page_young(struct page *page)
+{
+}
+
+static inline bool test_and_clear_page_young(struct page *page)
+{
+	return false;
+}
+
+static inline bool page_is_idle(struct page *page)
+{
+	return false;
+}
+
+static inline void set_page_idle(struct page *page)
+{
+}
+
+static inline void clear_page_idle(struct page *page)
+{
+}
+
+#endif /* CONFIG_IDLE_PAGE_TRACKING */
+
+#endif /* _LINUX_MM_PAGE_IDLE_H */
diff -puN mm/Kconfig~proc-add-kpageidle-file-fix-6 mm/Kconfig
--- a/mm/Kconfig~proc-add-kpageidle-file-fix-6
+++ a/mm/Kconfig
@@ -657,8 +657,7 @@ config DEFERRED_STRUCT_PAGE_INIT
 
 config IDLE_PAGE_TRACKING
 	bool "Enable idle page tracking"
-	depends on PROC_FS && MMU
-	select PROC_PAGE_MONITOR
+	depends on SYSFS
 	select PAGE_EXTENSION if !64BIT
 	help
 	  This feature allows to estimate the amount of user pages that have
diff -puN mm/Makefile~proc-add-kpageidle-file-fix-6 mm/Makefile
--- a/mm/Makefile~proc-add-kpageidle-file-fix-6
+++ a/mm/Makefile
@@ -79,3 +79,4 @@ obj-$(CONFIG_MEMORY_BALLOON) += balloon_
 obj-$(CONFIG_PAGE_EXTENSION) += page_ext.o
 obj-$(CONFIG_CMA_DEBUGFS) += cma_debug.o
 obj-$(CONFIG_USERFAULTFD) += userfaultfd.o
+obj-$(CONFIG_IDLE_PAGE_TRACKING) += page_idle.o
diff -puN mm/huge_memory.c~proc-add-kpageidle-file-fix-6 mm/huge_memory.c
--- a/mm/huge_memory.c~proc-add-kpageidle-file-fix-6
+++ a/mm/huge_memory.c
@@ -25,6 +25,7 @@
 #include <linux/migrate.h>
 #include <linux/hashtable.h>
 #include <linux/userfaultfd_k.h>
+#include <linux/page_idle.h>
 
 #include <asm/tlb.h>
 #include <asm/pgalloc.h>
diff -puN mm/migrate.c~proc-add-kpageidle-file-fix-6 mm/migrate.c
--- a/mm/migrate.c~proc-add-kpageidle-file-fix-6
+++ a/mm/migrate.c
@@ -37,6 +37,7 @@
 #include <linux/gfp.h>
 #include <linux/balloon_compaction.h>
 #include <linux/mmu_notifier.h>
+#include <linux/page_idle.h>
 
 #include <asm/tlbflush.h>
 
diff -puN mm/page_ext.c~proc-add-kpageidle-file-fix-6 mm/page_ext.c
--- a/mm/page_ext.c~proc-add-kpageidle-file-fix-6
+++ a/mm/page_ext.c
@@ -6,6 +6,7 @@
 #include <linux/vmalloc.h>
 #include <linux/kmemleak.h>
 #include <linux/page_owner.h>
+#include <linux/page_idle.h>
 
 /*
  * struct page extension
diff -puN /dev/null mm/page_idle.c
--- /dev/null
+++ a/mm/page_idle.c
@@ -0,0 +1,232 @@
+#include <linux/init.h>
+#include <linux/bootmem.h>
+#include <linux/fs.h>
+#include <linux/sysfs.h>
+#include <linux/kobject.h>
+#include <linux/mm.h>
+#include <linux/mmzone.h>
+#include <linux/pagemap.h>
+#include <linux/rmap.h>
+#include <linux/mmu_notifier.h>
+#include <linux/page_ext.h>
+#include <linux/page_idle.h>
+
+#define BITMAP_CHUNK_SIZE	sizeof(u64)
+#define BITMAP_CHUNK_BITS	(BITMAP_CHUNK_SIZE * BITS_PER_BYTE)
+
+/*
+ * Idle page tracking only considers user memory pages, for other types of
+ * pages the idle flag is always unset and an attempt to set it is silently
+ * ignored.
+ *
+ * We treat a page as a user memory page if it is on an LRU list, because it is
+ * always safe to pass such a page to rmap_walk(), which is essential for idle
+ * page tracking. With such an indicator of user pages we can skip isolated
+ * pages, but since there are not usually many of them, it will hardly affect
+ * the overall result.
+ *
+ * This function tries to get a user memory page by pfn as described above.
+ */
+static struct page *page_idle_get_page(unsigned long pfn)
+{
+	struct page *page;
+	struct zone *zone;
+
+	if (!pfn_valid(pfn))
+		return NULL;
+
+	page = pfn_to_page(pfn);
+	if (!page || !PageLRU(page) ||
+	    !get_page_unless_zero(page))
+		return NULL;
+
+	zone = page_zone(page);
+	spin_lock_irq(&zone->lru_lock);
+	if (unlikely(!PageLRU(page))) {
+		put_page(page);
+		page = NULL;
+	}
+	spin_unlock_irq(&zone->lru_lock);
+	return page;
+}
+
+static int page_idle_clear_pte_refs_one(struct page *page,
+					struct vm_area_struct *vma,
+					unsigned long addr, void *arg)
+{
+	struct mm_struct *mm = vma->vm_mm;
+	spinlock_t *ptl;
+	pmd_t *pmd;
+	pte_t *pte;
+	bool referenced = false;
+
+	if (unlikely(PageTransHuge(page))) {
+		pmd = page_check_address_pmd(page, mm, addr,
+					     PAGE_CHECK_ADDRESS_PMD_FLAG, &ptl);
+		if (pmd) {
+			referenced = pmdp_clear_young_notify(vma, addr, pmd);
+			spin_unlock(ptl);
+		}
+	} else {
+		pte = page_check_address(page, mm, addr, &ptl, 0);
+		if (pte) {
+			referenced = ptep_clear_young_notify(vma, addr, pte);
+			pte_unmap_unlock(pte, ptl);
+		}
+	}
+	if (referenced) {
+		clear_page_idle(page);
+		/*
+		 * We cleared the referenced bit in a mapping to this page. To
+		 * avoid interference with page reclaim, mark it young so that
+		 * page_referenced() will return > 0.
+		 */
+		set_page_young(page);
+	}
+	return SWAP_AGAIN;
+}
+
+static void page_idle_clear_pte_refs(struct page *page)
+{
+	/*
+	 * Since rwc.arg is unused, rwc is effectively immutable, so we
+	 * can make it static const to save some cycles and stack.
+	 */
+	static const struct rmap_walk_control rwc = {
+		.rmap_one = page_idle_clear_pte_refs_one,
+		.anon_lock = page_lock_anon_vma_read,
+	};
+	bool need_lock;
+
+	if (!page_mapped(page) ||
+	    !page_rmapping(page))
+		return;
+
+	need_lock = !PageAnon(page) || PageKsm(page);
+	if (need_lock && !trylock_page(page))
+		return;
+
+	rmap_walk(page, (struct rmap_walk_control *)&rwc);
+
+	if (need_lock)
+		unlock_page(page);
+}
+
+static ssize_t page_idle_bitmap_read(struct file *file, struct kobject *kobj,
+				     struct bin_attribute *attr, char *buf,
+				     loff_t pos, size_t count)
+{
+	u64 *out = (u64 *)buf;
+	struct page *page;
+	unsigned long pfn, end_pfn;
+	int bit;
+
+	if (pos % BITMAP_CHUNK_SIZE || count % BITMAP_CHUNK_SIZE)
+		return -EINVAL;
+
+	pfn = pos * BITS_PER_BYTE;
+	if (pfn >= max_pfn)
+		return 0;
+
+	end_pfn = pfn + count * BITS_PER_BYTE;
+	if (end_pfn > max_pfn)
+		end_pfn = ALIGN(max_pfn, BITMAP_CHUNK_BITS);
+
+	for (; pfn < end_pfn; pfn++) {
+		bit = pfn % BITMAP_CHUNK_BITS;
+		if (!bit)
+			*out = 0ULL;
+		page = page_idle_get_page(pfn);
+		if (page) {
+			if (page_is_idle(page)) {
+				/*
+				 * The page might have been referenced via a
+				 * pte, in which case it is not idle. Clear
+				 * refs and recheck.
+				 */
+				page_idle_clear_pte_refs(page);
+				if (page_is_idle(page))
+					*out |= 1ULL << bit;
+			}
+			put_page(page);
+		}
+		if (bit == BITMAP_CHUNK_BITS - 1)
+			out++;
+		cond_resched();
+	}
+	return (char *)out - buf;
+}
+
+static ssize_t page_idle_bitmap_write(struct file *file, struct kobject *kobj,
+				      struct bin_attribute *attr, char *buf,
+				      loff_t pos, size_t count)
+{
+	const u64 *in = (u64 *)buf;
+	struct page *page;
+	unsigned long pfn, end_pfn;
+	int bit;
+
+	if (pos % BITMAP_CHUNK_SIZE || count % BITMAP_CHUNK_SIZE)
+		return -EINVAL;
+
+	pfn = pos * BITS_PER_BYTE;
+	if (pfn >= max_pfn)
+		return -ENXIO;
+
+	end_pfn = pfn + count * BITS_PER_BYTE;
+	if (end_pfn > max_pfn)
+		end_pfn = ALIGN(max_pfn, BITMAP_CHUNK_BITS);
+
+	for (; pfn < end_pfn; pfn++) {
+		bit = pfn % BITMAP_CHUNK_BITS;
+		if ((*in >> bit) & 1) {
+			page = page_idle_get_page(pfn);
+			if (page) {
+				page_idle_clear_pte_refs(page);
+				set_page_idle(page);
+				put_page(page);
+			}
+		}
+		if (bit == BITMAP_CHUNK_BITS - 1)
+			in++;
+		cond_resched();
+	}
+	return (char *)in - buf;
+}
+
+static struct bin_attribute page_idle_bitmap_attr =
+		__BIN_ATTR(bitmap, S_IRUSR | S_IWUSR,
+			   page_idle_bitmap_read, page_idle_bitmap_write, 0);
+
+static struct bin_attribute *page_idle_bin_attrs[] = {
+	&page_idle_bitmap_attr,
+	NULL,
+};
+
+static struct attribute_group page_idle_attr_group = {
+	.bin_attrs = page_idle_bin_attrs,
+	.name = "page_idle",
+};
+
+#ifndef CONFIG_64BIT
+static bool need_page_idle(void)
+{
+	return true;
+}
+struct page_ext_operations page_idle_ops = {
+	.need = need_page_idle,
+};
+#endif
+
+static int __init page_idle_init(void)
+{
+	int err;
+
+	err = sysfs_create_group(mm_kobj, &page_idle_attr_group);
+	if (err) {
+		pr_err("page_idle: register sysfs failed\n");
+		return err;
+	}
+	return 0;
+}
+subsys_initcall(page_idle_init);
diff -puN mm/rmap.c~proc-add-kpageidle-file-fix-6 mm/rmap.c
--- a/mm/rmap.c~proc-add-kpageidle-file-fix-6
+++ a/mm/rmap.c
@@ -59,6 +59,7 @@
 #include <linux/migrate.h>
 #include <linux/hugetlb.h>
 #include <linux/backing-dev.h>
+#include <linux/page_idle.h>
 
 #include <asm/tlbflush.h>
 
diff -puN mm/swap.c~proc-add-kpageidle-file-fix-6 mm/swap.c
--- a/mm/swap.c~proc-add-kpageidle-file-fix-6
+++ a/mm/swap.c
@@ -32,6 +32,7 @@
 #include <linux/gfp.h>
 #include <linux/uio.h>
 #include <linux/hugetlb.h>
+#include <linux/page_idle.h>
 
 #include "internal.h"
 
_
-- 
Michal Hocko
SUSE Labs

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

end of thread, other threads:[~2015-08-06 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-06  0:06 mmotm 2015-08-05-17-06 uploaded akpm
2015-08-06 12:53 ` Michal Hocko

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