1. 05 Oct, 2021 2 commits
    • Steven Rostedt (VMware)'s avatar
      tracing: Create a sparse bitmask for pid filtering · 8d6e9098
      Steven Rostedt (VMware) authored
      When the trace_pid_list was created, the default pid max was 32768.
      Creating a bitmask that can hold one bit for all 32768 took up 4096 (one
      page). Having a one page bitmask was not much of a problem, and that was
      used for mapping pids. But today, systems are bigger and can run more
      tasks, and now the default pid_max is usually set to 4194304. Which means
      to handle that many pids requires 524288 bytes. Worse yet, the pid_max can
      be set to 2^30 (1073741824 or 1G) which would take 134217728 (128M) of
      memory to store this array.
      
      Since the pid_list array is very sparsely populated, it is a huge waste of
      memory to store all possible bits for each pid when most will not be set.
      
      Instead, use a page table scheme to store the array, and allow this to
      handle up to 30 bit pids.
      
      The pid_mask will start out with 256 entries for the first 8 MSB bits.
      This will cost 1K for 32 bit architectures and 2K for 64 bit. Each of
      these will have a 256 array to store the next 8 bits of the pid (another
      1 or 2K). These will hold an 2K byte bitmask (which will cover the LSB
      14 bits or 16384 pids).
      
      When the trace_pid_list is allocated, it will have the 1/2K upper bits
      allocated, and then it will allocate a cache for the next upper chunks and
      the lower chunks (default 6 of each). Then when a bit is "set", these
      chunks will be pulled from the free list and added to the array. If the
      free list gets down to a lever (default 2), it will trigger an irqwork
      that will refill the cache back up.
      
      On clearing a bit, if the clear causes the bitmask to be zero, that chunk
      will then be placed back into the free cache for later use, keeping the
      need to allocate more down to a minimum.
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      8d6e9098
    • Steven Rostedt (VMware)'s avatar
      tracing: Place trace_pid_list logic into abstract functions · 6954e415
      Steven Rostedt (VMware) authored
      Instead of having the logic that does trace_pid_list open coded, wrap it in
      abstract functions. This will allow a rewrite of the logic that implements
      the trace_pid_list without affecting the users.
      
      Note, this causes a change in behavior. Every time a pid is written into
      the set_*_pid file, it creates a new list and uses RCU to update it. If
      pid_max is lowered, but there was a pid currently in the list that was
      higher than pid_max, those pids will now be removed on updating the list.
      The old behavior kept that from happening.
      
      The rewrite of the pid_list logic will no longer depend on pid_max,
      and will return the old behavior.
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      6954e415
  2. 01 Oct, 2021 27 commits
  3. 26 Sep, 2021 7 commits
    • Linus Torvalds's avatar
      Linux 5.15-rc3 · 5816b3e6
      Linus Torvalds authored
      5816b3e6
    • Linus Torvalds's avatar
      Merge tag '5.15-rc2-ksmbd-fixes' of git://git.samba.org/ksmbd · 5e5d7597
      Linus Torvalds authored
      Pull ksmbd fixes from Steve French:
       "Five fixes for the ksmbd kernel server, including three security
        fixes:
      
         - remove follow symlinks support
      
         - use LOOKUP_BENEATH to prevent out of share access
      
         - SMB3 compounding security fix
      
         - fix for returning the default streams correctly, fixing a bug when
           writing ppt or doc files from some clients
      
         - logging more clearly that ksmbd is experimental (at module load
           time)"
      
      * tag '5.15-rc2-ksmbd-fixes' of git://git.samba.org/ksmbd:
        ksmbd: use LOOKUP_BENEATH to prevent the out of share access
        ksmbd: remove follow symlinks support
        ksmbd: check protocol id in ksmbd_verify_smb_message()
        ksmbd: add default data stream name in FILE_STREAM_INFORMATION
        ksmbd: log that server is experimental at module load
      5e5d7597
    • Linus Torvalds's avatar
      Merge tag 'edac_urgent_for_v5.15_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras · 996148ee
      Linus Torvalds authored
      Pull EDAC fixes from Borislav Petkov:
       "Fix two EDAC drivers using the wrong value type for the DIMM mode"
      
      * tag 'edac_urgent_for_v5.15_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
        EDAC/dmc520: Assign the proper type to dimm->edac_mode
        EDAC/synopsys: Fix wrong value type assignment for edac_mode
      996148ee
    • Linus Torvalds's avatar
      Merge tag 'thermal-v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux · 299d6e47
      Linus Torvalds authored
      Pull thermal fixes from Daniel Lezcano:
      
       - Fix thermal shutdown after a suspend/resume due to a wrong TCC value
         restored on Intel platform (Antoine Tenart)
      
       - Fix potential buffer overflow when building the list of policies. The
         buffer size is not updated after writing to it (Dan Carpenter)
      
       - Fix wrong check against IS_ERR instead of NULL (Ansuel Smith)
      
      * tag 'thermal-v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux:
        thermal/drivers/tsens: Fix wrong check for tzd in irq handlers
        thermal/core: Potential buffer overflow in thermal_build_list_of_policies()
        thermal/drivers/int340x: Do not set a wrong tcc offset on resume
      299d6e47
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5bb7b210
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A set of fixes for X86:
      
         - Prevent sending the wrong signal when protection keys are enabled
           and the kernel handles a fault in the vsyscall emulation.
      
         - Invoke early_reserve_memory() before invoking e820_memory_setup()
           which is required to make the Xen dom0 e820 hooks work correctly.
      
         - Use the correct data type for the SETZ operand in the EMQCMDS
           instruction wrapper.
      
         - Prevent undefined behaviour to the potential unaligned accesss in
           the instruction decoder library"
      
      * tag 'x86-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/insn, tools/x86: Fix undefined behavior due to potential unaligned accesses
        x86/asm: Fix SETZ size enqcmds() build failure
        x86/setup: Call early_reserve_memory() earlier
        x86/fault: Fix wrong signal when vsyscall fails with pkey
      5bb7b210
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3a398acc
      Linus Torvalds authored
      Pull timer fix from Thomas Gleixner:
       "A single fix for the recently introduced regression in posix CPU
        timers which failed to stop the timer when requested. That caused
        unexpected signals to be sent to the process/thread causing
        malfunction"
      
      * tag 'timers-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        posix-cpu-timers: Prevent spuriously armed 0-value itimer
      3a398acc
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · dc0f97c2
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A set of fixes for interrupt chip drivers:
      
         - Work around a bad GIC integration on a Renesas platform which can't
           handle byte-sized MMIO access
      
         - Plug a potential memory leak in the GICv4 driver
      
         - Fix a regression in the Armada 370-XP IPI code which was caused by
           issuing EOI instack of ACK.
      
         - A couple of small fixes here and there"
      
      * tag 'irq-urgent-2021-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/gic: Work around broken Renesas integration
        irqchip/renesas-rza1: Use semicolons instead of commas
        irqchip/gic-v3-its: Fix potential VPE leak on error
        irqchip/goldfish-pic: Select GENERIC_IRQ_CHIP to fix build
        irqchip/mbigen: Repair non-kernel-doc notation
        irqdomain: Change the type of 'size' in __irq_domain_add() to be consistent
        irqchip/armada-370-xp: Fix ack/eoi breakage
        Documentation: Fix irq-domain.rst build warning
      dc0f97c2
  4. 25 Sep, 2021 4 commits
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · a3b397b4
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "16 patches.
      
        Subsystems affected by this patch series: xtensa, sh, ocfs2, scripts,
        lib, and mm (memory-failure, kasan, damon, shmem, tools, pagecache,
        debug, and pagemap)"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm: fix uninitialized use in overcommit_policy_handler
        mm/memory_failure: fix the missing pte_unmap() call
        kasan: always respect CONFIG_KASAN_STACK
        sh: pgtable-3level: fix cast to pointer from integer of different size
        mm/debug: sync up latest migrate_reason to migrate_reason_names
        mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN
        mm: fs: invalidate bh_lrus for only cold path
        lib/zlib_inflate/inffast: check config in C to avoid unused function warning
        tools/vm/page-types: remove dependency on opt_file for idle page tracking
        scripts/sorttable: riscv: fix undeclared identifier 'EM_RISCV' error
        ocfs2: drop acl cache for directories too
        mm/shmem.c: fix judgment error in shmem_is_huge()
        xtensa: increase size of gcc stack frame check
        mm/damon: don't use strnlen() with known-bogus source length
        kasan: fix Kconfig check of CC_HAS_WORKING_NOSANITIZE_ADDRESS
        mm, hwpoison: add is_free_buddy_page() in HWPoisonHandlable()
      a3b397b4
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · bb19237b
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Thirty-three fixes, I'm afraid.
      
        Essentially the build up from the last couple of weeks while I've been
        dealling with Linux Plumbers conference infrastructure issues. It's
        mostly the usual assortment of spelling fixes and minor corrections.
      
        The only core relevant changes are to the sd driver to reduce the spin
        up message spew and fix a small memory leak on the freeing path"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (33 commits)
        scsi: ses: Retry failed Send/Receive Diagnostic commands
        scsi: target: Fix spelling mistake "CONFLIFT" -> "CONFLICT"
        scsi: lpfc: Fix gcc -Wstringop-overread warning, again
        scsi: lpfc: Use correct scnprintf() limit
        scsi: lpfc: Fix sprintf() overflow in lpfc_display_fpin_wwpn()
        scsi: core: Remove 'current_tag'
        scsi: acornscsi: Remove tagged queuing vestiges
        scsi: fas216: Kill scmd->tag
        scsi: qla2xxx: Restore initiator in dual mode
        scsi: ufs: core: Unbreak the reset handler
        scsi: sd_zbc: Support disks with more than 2**32 logical blocks
        scsi: ufs: core: Revert "scsi: ufs: Synchronize SCSI and UFS error handling"
        scsi: bsg: Fix device unregistration
        scsi: sd: Make sd_spinup_disk() less noisy
        scsi: ufs: ufs-pci: Fix Intel LKF link stability
        scsi: mpt3sas: Clean up some inconsistent indenting
        scsi: megaraid: Clean up some inconsistent indenting
        scsi: sr: Fix spelling mistake "does'nt" -> "doesn't"
        scsi: Remove SCSI CDROM MAINTAINERS entry
        scsi: megaraid: Fix Coccinelle warning
        ...
      bb19237b
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.15-2021-09-25' of git://git.kernel.dk/linux-block · f6f360ae
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "This one looks a bit bigger than it is, but that's mainly because 2/3
        of it is enabling IORING_OP_CLOSE to close direct file descriptors.
      
        We've had a few folks using them and finding it confusing that the way
        to close them is through using -1 for file update, this just brings
        API symmetry for direct descriptors. Hence I think we should just do
        this now and have a better API for 5.15 release. There's some room for
        de-duplicating the close code, but we're leaving that for the next
        merge window.
      
        Outside of that, just small fixes:
      
         - Poll race fixes (Hao)
      
         - io-wq core dump exit fix (me)
      
         - Reschedule around potentially intensive tctx and buffer iterators
           on teardown (me)
      
         - Fix for always ending up punting files update to io-wq (me)
      
         - Put the provided buffer meta data under memcg accounting (me)
      
         - Tweak for io_write(), removing dead code that was added with the
           iterator changes in this release (Pavel)"
      
      * tag 'io_uring-5.15-2021-09-25' of git://git.kernel.dk/linux-block:
        io_uring: make OP_CLOSE consistent with direct open
        io_uring: kill extra checks in io_write()
        io_uring: don't punt files update to io-wq unconditionally
        io_uring: put provided buffer meta data under memcg accounting
        io_uring: allow conditional reschedule for intensive iterators
        io_uring: fix potential req refcount underflow
        io_uring: fix missing set of EPOLLONESHOT for CQ ring overflow
        io_uring: fix race between poll completion and cancel_hash insertion
        io-wq: ensure we exit if thread group is exiting
      f6f360ae
    • Linus Torvalds's avatar
      Merge tag 'block-5.15-2021-09-25' of git://git.kernel.dk/linux-block · 2d70de4e
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request via Christoph:
            - keep ctrl->namespaces ordered (Christoph Hellwig)
            - fix incorrect h2cdata pdu offset accounting in nvme-tcp (Sagi
              Grimberg)
            - handled updated hw_queues in nvme-fc more carefully (Daniel
              Wagner, James Smart)
      
       - md lock order fix (Christoph)
      
       - fallocate locking fix (Ming)
      
       - blktrace UAF fix (Zhihao)
      
       - rq-qos bio tracking fix (Ming)
      
      * tag 'block-5.15-2021-09-25' of git://git.kernel.dk/linux-block:
        block: hold ->invalidate_lock in blkdev_fallocate
        blktrace: Fix uaf in blk_trace access after removing by sysfs
        block: don't call rq_qos_ops->done_bio if the bio isn't tracked
        md: fix a lock order reversal in md_alloc
        nvme: keep ctrl->namespaces ordered
        nvme-tcp: fix incorrect h2cdata pdu offset accounting
        nvme-fc: remove freeze/unfreeze around update_nr_hw_queues
        nvme-fc: avoid race between time out and tear down
        nvme-fc: update hardware queues before using them
      2d70de4e