1. 22 Feb, 2024 5 commits
    • Sumanth Korikkar's avatar
      s390/sclp: remove unhandled memory notifier type · fb6d5eb9
      Sumanth Korikkar authored
      Remove memory notifier types which are unhandled by s390.  Unhandled
      memory notifier types are covered by default case.
      
      Link: https://lkml.kernel.org/r/20240108132747.3238763-4-sumanthk@linux.ibm.comSuggested-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Signed-off-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Oscar Salvador <osalvador@suse.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      fb6d5eb9
    • Sumanth Korikkar's avatar
      s390/mm: allocate vmemmap pages from self-contained memory range · 1a65b73a
      Sumanth Korikkar authored
      Allocate memory map (struct pages array) from the hotplugged memory
      range, rather than using system memory. The change addresses the issue
      where standby memory, when configured to be much larger than online
      memory, could potentially lead to ipl failure due to memory map
      allocation from online memory. For example, 16MB of memory map
      allocation is needed for a memory block size of 1GB and when standby
      memory is configured much larger than online memory, this could lead to
      ipl failure.
      
      To address this issue, the solution involves introducing "memmap on
      memory" using the vmem_altmap structure on s390.  Architectures that
      want to implement it should pass the altmap to the vmemmap_populate()
      function and its associated callchain. This enhancement is discussed in
      commit 4b94ffdc ("x86, mm: introduce vmem_altmap to augment
      vmemmap_populate()")
      
      Provide "memmap on memory" support for s390 by passing the altmap in
      vmemmap_populate() and its callchain. The allocation path is described
      as follows:
      * When altmap is NULL in vmemmap_populate(), memory map allocation
        occurs using the existing vmemmap_alloc_block_buf().
      * When altmap is not NULL in vmemmap_populate(), memory map allocation
        still uses vmemmap_alloc_block_buf(), but this function internally
        calls altmap_alloc_block_buf().
      
      For deallocation, the process is outlined as follows:
      * When altmap is NULL in vmemmap_free(), memory map deallocation happens
        through free_pages().
      * When altmap is not NULL in vmemmap_free(), memory map deallocation
        occurs via vmem_altmap_free().
      
      While memory map allocation is primarily handled through the
      self-contained memory map range, there might still be a small amount of
      system memory allocation required for vmemmap pagetables. To mitigate
      this impact, this feature will be limited to machines with EDAT1
      support.
      
      Link: https://lkml.kernel.org/r/20240108132747.3238763-3-sumanthk@linux.ibm.comReviewed-by: default avatarGerald Schaefer <gerald.schaefer@linux.ibm.com>
      Signed-off-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Alexander Gordeev <agordeev@linux.ibm.com>
      Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Oscar Salvador <osalvador@suse.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      1a65b73a
    • Sumanth Korikkar's avatar
      mm/memory_hotplug: introduce MEM_PREPARE_ONLINE/MEM_FINISH_OFFLINE notifiers · c5f1e2d1
      Sumanth Korikkar authored
      Patch series "implement "memmap on memory" feature on s390".
      
      This series provides "memmap on memory" support on s390 platform.  "memmap
      on memory" allows struct pages array to be allocated from the hotplugged
      memory range instead of allocating it from main system memory.
      
      s390 currently preallocates struct pages array for all potentially
      possible memory, which ensures memory onlining always succeeds, but with
      the cost of significant memory consumption from the available system
      memory during boottime.  In certain extreme configuration, this could lead
      to ipl failure.
      
      "memmap on memory" ensures struct pages array are populated from self
      contained hotplugged memory range instead of depleting the available
      system memory and this could eliminate ipl failure on s390 platform.
      
      On other platforms, system might go OOM when the physically hotplugged
      memory depletes the available memory before it is onlined.  Hence, "memmap
      on memory" feature was introduced as described in commit a08a2ae3
      ("mm,memory_hotplug: allocate memmap from the added memory range").
      
      Unlike other architectures, s390 memory blocks are not physically
      accessible until it is online.  To make it physically accessible two new
      memory notifiers MEM_PREPARE_ONLINE / MEM_FINISH_OFFLINE are added and
      this notifier lets the hypervisor inform that the memory should be made
      physically accessible.  This allows for "memmap on memory" initialization
      during memory hotplug onlining phase, which is performed before calling
      MEM_GOING_ONLINE notifier.
      
      Patch 1 introduces MEM_PREPARE_ONLINE/MEM_FINISH_OFFLINE memory notifiers
      to prepare the transition of memory to and from a physically accessible
      state.  New mhp_flag MHP_OFFLINE_INACCESSIBLE is introduced to ensure
      altmap cannot be written when adding memory - before it is set online. 
      This enhancement is crucial for implementing the "memmap on memory"
      feature for s390 in a subsequent patch.
      
      Patches 2 allocates vmemmap pages from self-contained memory range for
      s390.  It allocates memory map (struct pages array) from the hotplugged
      memory range, rather than using system memory by passing altmap to vmemmap
      functions.
      
      Patch 3 removes unhandled memory notifier types on s390.
      
      Patch 4 implements MEM_PREPARE_ONLINE/MEM_FINISH_OFFLINE memory notifiers
      on s390.  MEM_PREPARE_ONLINE memory notifier makes memory block physical
      accessible via sclp assign command.  The notifier ensures self-contained
      memory maps are accessible and hence enabling the "memmap on memory" on
      s390.  MEM_FINISH_OFFLINE memory notifier shifts the memory block to an
      inaccessible state via sclp unassign command.
      
      Patch 5 finally enables MHP_MEMMAP_ON_MEMORY on s390.
      
      
      This patch (of 5):
      
      Introduce MEM_PREPARE_ONLINE/MEM_FINISH_OFFLINE memory notifiers to
      prepare the transition of memory to and from a physically accessible
      state.  This enhancement is crucial for implementing the "memmap on
      memory" feature for s390 in a subsequent patch.
      
      Platforms such as x86 can support physical memory hotplug via ACPI.  When
      there is physical memory hotplug, ACPI event leads to the memory addition
      with the following callchain:
      
      acpi_memory_device_add()
        -> acpi_memory_enable_device()
           -> __add_memory()
      
      After this, the hotplugged memory is physically accessible, and altmap
      support prepared, before the "memmap on memory" initialization in
      memory_block_online() is called.
      
      On s390, memory hotplug works in a different way.  The available hotplug
      memory has to be defined upfront in the hypervisor, but it is made
      physically accessible only when the user sets it online via sysfs,
      currently in the MEM_GOING_ONLINE notifier.  This is too late and "memmap
      on memory" initialization is performed before calling MEM_GOING_ONLINE
      notifier.
      
      During the memory hotplug addition phase, altmap support is prepared and
      during the memory onlining phase s390 requires memory to be physically
      accessible and then subsequently initiate the "memmap on memory"
      initialization process.
      
      The memory provider will handle new MEM_PREPARE_ONLINE /
      MEM_FINISH_OFFLINE notifications and make the memory accessible.
      
      The mhp_flag MHP_OFFLINE_INACCESSIBLE is introduced and is relevant when
      used along with MHP_MEMMAP_ON_MEMORY, because the altmap cannot be written
      (e.g., poisoned) when adding memory -- before it is set online.  This
      allows for adding memory with an altmap that is not currently made
      available by a hypervisor.  When onlining that memory, the hypervisor can
      be instructed to make that memory accessible via the new notifiers and the
      onlining phase will not require any memory allocations, which is helpful
      in low-memory situations.
      
      All architectures ignore unknown memory notifiers.  Therefore, the
      introduction of these new notifiers does not result in any functional
      modifications across architectures.
      
      Link: https://lkml.kernel.org/r/20240108132747.3238763-1-sumanthk@linux.ibm.com
      Link: https://lkml.kernel.org/r/20240108132747.3238763-2-sumanthk@linux.ibm.comSigned-off-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
      Suggested-by: default avatarGerald Schaefer <gerald.schaefer@linux.ibm.com>
      Suggested-by: default avatarDavid Hildenbrand <david@redhat.com>
      Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
      Cc: Alexander Gordeev <agordeev@linux.ibm.com>
      Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Oscar Salvador <osalvador@suse.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      c5f1e2d1
    • Sidhartha Kumar's avatar
      maple_tree: fix comment describing mas_node_count_gfp() · e755c43e
      Sidhartha Kumar authored
      The function description comment for mas_node_count_gfp() mistakingly
      refers to the function as mas_node_count().  Change it to refer to the
      correct function.
      
      Link: https://lkml.kernel.org/r/20240109223119.162357-1-sidhartha.kumar@oracle.comSigned-off-by: default avatarSidhartha Kumar <sidhartha.kumar@oracle.com>
      Reviewed-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
      Cc: Peng Zhang <zhangpeng.00@bytedance.com>
      Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      e755c43e
    • Kalesh Singh's avatar
      mm/cma: fix placement of trace_cma_alloc_start/finish · 51ae3f4a
      Kalesh Singh authored
      The current placement of trace_cma_alloc_start/finish misses the fail
      cases: !cma || !cma->count || !cma->bitmap.
      
      trace_cma_alloc_finish is also not emitted for the failure case
      where bitmap_count > bitmap_maxno.
      
      Fix these missed cases by moving the start event before the failure
      checks and moving the finish event to the out label.
      
      Link: https://lkml.kernel.org/r/20240110012234.3793639-1-kaleshsingh@google.com
      Fixes: 7bc1aec5 ("mm: cma: add trace events for CMA alloc perf testing")
      Signed-off-by: default avatarKalesh Singh <kaleshsingh@google.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Liam Mark <lmark@codeaurora.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      51ae3f4a
  2. 20 Feb, 2024 14 commits
  3. 18 Feb, 2024 6 commits
    • Linus Torvalds's avatar
      Linux 6.8-rc5 · b401b621
      Linus Torvalds authored
      b401b621
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.8-2' of... · 6c160f16
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Reformat nested if-conditionals in Makefiles with 4 spaces
      
       - Fix CONFIG_DEBUG_INFO_BTF builds for big endian
      
       - Fix modpost for module srcversion
      
       - Fix an escape sequence warning in gen_compile_commands.py
      
       - Fix kallsyms to ignore ARMv4 thunk symbols
      
      * tag 'kbuild-fixes-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kallsyms: ignore ARMv4 thunks along with others
        modpost: trim leading spaces when processing source files list
        gen_compile_commands: fix invalid escape sequence warning
        kbuild: Fix changing ELF file type for output of gen_btf for big endian
        docs: kconfig: Fix grammar and formatting
        kbuild: use 4-space indentation when followed by conditionals
      6c160f16
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v6.8_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ddac3d8b
      Linus Torvalds authored
      Pull x86 fix from Borislav Petkov:
      
       - Use a GB page for identity mapping only when memory of this size is
         requested so that mapping of reserved regions is prevented which
         would otherwise lead to system crashes on UV machines
      
      * tag 'x86_urgent_for_v6.8_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm/ident_map: Use gbpages only where full GB page should be mapped.
      ddac3d8b
    • Linus Torvalds's avatar
      Merge tag 'irq_urgent_for_v6.8_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7cb7c32d
      Linus Torvalds authored
      Pull irq fixes from Borislav Petkov:
      
       - Fix GICv4.1 affinity update
      
       - Restore a quirk for ACPI-based GICv4 systems
      
       - Handle non-coherent GICv4 redistributors properly
      
       - Prevent spurious interrupts on Broadcom devices using GIC v3
         architecture
      
       - Other minor fixes
      
      * tag 'irq_urgent_for_v6.8_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/gic-v3-its: Fix GICv4.1 VPE affinity update
        irqchip/gic-v3-its: Restore quirk probing for ACPI-based systems
        irqchip/gic-v3-its: Handle non-coherent GICv4 redistributors
        irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init()
        irqchip/loongson-eiointc: Use correct struct type in eiointc_domain_alloc()
        irqchip/irq-brcmstb-l2: Add write memory barrier before exit
      7cb7c32d
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 626721ed
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Two fixes for i801 and qcom-geni devices. Meanwhile, a fix from Arnd
        addresses a compilation error encountered during compile test on
        powerpc"
      
      * tag 'i2c-for-6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: i801: Fix block process call transactions
        i2c: pasemi: split driver into two separate modules
        i2c: qcom-geni: Correct I2C TRE sequence
      626721ed
    • Linus Torvalds's avatar
      Merge tag 'powerpc-6.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · c02197fc
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "This is a bit of a big batch for rc4, but just due to holiday hangover
        and because I didn't send any fixes last week due to a late revert
        request. I think next week should be back to normal.
      
         - Fix ftrace bug on boot caused by exit text sections with
           '-fpatchable-function-entry'
      
         - Fix accuracy of stolen time on pseries since the switch to
           VIRT_CPU_ACCOUNTING_GEN
      
         - Fix a crash in the IOMMU code when doing DLPAR remove
      
         - Set pt_regs->link on scv entry to fix BPF stack unwinding
      
         - Add missing PPC_FEATURE_BOOKE on 64-bit e5500/e6500, which broke
           gdb
      
         - Fix boot on some 6xx platforms with STRICT_KERNEL_RWX enabled
      
         - Fix build failures with KASAN enabled and 32KB stack size
      
         - Some other minor fixes
      
        Thanks to Arnd Bergmann, Benjamin Gray, Christophe Leroy, David
        Engraf, Gaurav Batra, Jason Gunthorpe, Jiangfeng Xiao, Matthias
        Schiffer, Nathan Lynch, Naveen N Rao, Nicholas Piggin, Nysal Jan K.A,
        R Nageswara Sastry, Shivaprasad G Bhat, Shrikanth Hegde, Spoorthy,
        Srikar Dronamraju, and Venkat Rao Bagalkote"
      
      * tag 'powerpc-6.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/iommu: Fix the missing iommu_group_put() during platform domain attach
        powerpc/pseries: fix accuracy of stolen time
        powerpc/ftrace: Ignore ftrace locations in exit text sections
        powerpc/cputable: Add missing PPC_FEATURE_BOOKE on PPC64 Book-E
        powerpc/kasan: Limit KASAN thread size increase to 32KB
        Revert "powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add"
        powerpc: 85xx: mark local functions static
        powerpc: udbg_memcons: mark functions static
        powerpc/kasan: Fix addr error caused by page alignment
        powerpc/6xx: set High BAT Enable flag on G2_LE cores
        selftests/powerpc/papr_vpd: Check devfd before get_system_loc_code()
        powerpc/64: Set task pt_regs->link to the LR value on scv entry
        powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add
        powerpc/pseries/papr-sysparm: use u8 arrays for payloads
      c02197fc
  4. 17 Feb, 2024 12 commits
  5. 16 Feb, 2024 3 commits