All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Borislav Petkov <bp@alien8.de>, Qian Cai <cai@lca.pw>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Gerald Schaefer <gerald.schaefer@de.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Peter Anvin <hpa@zytor.com>,
	"Kirill A . Shutemov" <kirill@shutemov.name>,
	Linux-MM <linux-mm@kvack.org>, Ingo Molnar <mingo@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	mm-commits@vger.kernel.org, Michael Ellerman <mpe@ellerman.id.au>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Paul Mackerras <paulus@samba.org>,
	Mike Rapoport <rppt@linux.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	vgupta@synopsys.com, Will Deacon <will@kernel.org>
Subject: Re: [patch 1/1] mm/debug: add tests validating architecture page table helpers
Date: Mon, 13 Apr 2020 07:43:22 +0530	[thread overview]
Message-ID: <09a03353-459d-f914-eb5f-2b680ebfe483@arm.com> (raw)
In-Reply-To: <CAHk-=wisujXm6ZLtiBDCFPAUd1PeBDVVr4C+FFgQgKSzTVn+FQ@mail.gmail.com>



On 04/12/2020 10:03 PM, Linus Torvalds wrote:
> On Sun, Apr 12, 2020 at 12:42 AM Andrew Morton
> <akpm@linux-foundation.org> wrote:
>>
>> Test page table pages are allocated from system memory with required size
>> and alignments.  The mapped pfns at page table levels are derived from a
>> real pfn representing a valid kernel text symbol.  This test gets called
>> inside kernel_init() right after async_synchronize_full().
> 
> This last part makes absolutely zero sense to me.
> 
> Why would it be done before the machine is properly up? Why isn't this
> just a module with a module_init? What makes this test so important
> and magical that it has to be done during early boot?

