1. 15 11月, 2022 5 次提交
    • X
      mm/sharepool: Fix add group failed with errno 28 · 7086bdba
      Xu Qiang 提交于
      ascend inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I612UG
      CVE: NA
      
      --------------------------------
      
      We increase task->mm->mm_users by one when we add the task to a
      sharepool group. Correspondingly we should drop the mm_users count when
      the task exits. Currently we hijack the mmput function and make it
      return early and decrease mm->mm_users by one (just as mmput would do)
      if it is not called from a task's exiting process, or we decrease
      mm->mm_users by the group number the task was added to. This has two
      problems:
      1. It makes mmput and sp_group_exit hard to understand.
      2. The process of judging if the task (also its mm) is exiting and
         decrease its mm_users count is not atomic. We use this condition:
           mm->mm_users == master->count + MM_WOULD_FREE(1)
         If someone else change the mm->mm_users during those two steps, the
         mm->mm_users would be wrong and mm_struct cannot be released anymore.
      
      Suppose the following process:
      
              proc1                                        proc2
      
      1)      mmput
                |
                V
      2)  enter sp_group_exit and
          'mm->mm_users == master->count + 1' is true
      3)        |                                         mmget
                V
      4)  decrease mm->mm_users by master->count
                |
                V
      5)  enter __mmput and release mm_struct
          if mm->mm_users == 1
      6)                                                  mmput
      
      The statistical structure who has the same id of the task would get leaked
      together with mm_struct, so the next time we try to create the statistical
      structure of the same id, we get a failure.
      
      We fix this by moving sp_group_exit to do_exit() actually where the task is
      exiting. We don't need to judge if the task is exiting when someone
      calling mmput so there is no chance to change mm_users wrongly.
      Signed-off-by: NXu Qiang <xuqiang36@huawei.com>
      Signed-off-by: NWang Wensheng <wangwensheng4@huawei.com>
      7086bdba
    • Z
      mm: sharepool: Fix static check warning · fab907d0
      Zhang Zekun 提交于
      ascend inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I612UG
      CVE: NA
      
      --------------------------------
      
      Fix the following static check warning.
      Use parentheses to specify the sequence of expressions, instead of using
      the default priority.Should use parenthesis while use bitwise operator.
      
      Fix this by add bracket in the expression.
      Signed-off-by: NZhang Zekun <zhangzekun11@huawei.com>
      fab907d0
    • X
      irq-gic-v3: Fix too large cpu_count · 9cc7c400
      Xu Qiang 提交于
      ascend inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I612UG
      CVE: NA
      
      --------------------------------
      
      Fix that value of CPU is too large in its_inc_lpi_count.
      Signed-off-by: NXu Qiang <xuqiang36@huawei.com>
      9cc7c400
    • Z
      mm/sharepool: Use "tgid" instead of "pid" to find a task · 32c81f1b
      Zhang Zekun 提交于
      ascend inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I612UG
      CVE: NA
      
      --------------------------------
      
      To support container scenario, use tgid instead of pid to find a
      specific task. In normal cases, "tgid" represent a process in init_pid_ns,
      this patch should not introduce problems to existing code.
      
      Rename the input parameter "int pid" to "int tgid" in following
      exported interfaces:
      1.mg_sp_group_id_by_pid()
      2.mg_sp_group_add_task()
      3.mg_sp_group_del_task()
      4.mg_sp_make_share_k2u()
      5.mg_sp_make_share_u2k()
      6.mg_sp_config_dvpp_range()
      
      Besides, rename these static function together:
      1.__sp_find_spg_locked()
      2.__sp_find_spg()
      
      The following function use "current->pid" to find spg, change
      "current->pid" to "current->tgid".
      1.find_or_alloc_sp_group()
      2.sp_alloc_prepare()
      3.mg_sp_make_share_k2u()
      Signed-off-by: NZhang Zekun <zhangzekun11@huawei.com>
      32c81f1b
    • W
      ascend/arm64: Add ascend_enable_all kernel parameter · 66ae8ddd
      Wang Wensheng 提交于
      ascend inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I612UG
      CVE: NA
      
      --------------------------------
      
      This kernel parameter is used for ascend scene and would open all the
      options needed at once.
      Signed-off-by: NWang Wensheng <wangwensheng4@huawei.com>
      66ae8ddd
  2. 14 11月, 2022 2 次提交
    • O
      !235 Introduce memory reliable · f7cf91c9
      openeuler-ci-bot 提交于
      Merge Pull Request from: @ma-wupeng 
       
      Introduction
      
      ============
      
      Memory reliable feature is a memory tiering mechanism. It is based on
      kernel mirror feature, which splits memory into two sperate regions,
      mirrored(reliable) region and non-mirrored (non-reliable) region.
      
      for kernel mirror feature:
      
      - allocate kernel memory from mirrored region by default
      - allocate user memory from non-mirrored region by default
      
      non-mirrored region will be arranged into ZONE_MOVABLE.
      
      for kernel reliable feature, it has additional features below:
      
      - normal user tasks never alloc memory from mirrored region with userspace
        apis(malloc, mmap, etc.)
      - special user tasks will allocate memory from mirrored region by default
      - tmpfs/pagecache allocate memory from mirrored region by default
      - upper limit of mirrored region allcated for user tasks, tmpfs and
        pagecache
      
      Support Reliable fallback mechanism which allows special user tasks, tmpfs
      and pagecache can fallback to alloc non-mirrored region, it's the default
      setting.
      
      In order to fulfil the goal
      
      - ___GFP_RELIABLE flag added for alloc memory from mirrored region.
      
      - the high_zoneidx for special user tasks/tmpfs/pagecache is set to
        ZONE_NORMAL.
      
      - normal user tasks could only alloc from ZONE_MOVABLE.
      
      This patch is just the main framework, memory reliable support for special
      user tasks, pagecache and tmpfs has own patches.
      
      To enable this function, mirrored(reliable) memory is needed and
      "kernelcore=reliable" should be added to kernel parameters.
      
      PR for 22.09: https://gitee.com/openeuler/kernel/pulls/79 
       
      Link:https://gitee.com/openeuler/kernel/pulls/235 
      Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com> 
      Reviewed-by: Xie XiuQi <xiexiuqi@huawei.com> 
      Reviewed-by: Zheng Zengkai <zhengzengkai@huawei.com> 
      Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> 
      f7cf91c9
    • O
      !200 x86: support MWAIT C1 as the default idle state · 61f39efb
      openeuler-ci-bot 提交于
      Merge Pull Request from: @haochengxie 
       
      Two patches to support MWAIT C1 as the default idle state. For systems disabled global C-states in BIOS, kernel will use the default function as idle state. Historically, the default idle state uses HLT, but it should be mwait (if it support) to improve the exit latency.
       
       
      Link:https://gitee.com/openeuler/kernel/pulls/200 
      Reviewed-by: Hanjun Guo <guohanjun@huawei.com> 
      Reviewed-by: Zheng Zengkai <zhengzengkai@huawei.com> 
      Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> 
      61f39efb
  3. 11 11月, 2022 31 次提交
  4. 10 11月, 2022 2 次提交