1. 30 Aug, 2024 6 commits
    • Chen Ridong's avatar
      cgroup/cpuset: move relax_domain_level to cpuset-v1.c · 047b8309
      Chen Ridong authored
      Setting domain level is not supported at cpuset v2, so move corresponding
      code into cpuset-v1.c.
      
      The 'cpuset_write_s64' and 'cpuset_read_s64' are only used for setting
      domain level, move them to cpuset-v1.c. Currently, expose to cpuset.c.
      After cpuset legacy interface files are move to cpuset-v1.c, they can
      be static. The 'rebuild_sched_domains_locked' is exposed to cpuset-v1.c.
      
      The change from original code is that using 'cpuset_lock' and
      'cpuset_unlock' functions to lock or unlock cpuset_mutex.
      Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
      Acked-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      047b8309
    • Chen Ridong's avatar
      cgroup/cpuset: move memory_pressure to cpuset-v1.c · 49434094
      Chen Ridong authored
      Collection of memory_pressure can be enabled by writing 1 to the cpuset
      file 'memory_pressure_enabled', which is only for cpuset-v1. Therefore,
      move the corresponding code to cpuset-v1.c.
      
      Currently, the 'fmeter_init' and 'fmeter_getrate' functions are called
      at cpuset.c, so expose them to cpuset.c.
      Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
      Acked-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      49434094
    • Chen Ridong's avatar
      cgroup/cpuset: move common code to cpuset-internal.h · 619a33ef
      Chen Ridong authored
      Move some declarations that will be used for cpuset v1 and v2,
      including 'cpuset struct', 'cpuset_flagbits_t', cpuset_filetype_t,etc.
      No logical change.
      Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
      Acked-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      619a33ef
    • Chen Ridong's avatar
      cgroup/cpuset: introduce cpuset-v1.c · 71e934a8
      Chen Ridong authored
      This patch introduces the cgroup/cpuset-v1.c source file which will be
      used for all legacy (cgroup v1) cpuset cgroup code. It also introduces
      cgroup/cpuset-internal.h to keep declarations shared between
      cgroup/cpuset.c and cpuset/cpuset-v1.c.
      
      As of now, let's compile it if CONFIG_CPUSET is set. Later on it can be
      switched to use a separate config option, so that the legacy code won't be
      compiled if not required.
      Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
      Acked-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      71e934a8
    • Waiman Long's avatar
      selftest/cgroup: Make test_cpuset_prs.sh deal with pre-isolated CPUs · 43a17fcf
      Waiman Long authored
      Since isolated CPUs can be reserved at boot time via the "isolcpus"
      boot command line option, these pre-isolated CPUs may interfere with
      testing done by test_cpuset_prs.sh.
      
      With the previous commit that incorporates those boot time isolated CPUs
      into "cpuset.cpus.isolated", we can check for those before testing is
      started to make sure that there will be no interference.  Otherwise,
      this test will be skipped if incorrect test failure can happen.
      
      As "cpuset.cpus.isolated" is now available in a non cgroup_debug kernel,
      we don't need to check for its existence anymore.
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      43a17fcf
    • Waiman Long's avatar
      cgroup/cpuset: Account for boot time isolated CPUs · c188f33c
      Waiman Long authored
      With the "isolcpus" boot command line parameter, we are able to
      create isolated CPUs at boot time. These isolated CPUs aren't fully
      accounted for in the cpuset code. For instance, the root cgroup's
      "cpuset.cpus.isolated" control file does not include the boot time
      isolated CPUs. Fix that by looking for pre-isolated CPUs at init time.
      
      The prstate_housekeeping_conflict() function does check the
      HK_TYPE_DOMAIN housekeeping cpumask to make sure that CPUs outside of it
      can only be used in isolated partition. Given the fact that we are going
      to make housekeeping cpumasks dynamic, the current check may not be right
      anymore. Save the boot time HK_TYPE_DOMAIN cpumask and check against
      it instead of the upcoming dynamic HK_TYPE_DOMAIN housekeeping cpumask.
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      c188f33c
  2. 20 Aug, 2024 3 commits
    • Chen Ridong's avatar
      cgroup/cpuset: remove use_parent_ecpus of cpuset · 3c2acae8
      Chen Ridong authored
      use_parent_ecpus is used to track whether the children are using the
      parent's effective_cpus. When a parent's effective_cpus is changed
      due to changes in a child partition's effective_xcpus, any child
      using parent'effective_cpus must call update_cpumasks_hier. However,
      if a child is not a valid partition, it is sufficient to determine
      whether to call update_cpumasks_hier based on whether the child's
      effective_cpus is going to change. To make the code more succinct,
      it is suggested to remove use_parent_ecpus.
      Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
      Reviewed-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      3c2acae8
    • Chen Ridong's avatar
      cgroup/cpuset: remove fetch_xcpus · 9414f68d
      Chen Ridong authored
      Both fetch_xcpus and user_xcpus functions are used to retrieve the value
      of exclusive_cpus. If exclusive_cpus is not set, cpus_allowed is the
      implicit value used as exclusive in a local partition. I can not imagine
      a scenario where effective_xcpus is not empty when exclusive_cpus is
      empty. Therefore, I suggest removing the fetch_xcpus function.
      Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
      Reviewed-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      9414f68d
    • Chen Ridong's avatar
      cgroup/cpuset: Correct invalid remote parition prs · e55f45b4
      Chen Ridong authored
      When enable a remote partition, I found that:
      
      cd /sys/fs/cgroup/
      mkdir test
      mkdir test/test1
      echo +cpuset > cgroup.subtree_control
      echo +cpuset >  test/cgroup.subtree_control
      echo 3 > test/test1/cpuset.cpus
      echo root > test/test1/cpuset.cpus.partition
      cat test/test1/cpuset.cpus.partition
      root invalid (Parent is not a partition root)
      
      The parent of a remote partition could not be a root. This is due to the
      emtpy effective_xcpus. It would be better to prompt the message "invalid
      cpu list in cpuset.cpus.exclusive".
      Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
      Reviewed-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      e55f45b4
  3. 19 Aug, 2024 1 commit
  4. 09 Aug, 2024 1 commit
  5. 05 Aug, 2024 7 commits
    • Waiman Long's avatar
      selftest/cgroup: Add new test cases to test_cpuset_prs.sh · 92841d6e
      Waiman Long authored
      Add new test cases to test_cpuset_prs.sh to cover corner cases reported
      in previous fix commits.
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      92841d6e
    • Waiman Long's avatar
      cgroup/cpuset: Check for partition roots with overlapping CPUs · 99570300
      Waiman Long authored
      With the previous commit that eliminates the overlapping partition
      root corner cases in the hotplug code, the partition roots passed down
      to generate_sched_domains() should not have overlapping CPUs. Enable
      overlapping cpuset check for v2 and warn if that happens.
      
      This patch also has the benefit of increasing test coverage of the new
      Union-Find cpuset merging code to cgroup v2.
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      99570300
    • Tejun Heo's avatar
      Merge branch 'cgroup/for-6.11-fixes' into cgroup/for-6.12 · bc3c2751
      Tejun Heo authored
      cgroup/for-6.12 is about to receive updates that are dependent on changes
      from both for-6.11-fixes and for-6.12. Pull in for-6.11-fixes.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      bc3c2751
    • Waiman Long's avatar
      cgroup/cpuset: Eliminate unncessary sched domains rebuilds in hotplug · ff0ce721
      Waiman Long authored
      It was found that some hotplug operations may cause multiple
      rebuild_sched_domains_locked() calls. Some of those intermediate calls
      may use cpuset states not in the final correct form leading to incorrect
      sched domain setting.
      
      Fix this problem by using the existing force_rebuild flag to inhibit
      immediate rebuild_sched_domains_locked() calls if set and only doing
      one final call at the end. Also renaming the force_rebuild flag to
      force_sd_rebuild to make its meaning for clear.
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      ff0ce721
    • Waiman Long's avatar
      cgroup/cpuset: Clear effective_xcpus on cpus_allowed clearing only if cpus.exclusive not set · 311a1bdc
      Waiman Long authored
      Commit e2ffe502 ("cgroup/cpuset: Add cpuset.cpus.exclusive for
      v2") adds a user writable cpuset.cpus.exclusive file for setting
      exclusive CPUs to be used for the creation of partitions. Since then
      effective_xcpus depends on both the cpuset.cpus and cpuset.cpus.exclusive
      setting. If cpuset.cpus.exclusive is set, effective_xcpus will depend
      only on cpuset.cpus.exclusive.  When it is not set, effective_xcpus
      will be set according to the cpuset.cpus value when the cpuset becomes
      a valid partition root.
      
      When cpuset.cpus is being cleared by the user, effective_xcpus should
      only be cleared when cpuset.cpus.exclusive is not set. However, that
      is not currently the case.
      
        # cd /sys/fs/cgroup/
        # mkdir test
        # echo +cpuset > cgroup.subtree_control
        # cd test
        # echo 3 > cpuset.cpus.exclusive
        # cat cpuset.cpus.exclusive.effective
        3
        # echo > cpuset.cpus
        # cat cpuset.cpus.exclusive.effective // was cleared
      
      Fix it by clearing effective_xcpus only if cpuset.cpus.exclusive is
      not set.
      
      Fixes: e2ffe502 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2")
      Cc: stable@vger.kernel.org # v6.7+
      Reported-by: default avatarChen Ridong <chenridong@huawei.com>
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      311a1bdc
    • Chen Ridong's avatar
      cgroup/cpuset: fix panic caused by partcmd_update · 959ab635
      Chen Ridong authored
      We find a bug as below:
      BUG: unable to handle page fault for address: 00000003
      PGD 0 P4D 0
      Oops: 0000 [#1] PREEMPT SMP NOPTI
      CPU: 3 PID: 358 Comm: bash Tainted: G        W I        6.6.0-10893-g60d6
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/4
      RIP: 0010:partition_sched_domains_locked+0x483/0x600
      Code: 01 48 85 d2 74 0d 48 83 05 29 3f f8 03 01 f3 48 0f bc c2 89 c0 48 9
      RSP: 0018:ffffc90000fdbc58 EFLAGS: 00000202
      RAX: 0000000100000003 RBX: ffff888100b3dfa0 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000002fe80
      RBP: ffff888100b3dfb0 R08: 0000000000000001 R09: 0000000000000000
      R10: ffffc90000fdbcb0 R11: 0000000000000004 R12: 0000000000000002
      R13: ffff888100a92b48 R14: 0000000000000000 R15: 0000000000000000
      FS:  00007f44a5425740(0000) GS:ffff888237d80000(0000) knlGS:0000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000100030973 CR3: 000000010722c000 CR4: 00000000000006e0
      Call Trace:
       <TASK>
       ? show_regs+0x8c/0xa0
       ? __die_body+0x23/0xa0
       ? __die+0x3a/0x50
       ? page_fault_oops+0x1d2/0x5c0
       ? partition_sched_domains_locked+0x483/0x600
       ? search_module_extables+0x2a/0xb0
       ? search_exception_tables+0x67/0x90
       ? kernelmode_fixup_or_oops+0x144/0x1b0
       ? __bad_area_nosemaphore+0x211/0x360
       ? up_read+0x3b/0x50
       ? bad_area_nosemaphore+0x1a/0x30
       ? exc_page_fault+0x890/0xd90
       ? __lock_acquire.constprop.0+0x24f/0x8d0
       ? __lock_acquire.constprop.0+0x24f/0x8d0
       ? asm_exc_page_fault+0x26/0x30
       ? partition_sched_domains_locked+0x483/0x600
       ? partition_sched_domains_locked+0xf0/0x600
       rebuild_sched_domains_locked+0x806/0xdc0
       update_partition_sd_lb+0x118/0x130
       cpuset_write_resmask+0xffc/0x1420
       cgroup_file_write+0xb2/0x290
       kernfs_fop_write_iter+0x194/0x290
       new_sync_write+0xeb/0x160
       vfs_write+0x16f/0x1d0
       ksys_write+0x81/0x180
       __x64_sys_write+0x21/0x30
       x64_sys_call+0x2f25/0x4630
       do_syscall_64+0x44/0xb0
       entry_SYSCALL_64_after_hwframe+0x78/0xe2
      RIP: 0033:0x7f44a553c887
      
      It can be reproduced with cammands:
      cd /sys/fs/cgroup/
      mkdir test
      cd test/
      echo +cpuset > ../cgroup.subtree_control
      echo root > cpuset.cpus.partition
      cat /sys/fs/cgroup/cpuset.cpus.effective
      0-3
      echo 0-3 > cpuset.cpus // taking away all cpus from root
      
      This issue is caused by the incorrect rebuilding of scheduling domains.
      In this scenario, test/cpuset.cpus.partition should be an invalid root
      and should not trigger the rebuilding of scheduling domains. When calling
      update_parent_effective_cpumask with partcmd_update, if newmask is not
      null, it should recheck newmask whether there are cpus is available
      for parect/cs that has tasks.
      
      Fixes: 0c7f293e ("cgroup/cpuset: Add cpuset.cpus.exclusive.effective for v2")
      Cc: stable@vger.kernel.org # v6.7+
      Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      959ab635
    • Xiu Jianfeng's avatar
      cgroup/pids: Remove unreachable paths of pids_{can,cancel}_fork · 4980f712
      Xiu Jianfeng authored
      According to the implementation of cgroup_css_set_fork(), it will fail
      if cset cannot be found and the can_fork/cancel_fork methods will not
      be called in this case, which means that the argument 'cset' for these
      methods must not be NULL, so remove the unrechable paths in them.
      Signed-off-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
      Reviewed-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      4980f712
  6. 02 Aug, 2024 1 commit
  7. 31 Jul, 2024 1 commit
    • Waiman Long's avatar
      cgroup: Show # of subsystem CSSes in cgroup.stat · ab031252
      Waiman Long authored
      Cgroup subsystem state (CSS) is an abstraction in the cgroup layer to
      help manage different structures in various cgroup subsystems by being
      an embedded element inside a larger structure like cpuset or mem_cgroup.
      
      The /proc/cgroups file shows the number of cgroups for each of the
      subsystems.  With cgroup v1, the number of CSSes is the same as the
      number of cgroups.  That is not the case anymore with cgroup v2. The
      /proc/cgroups file cannot show the actual number of CSSes for the
      subsystems that are bound to cgroup v2.
      
      So if a v2 cgroup subsystem is leaking cgroups (usually memory cgroup),
      we can't tell by looking at /proc/cgroups which cgroup subsystems may
      be responsible.
      
      As cgroup v2 had deprecated the use of /proc/cgroups, the hierarchical
      cgroup.stat file is now being extended to show the number of live and
      dying CSSes associated with all the non-inhibited cgroup subsystems that
      have been bound to cgroup v2. The number includes CSSes in the current
      cgroup as well as in all the descendants underneath it.  This will help
      us pinpoint which subsystems are responsible for the increasing number
      of dying (nr_dying_descendants) cgroups.
      
      The CSSes dying counts are stored in the cgroup structure itself
      instead of inside the CSS as suggested by Johannes. This will allow
      us to accurately track dying counts of cgroup subsystems that have
      recently been disabled in a cgroup. It is now possible that a zero
      subsystem number is coupled with a non-zero dying subsystem number.
      
      The cgroup-v2.rst file is updated to discuss this new behavior.
      
      With this patch applied, a sample output from root cgroup.stat file
      was shown below.
      
      	nr_descendants 56
      	nr_subsys_cpuset 1
      	nr_subsys_cpu 43
      	nr_subsys_io 43
      	nr_subsys_memory 56
      	nr_subsys_perf_event 57
      	nr_subsys_hugetlb 1
      	nr_subsys_pids 56
      	nr_subsys_rdma 1
      	nr_subsys_misc 1
      	nr_dying_descendants 30
      	nr_dying_subsys_cpuset 0
      	nr_dying_subsys_cpu 0
      	nr_dying_subsys_io 0
      	nr_dying_subsys_memory 30
      	nr_dying_subsys_perf_event 0
      	nr_dying_subsys_hugetlb 0
      	nr_dying_subsys_pids 0
      	nr_dying_subsys_rdma 0
      	nr_dying_subsys_misc 0
      
      Another sample output from system.slice/cgroup.stat was:
      
      	nr_descendants 34
      	nr_subsys_cpuset 0
      	nr_subsys_cpu 32
      	nr_subsys_io 32
      	nr_subsys_memory 34
      	nr_subsys_perf_event 35
      	nr_subsys_hugetlb 0
      	nr_subsys_pids 34
      	nr_subsys_rdma 0
      	nr_subsys_misc 0
      	nr_dying_descendants 30
      	nr_dying_subsys_cpuset 0
      	nr_dying_subsys_cpu 0
      	nr_dying_subsys_io 0
      	nr_dying_subsys_memory 30
      	nr_dying_subsys_perf_event 0
      	nr_dying_subsys_hugetlb 0
      	nr_dying_subsys_pids 0
      	nr_dying_subsys_rdma 0
      	nr_dying_subsys_misc 0
      
      Note that 'debug' controller wasn't used to provide this information because
      the controller is not recommended in productions kernels, also many of them
      won't enable CONFIG_CGROUP_DEBUG by default.
      
      Similar information could be retrieved with debuggers like drgn but that's
      also not always available (e.g. lockdown) and the additional cost of runtime
      tracking here is deemed marginal.
      
      tj: Added Michal's paragraphs on why this is not added the debug controller
          to the commit message.
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
      Reviewed-by: default avatarKamalesh Babulal <kamalesh.babulal@oracle.com>
      Cc: Michal Koutný <mkoutny@suse.com>
      Link: http://lkml.kernel.org/r/20240715150034.2583772-1-longman@redhat.comSigned-off-by: default avatarTejun Heo <tj@kernel.org>
      ab031252
  8. 30 Jul, 2024 6 commits
  9. 28 Jul, 2024 12 commits
    • Linus Torvalds's avatar
      Linux 6.11-rc1 · 8400291e
      Linus Torvalds authored
      8400291e
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.11' of... · a0c04bd5
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Fix RPM package build error caused by an incorrect locale setup
      
       - Mark modules.weakdep as ghost in RPM package
      
       - Fix the odd combination of -S and -c in stack protector scripts,
         which is an error with the latest Clang
      
      * tag 'kbuild-fixes-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: Fix '-S -c' in x86 stack protector scripts
        kbuild: rpm-pkg: ghost modules.weakdep file
        kbuild: rpm-pkg: Fix C locale setup
      a0c04bd5
    • Linus Torvalds's avatar
      minmax: simplify and clarify min_t()/max_t() implementation · 017fa3e8
      Linus Torvalds authored
      This simplifies the min_t() and max_t() macros by no longer making them
      work in the context of a C constant expression.
      
      That means that you can no longer use them for static initializers or
      for array sizes in type definitions, but there were only a couple of
      such uses, and all of them were converted (famous last words) to use
      MIN_T/MAX_T instead.
      
      Cc: David Laight <David.Laight@aculab.com>
      Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      017fa3e8
    • Linus Torvalds's avatar
      minmax: add a few more MIN_T/MAX_T users · 4477b39c
      Linus Torvalds authored
      Commit 3a7e02c0 ("minmax: avoid overly complicated constant
      expressions in VM code") added the simpler MIN_T/MAX_T macros in order
      to avoid some excessive expansion from the rather complicated regular
      min/max macros.
      
      The complexity of those macros stems from two issues:
      
       (a) trying to use them in situations that require a C constant
           expression (in static initializers and for array sizes)
      
       (b) the type sanity checking
      
      and MIN_T/MAX_T avoids both of these issues.
      
      Now, in the whole (long) discussion about all this, it was pointed out
      that the whole type sanity checking is entirely unnecessary for
      min_t/max_t which get a fixed type that the comparison is done in.
      
      But that still leaves min_t/max_t unnecessarily complicated due to
      worries about the C constant expression case.
      
      However, it turns out that there really aren't very many cases that use
      min_t/max_t for this, and we can just force-convert those.
      
      This does exactly that.
      
      Which in turn will then allow for much simpler implementations of
      min_t()/max_t().  All the usual "macros in all upper case will evaluate
      the arguments multiple times" rules apply.
      
      We should do all the same things for the regular min/max() vs MIN/MAX()
      cases, but that has the added complexity of various drivers defining
      their own local versions of MIN/MAX, so that needs another level of
      fixes first.
      
      Link: https://lore.kernel.org/all/b47fad1d0cf8449886ad148f8c013dae@AcuMS.aculab.com/
      Cc: David Laight <David.Laight@aculab.com>
      Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4477b39c
    • Linus Torvalds's avatar
      Merge tag 'ubifs-for-linus-6.11-rc1-take2' of... · 7e2d0ba7
      Linus Torvalds authored
      Merge tag 'ubifs-for-linus-6.11-rc1-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs
      
      Pull UBI and UBIFS updates from Richard Weinberger:
      
       - Many fixes for power-cut issues by Zhihao Cheng
      
       - Another ubiblock error path fix
      
       - ubiblock section mismatch fix
      
       - Misc fixes all over the place
      
      * tag 'ubifs-for-linus-6.11-rc1-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
        ubi: Fix ubi_init() ubiblock_exit() section mismatch
        ubifs: add check for crypto_shash_tfm_digest
        ubifs: Fix inconsistent inode size when powercut happens during appendant writing
        ubi: block: fix null-pointer-dereference in ubiblock_create()
        ubifs: fix kernel-doc warnings
        ubifs: correct UBIFS_DFS_DIR_LEN macro definition and improve code clarity
        mtd: ubi: Restore missing cleanup on ubi_init() failure path
        ubifs: dbg_orphan_check: Fix missed key type checking
        ubifs: Fix unattached inode when powercut happens in creating
        ubifs: Fix space leak when powercut happens in linking tmpfile
        ubifs: Move ui->data initialization after initializing security
        ubifs: Fix adding orphan entry twice for the same inode
        ubifs: Remove insert_dead_orphan from replaying orphan process
        Revert "ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path"
        ubifs: Don't add xattr inode into orphan area
        ubifs: Fix unattached xattr inode if powercut happens after deleting
        mtd: ubi: avoid expensive do_div() on 32-bit machines
        mtd: ubi: make ubi_class constant
        ubi: eba: properly rollback inside self_check_eba
      7e2d0ba7
    • Nathan Chancellor's avatar
      kbuild: Fix '-S -c' in x86 stack protector scripts · 3415b10a
      Nathan Chancellor authored
      After a recent change in clang to stop consuming all instances of '-S'
      and '-c' [1], the stack protector scripts break due to the kernel's use
      of -Werror=unused-command-line-argument to catch cases where flags are
      not being properly consumed by the compiler driver:
      
        $ echo | clang -o - -x c - -S -c -Werror=unused-command-line-argument
        clang: error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument]
      
      This results in CONFIG_STACKPROTECTOR getting disabled because
      CONFIG_CC_HAS_SANE_STACKPROTECTOR is no longer set.
      
      '-c' and '-S' both instruct the compiler to stop at different stages of
      the pipeline ('-S' after compiling, '-c' after assembling), so having
      them present together in the same command makes little sense. In this
      case, the test wants to stop before assembling because it is looking at
      the textual assembly output of the compiler for either '%fs' or '%gs',
      so remove '-c' from the list of arguments to resolve the error.
      
      All versions of GCC continue to work after this change, along with
      versions of clang that do or do not contain the change mentioned above.
      
      Cc: stable@vger.kernel.org
      Fixes: 4f7fd4d7 ("[PATCH] Add the -fstack-protector option to the CFLAGS")
      Fixes: 60a5317f ("x86: implement x86_32 stack protector")
      Link: https://github.com/llvm/llvm-project/commit/6461e537815f7fa68cef06842505353cf5600e9c [1]
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      3415b10a
    • Richard Weinberger's avatar
      ubi: Fix ubi_init() ubiblock_exit() section mismatch · 92a286e9
      Richard Weinberger authored
      Since ubiblock_exit() is now called from an init function,
      the __exit section no longer makes sense.
      
      Cc: Ben Hutchings <bwh@kernel.org>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202407131403.wZJpd8n2-lkp@intel.com/Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      Reviewed-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
      92a286e9
    • Linus Torvalds's avatar
      Merge tag 'v6.11-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux · e172f1e9
      Linus Torvalds authored
      Pull turbostat updates from Len Brown:
      
       - Enable turbostat extensions to add both perf and PMT (Intel
         Platform Monitoring Technology) counters via the cmdline
      
       - Demonstrate PMT access with built-in support for Meteor Lake's
         Die C6 counter
      
      * tag 'v6.11-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
        tools/power turbostat: version 2024.07.26
        tools/power turbostat: Include umask=%x in perf counter's config
        tools/power turbostat: Document PMT in turbostat.8
        tools/power turbostat: Add MTL's PMT DC6 builtin counter
        tools/power turbostat: Add early support for PMT counters
        tools/power turbostat: Add selftests for added perf counters
        tools/power turbostat: Add selftests for SMI, APERF and MPERF counters
        tools/power turbostat: Move verbose counter messages to level 2
        tools/power turbostat: Move debug prints from stdout to stderr
        tools/power turbostat: Fix typo in turbostat.8
        tools/power turbostat: Add perf added counter example to turbostat.8
        tools/power turbostat: Fix formatting in turbostat.8
        tools/power turbostat: Extend --add option with perf counters
        tools/power turbostat: Group SMI counter with APERF and MPERF
        tools/power turbostat: Add ZERO_ARRAY for zero initializing builtin array
        tools/power turbostat: Replace enum rapl_source and cstate_source with counter_source
        tools/power turbostat: Remove anonymous union from rapl_counter_info_t
        tools/power/turbostat: Switch to new Intel CPU model defines
      e172f1e9
    • Linus Torvalds's avatar
      Merge tag 'cxl-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl · e62f81bb
      Linus Torvalds authored
      Pull CXL updates from Dave Jiang:
       "Core:
      
         - A CXL maturity map has been added to the documentation to detail
           the current state of CXL enabling.
      
           It provides the status of the current state of various CXL features
           to inform current and future contributors of where things are and
           which areas need contribution.
      
         - A notifier handler has been added in order for a newly created CXL
           memory region to trigger the abstract distance metrics calculation.
      
           This should bring parity for CXL memory to the same level vs
           hotplugged DRAM for NUMA abstract distance calculation. The
           abstract distance reflects relative performance used for memory
           tiering handling.
      
         - An addition for XOR math has been added to address the CXL DPA to
           SPA translation.
      
           CXL address translation did not support address interleave math
           with XOR prior to this change.
      
        Fixes:
      
         - Fix to address race condition in the CXL memory hotplug notifier
      
         - Add missing MODULE_DESCRIPTION() for CXL modules
      
         - Fix incorrect vendor debug UUID define
      
        Misc:
      
         - A warning has been added to inform users of an unsupported
           configuration when mixing CXL VH and RCH/RCD hierarchies
      
         - The ENXIO error code has been replaced with EBUSY for inject poison
           limit reached via debugfs and cxl-test support
      
         - Moving the PCI config read in cxl_dvsec_rr_decode() to avoid
           unnecessary PCI config reads
      
         - A refactor to a common struct for DRAM and general media CXL
           events"
      
      * tag 'cxl-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl:
        cxl/core/pci: Move reading of control register to immediately before usage
        cxl: Remove defunct code calculating host bridge target positions
        cxl/region: Verify target positions using the ordered target list
        cxl: Restore XOR'd position bits during address translation
        cxl/core: Fold cxl_trace_hpa() into cxl_dpa_to_hpa()
        cxl/test: Replace ENXIO with EBUSY for inject poison limit reached
        cxl/memdev: Replace ENXIO with EBUSY for inject poison limit reached
        cxl/acpi: Warn on mixed CXL VH and RCH/RCD Hierarchy
        cxl/core: Fix incorrect vendor debug UUID define
        Documentation: CXL Maturity Map
        cxl/region: Simplify cxl_region_nid()
        cxl/region: Support to calculate memory tier abstract distance
        cxl/region: Fix a race condition in memory hotplug notifier
        cxl: add missing MODULE_DESCRIPTION() macros
        cxl/events: Use a common struct for DRAM and General Media events
      e62f81bb
    • Linus Torvalds's avatar
      Merge tag 'unicode-next-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/krisman/unicode · 7b5d4818
      Linus Torvalds authored
      Pull unicode update from Gabriel Krisman Bertazi:
       "Two small fixes to silence the compiler and static analyzers tools
        from Ben Dooks and Jeff Johnson"
      
      * tag 'unicode-next-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/krisman/unicode:
        unicode: add MODULE_DESCRIPTION() macros
        unicode: make utf8 test count static
      7b5d4818
    • Jose Ignacio Tornos Martinez's avatar
      kbuild: rpm-pkg: ghost modules.weakdep file · d01c1407
      Jose Ignacio Tornos Martinez authored
      In the same way as for other similar files, mark as ghost the new file
      generated by depmod for configured weak dependencies for modules,
      modules.weakdep, so that although it is not included in the package,
      claim the ownership on it.
      Signed-off-by: default avatarJose Ignacio Tornos Martinez <jtornosm@redhat.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      d01c1407
    • Linus Torvalds's avatar
      Merge tag '6.11-rc-smb-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · 5437f30d
      Linus Torvalds authored
      Pull more smb client updates from Steve French:
      
       - fix for potential null pointer use in init cifs
      
       - additional dynamic trace points to improve debugging of some common
         scenarios
      
       - two SMB1 fixes (one addressing reconnect with POSIX extensions, one a
         mount parsing error)
      
      * tag '6.11-rc-smb-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        smb3: add dynamic trace point for session setup key expired failures
        smb3: add four dynamic tracepoints for copy_file_range and reflink
        smb3: add dynamic tracepoint for reflink errors
        cifs: mount with "unix" mount option for SMB1 incorrectly handled
        cifs: fix reconnect with SMB1 UNIX Extensions
        cifs: fix potential null pointer use in destroy_workqueue in init_cifs error path
      5437f30d
  10. 27 Jul, 2024 2 commits
    • Linus Torvalds's avatar
      Merge tag 'block-6.11-20240726' of git://git.kernel.dk/linux · 6342649c
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request via Keith:
           - Fix request without payloads cleanup  (Leon)
           - Use new protection information format (Francis)
           - Improved debug message for lost pci link (Bart)
           - Another apst quirk (Wang)
           - Use appropriate sysfs api for printing chars (Markus)
      
       - ublk async device deletion fix (Ming)
      
       - drbd kerneldoc fixups (Simon)
      
       - Fix deadlock between sd removal and release (Yang)
      
      * tag 'block-6.11-20240726' of git://git.kernel.dk/linux:
        nvme-pci: add missing condition check for existence of mapped data
        ublk: fix UBLK_CMD_DEL_DEV_ASYNC handling
        block: fix deadlock between sd_remove & sd_release
        drbd: Add peer_device to Kernel doc
        nvme-core: choose PIF from QPIF if QPIFS supports and PIF is QTYPE
        nvme-pci: Fix the instructions for disabling power management
        nvme: remove redundant bdev local variable
        nvme-fabrics: Use seq_putc() in __nvmf_concat_opt_tokens()
        nvme/pci: Add APST quirk for Lenovo N60z laptop
      6342649c
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.11-20240726' of git://git.kernel.dk/linux · 8c930747
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
      
       - Fix a syzbot issue for the msg ring cache added in this release. No
         ill effects from this one, but it did make KMSAN unhappy (me)
      
       - Sanitize the NAPI timeout handling, by unifying the value handling
         into all ktime_t rather than converting back and forth (Pavel)
      
       - Fail NAPI registration for IOPOLL rings, it's not supported (Pavel)
      
       - Fix a theoretical issue with ring polling and cancelations (Pavel)
      
       - Various little cleanups and fixes (Pavel)
      
      * tag 'io_uring-6.11-20240726' of git://git.kernel.dk/linux:
        io_uring/napi: pass ktime to io_napi_adjust_timeout
        io_uring/napi: use ktime in busy polling
        io_uring/msg_ring: fix uninitialized use of target_req->flags
        io_uring: align iowq and task request error handling
        io_uring: kill REQ_F_CANCEL_SEQ
        io_uring: simplify io_uring_cmd return
        io_uring: fix io_match_task must_hold
        io_uring: don't allow netpolling with SETUP_IOPOLL
        io_uring: tighten task exit cancellations
      8c930747