This test first started with being a module_init(), then a late_initcall()
before getting called inside kernel_init() in it's current form. During our
early review process (https://patchwork.kernel.org/patch/11176831/) Ingo had
suggested moving this test earlier during boot to catch potential page table
helper problems (if any), which made sense.

This test does not particularly need to run during early boot but it might
just be preferable to detect potential page table helper problems (if any)
earlier before they start getting used some where else. Though I guess it
is not absolutely necessary either.

> 
> So not applied, particularly since this apparently caused problems. We
> don't randomly break the boot, which is fragile anyway, just for a
> test that doesn't look like it should be boot-specific to me.

Fair enough, will change this to late_initcall().

Just to give some more historical context..

This test has been validated on all explicitly supported platforms (i.e via
enabling ARCH_HAS_DEBUG_VM_PGTABLE) i.e arm64, s390, arc, powerpc (32 and 64),
x86 (!X86_PAE). But this can also be enabled via CONFIG_EXPERT on platforms
that dont subscribe ARCH_HAS_DEBUG_VM_PGTABLE either because there were no
volunteers to run the test or the test might just fail to run. The idea behind
allowing this test get enabled via CONFIG_EXPERT was to just facilitate easy
experimentation (without really changing Kconfig) on platforms that dont support
it just yet through ARCH_HAS_DEBUG_VM_PGTABLE. There was a recent bug report for
one such scenarios [1]. But we do expect such scenarios to exist on platforms
without ARCH_HAS_DEBUG_VM_PGTABLE and CONFIG_EXPERT method was precisely provided
for the very same reason.

[1] https://lore.kernel.org/lkml/fb14237e-f973-bc34-4981-280ba5e1eb92@arm.com/

> 
> If it wants a new clean mm, it should just do a fork. And do so
> _looong_ long after boot.
> 
>                 Linus
> 


  reply	other threads:[~2020-04-13  2:13 UTC|newest]

Thread overview: 144+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12  7:41 incoming Andrew Morton
2020-04-12  7:42 ` [patch 1/1] mm/debug: add tests validating architecture page table helpers Andrew Morton
2020-04-12 16:33   ` Linus Torvalds
2020-04-13  2:13     ` Anshuman Khandual [this message]
2020-04-13 20:01 ` + mm-userfaultfd-disable-userfaultfd-wp-on-x86_32.patch added to -mm tree Andrew Morton
2020-04-13 20:08 ` + maintainers-add-an-entry-for-kfifo-fix.patch " Andrew Morton
2020-04-13 20:11 ` + m68k-drop-redundant-generic-y-=-hardirqh.patch " Andrew Morton
2020-04-13 20:12 ` + userc-make-uidhash_table-static.patch " Andrew Morton
2020-04-13 20:34 ` + sh-fix-build-error-in-mm-initc.patch " Andrew Morton
2020-04-13 20:51 ` + mm-hugetlb-fix-a-addressing-exception-caused-by-huge_pte_offset.patch " Andrew Morton
2020-04-13 21:16 ` + checkpatch-additional-maintainer-section-entry-ordering-checks.patch " Andrew Morton
2020-04-13 22:27 ` + fat-improve-the-readahead-for-fat-entries.patch " Andrew Morton
2020-04-13 22:32 ` + mm-swapfile-use-list_prevnext_entry-instead-of-open-coding.patch " Andrew Morton
2020-04-13 22:33 ` + mm-replace-zero-length-array-with-flexible-array-member.patch " Andrew Morton
2020-04-13 22:36 ` + mm-vmsan-fix-some-typos-in-comment.patch " Andrew Morton
2020-04-13 22:38 ` + mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch " Andrew Morton
2020-04-13 22:38 ` + mm-memblock-fix-a-typo-in-comment-implict-implicit.patch " Andrew Morton
2020-04-13 22:38 ` + mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch " Andrew Morton
2020-04-13 22:50 ` + mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch " Andrew Morton
2020-04-13 22:51 ` + mm-frontswap-fix-some-typos-in-frontswapc.patch " Andrew Morton
2020-04-13 22:51 ` + mm-memcg-fix-some-typos-in-memcontrolc.patch " Andrew Morton
2020-04-13 22:51 ` + mm-fix-a-typo-in-comment-strucure-structure.patch " Andrew Morton
2020-04-13 23:07 ` + mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch " Andrew Morton
2020-04-13 23:07 ` + mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch " Andrew Morton
2020-04-13 23:07 ` + mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch " Andrew Morton
2020-04-13 23:07 ` + mm-memory-fix-a-typo-in-comment-attampt-attempt.patch " Andrew Morton
2020-04-14  0:25 ` + mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch " Andrew Morton
2020-04-14  0:25 ` + mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch " Andrew Morton
2020-04-14  0:25 ` + mm-remove-config_have_memblock_node_map-option.patch " Andrew Morton
2020-04-14  0:25 ` + mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch " Andrew Morton
2020-04-14  0:25 ` + mm-use-free_area_init-instead-of-free_area_init_nodes.patch " Andrew Morton
2020-04-14  0:26 ` + alpha-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + arm-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch " Andrew Morton
2020-04-14  0:26 ` + csky-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + m68k-mm-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + parisc-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + sparc32-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + unicore32-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + xtensa-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + mm-memmap_init-iterate-over-memblock-regions-rather-that-check-each-pfn.patch " Andrew Morton
2020-04-14  0:26 ` + mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch " Andrew Morton
2020-04-14  0:26 ` + mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch " Andrew Morton
2020-04-14  0:26 ` + mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch " Andrew Morton
2020-04-14  0:26 ` + mm-clean-up-free_area_init_node-and-its-helpers.patch " Andrew Morton
2020-04-14  0:26 ` + mm-simplify-find_min_pfn_with_active_regions.patch " Andrew Morton
2020-04-14  0:27 ` + docs-vm-update-memory-models-documentation.patch " Andrew Morton
2020-04-14  0:40 ` + mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison.patch " Andrew Morton
2020-04-14  0:40 ` + mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch " Andrew Morton
2020-04-14  0:40 ` + mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad.patch " Andrew Morton
2020-04-14  0:40 ` + mm-page_allocc-rename-free_pages_check-to-check_free_page.patch " Andrew Morton
2020-04-14  0:40 ` + mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason.patch " Andrew Morton
2020-04-14  0:52 ` + dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only.patch " Andrew Morton
2020-04-14  1:09 ` + mm-gup-return-eintr-when-gup-is-interrupted-by-fatal-signals.patch " Andrew Morton
2020-04-14  1:37 ` + squashfs-squashfs_fsh-replace-zero-length-array-with-flexible-array-member.patch " Andrew Morton
2020-04-14  1:37 ` + squashfs-migrate-from-ll_rw_block-usage-to-bio.patch " Andrew Morton
2020-04-14  1:39 ` + checkpatch-fix-a-typo-in-the-regex-for-allocfunctions.patch " Andrew Morton
2020-04-14  2:06 ` + powerpc-pseries-hotplug-memory-stop-checking-is_mem_section_removable.patch " Andrew Morton
2020-04-14  2:06 ` + mm-memory_hotplug-remove-is_mem_section_removable.patch " Andrew Morton
2020-04-14  2:13 ` [folded-merged] mm-clarify-__gfp_memalloc-usage-update.patch removed from " Andrew Morton
2020-04-14  2:13 ` [folded-merged] mm-clarify-__gfp_memalloc-usage-update-checkpatch-fixes.patch " Andrew Morton
2020-04-14 22:30 ` + maintainers-add-an-entry-for-kfifo-fix-fix.patch added to " Andrew Morton
2020-04-14 23:10 ` + mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch " Andrew Morton
2020-04-14 23:11 ` + mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2-checkpatch-fixes.patch " Andrew Morton
2020-04-14 23:11 ` + mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch " Andrew Morton
2020-04-14 23:56 ` + lib-add-might_fault-to-strncpy_from_user.patch " Andrew Morton
2020-04-15  0:00 ` + tools-build-tweak-unused-value-workaround.patch " Andrew Morton
2020-04-15  0:39 ` + h8300-remove-usage-of-__arch_use_5level_hack.patch " Andrew Morton
2020-04-15  0:39 ` + arm-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:39 ` + arm64-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:39 ` + hexagon-remove-__arch_use_5level_hack.patch " Andrew Morton
2020-04-15  0:39 ` + ia64-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:39 ` + nios2-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:40 ` + openrisc-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:40 ` + powerpc-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:40 ` + sh-fault-modernize-printing-of-kernel-messages.patch " Andrew Morton
2020-04-15  0:40 ` + sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch " Andrew Morton
2020-04-15  0:40 ` + sh-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:40 ` + unicore32-remove-__arch_use_5level_hack.patch " Andrew Morton
2020-04-15  0:40 ` + asm-generic-remove-pgtable-nop4d-hackh.patch " Andrew Morton
2020-04-15  0:40 ` + mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch " Andrew Morton
2020-04-15  1:17 ` + mm-move-readahead-prototypes-from-mmh.patch " Andrew Morton
2020-04-15  1:17 ` + mm-return-void-from-various-readahead-functions.patch " Andrew Morton
2020-04-15  1:17 ` + mm-ignore-return-value-of-readpages.patch " Andrew Morton
2020-04-15  1:17 ` + mm-move-readahead-nr_pages-check-into-read_pages.patch " Andrew Morton
2020-04-15  1:17 ` + mm-add-new-readahead_control-api.patch " Andrew Morton
2020-04-15  1:17 ` + mm-use-readahead_control-to-pass-arguments.patch " Andrew Morton
2020-04-15  1:17 ` + mm-rename-various-offset-parameters-to-index.patch " Andrew Morton
2020-04-15  1:17 ` + mm-rename-readahead-loop-variable-to-i.patch " Andrew Morton
2020-04-15  1:17 ` + mm-remove-page_offset-from-readahead-loop.patch " Andrew Morton
2020-04-15  1:17 ` + mm-put-readahead-pages-in-cache-earlier.patch " Andrew Morton
2020-04-15  1:17 ` + mm-add-readahead-address-space-operation.patch " Andrew Morton
2020-04-15  1:17 ` + mm-move-end_index-check-out-of-readahead-loop.patch " Andrew Morton
2020-04-15  1:18 ` + mm-add-page_cache_readahead_unbounded.patch " Andrew Morton
2020-04-15  1:18 ` + mm-document-why-we-dont-set-pagereadahead.patch " Andrew Morton
2020-04-15  1:18 ` + mm-use-memalloc_nofs_save-in-readahead-path.patch " Andrew Morton
2020-04-15  1:18 ` + fs-convert-mpage_readpages-to-mpage_readahead.patch " Andrew Morton
2020-04-15  1:18 ` + btrfs-convert-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + erofs-convert-uncompressed-files-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + erofs-convert-compressed-files-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + ext4-convert-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + ext4-pass-the-inode-to-ext4_mpage_readpages.patch " Andrew Morton
2020-04-15  1:18 ` + f2fs-convert-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + f2fs-pass-the-inode-to-f2fs_mpage_readpages.patch " Andrew Morton
2020-04-15  1:18 ` + fuse-convert-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + iomap-convert-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:54 ` + mm-ksm-fix-null-pointer-dereference-when-ksm-zero-page-is-enabled.patch " Andrew Morton
2020-04-15  7:44   ` Kirill Tkhai
2020-04-15  8:16     ` [External] " Muchun Song
2020-04-15 18:32       ` Andrew Morton
2020-04-15  4:29 ` + mm-gupc-further-document-vma_permits_fault.patch " Andrew Morton
2020-04-15  4:33 ` + fuse-convert-from-readpages-to-readahead-fix.patch " Andrew Morton
2020-04-15  4:46 ` + x86-hyperv-use-vmalloc_exec-for-the-hypercall-page.patch " Andrew Morton
2020-04-15  4:46 ` + x86-fix-vmap-arguments-in-map_irq_stack.patch " Andrew Morton
2020-04-15  4:46 ` + staging-android-ion-use-vmap-instead-of-vm_map_ram.patch " Andrew Morton
2020-04-15  4:46 ` + staging-media-ipu3-use-vmap-instead-of-reimplementing-it.patch " Andrew Morton
2020-04-15  4:46 ` + dma-mapping-use-vmap-insted-of-reimplementing-it.patch " Andrew Morton
2020-04-15  4:46 ` + powerpc-add-an-ioremap_phb-helper.patch " Andrew Morton
2020-04-15  4:46 ` + powerpc-remove-__ioremap_at-and-__iounmap_at.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-__get_vm_area.patch " Andrew Morton
2020-04-15  4:47 ` + mm-unexport-unmap_kernel_range_noflush.patch " Andrew Morton
2020-04-15  4:47 ` + mm-rename-config_pgtable_mapping-to-config_zsmalloc_pgtable_mapping.patch " Andrew Morton
2020-04-15  4:47 ` + mm-only-allow-page-table-mappings-for-built-in-zsmalloc.patch " Andrew Morton
2020-04-15  4:47 ` + mm-pass-addr-as-unsigned-long-to-vb_free.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-vmap_page_range_noflush-and-vunmap_page_range.patch " Andrew Morton
2020-04-15  4:47 ` + mm-rename-vmap_page_range-to-map_kernel_range.patch " Andrew Morton
2020-04-15  4:47 ` + mm-dont-return-the-number-of-pages-from-map_kernel_range_noflush.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-map_vm_range.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-unmap_vmap_area.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-the-prot-argument-from-vm_map_ram.patch " Andrew Morton
2020-04-15  4:47 ` + mm-enforce-that-vmap-cant-map-pages-executable.patch " Andrew Morton
2020-04-15  4:47 ` + gpu-drm-remove-the-powerpc-hack-in-drm_legacy_sg_alloc.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-the-pgprot-argument-to-__vmalloc.patch " Andrew Morton
2020-04-15  4:48 ` + mm-remove-the-prot-argument-to-__vmalloc_node.patch " Andrew Morton
2020-04-15  4:48 ` + mm-remove-both-instances-of-__vmalloc_node_flags.patch " Andrew Morton
2020-04-15  4:48 ` + mm-remove-__vmalloc_node_flags_caller.patch " Andrew Morton
2020-04-15  4:48 ` + mm-switch-the-test_vmalloc-module-to-use-__vmalloc_node.patch " Andrew Morton
2020-04-15  4:48 ` + mm-remove-vmalloc_user_node_flags.patch " Andrew Morton
2020-04-15  4:48 ` + arm64-use-__vmalloc_node-in-arch_alloc_vmap_stack.patch " Andrew Morton
2020-04-15  4:48 ` + powerpc-use-__vmalloc_node-in-alloc_vm_stack.patch " Andrew Morton
2020-04-15  4:48 ` + s390-use-__vmalloc_node-in-stack_alloc.patch " Andrew Morton
2020-04-15 17:44 ` + test_firmware-remove-unnecessary-test_fw_mutex-in-test_dev_config_show_xxx.patch " Andrew Morton
2020-04-15 18:12 ` + slub-avoid-redzone-when-choosing-freepointer-location.patch " Andrew Morton
2020-04-15 18:41 ` + mm-shmem-fix-build-without-thp.patch " Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09a03353-459d-f914-eb5f-2b680ebfe483@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=borntraeger@de.ibm.com \
    --cc=bp@alien8.de \
    --cc=cai@lca.pw \
    --cc=catalin.marinas@arm.com \
    --cc=christophe.leroy@c-s.fr \
    --cc=gerald.schaefer@de.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=paulus@samba.org \
    --cc=rppt@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vgupta@synopsys.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.