1. 02 8月, 2017 11 次提交
  2. 01 7月, 2017 1 次提交
  3. 14 4月, 2017 4 次提交
  4. 11 4月, 2017 1 次提交
    • J
      x86/intel_rdt: Add cpus_list rdtgroup file · 4ffa3c97
      Jiri Olsa 提交于
      The resource control filesystem provides only a bitmask based cpus file for
      assigning CPUs to a resource group. That's cumbersome with large cpumasks
      and non-intuitive when modifying the file from the command line.
      
      Range based cpu lists are commonly used along with bitmask based cpu files
      in various subsystems throughout the kernel.
      
      Add 'cpus_list' file which is CPU range based.
      
        # cd /sys/fs/resctrl/
        # echo 1-10 > krava/cpus_list
        # cat krava/cpus_list
        1-10
        # cat krava/cpus
        0007fe
        # cat cpus
        fffff9
        # cat cpus_list
        0,3-23
      
      [ tglx: Massaged changelog and replaced "bitmask lists" by "CPU ranges" ]
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Shaohua Li <shli@fb.com>
      Link: http://lkml.kernel.org/r/20170410145232.GF25354@kravaSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      4ffa3c97
  5. 15 3月, 2017 1 次提交
    • J
      x86/intel_rdt: Put group node in rdtgroup_kn_unlock · 49ec8f5b
      Jiri Olsa 提交于
      The rdtgroup_kn_unlock waits for the last user to release and put its
      node. But it's calling kernfs_put on the node which calls the
      rdtgroup_kn_unlock, which might not be the group's directory node, but
      another group's file node.
      
      This race could be easily reproduced by running 2 instances
      of following script:
      
        mount -t resctrl resctrl /sys/fs/resctrl/
        pushd /sys/fs/resctrl/
        mkdir krava
        echo "krava" > krava/schemata
        rmdir krava
        popd
        umount  /sys/fs/resctrl
      
      It triggers the slub debug error message with following command
      line config: slub_debug=,kernfs_node_cache.
      
      Call kernfs_put on the group's node to fix it.
      
      Fixes: 60cf5e10 ("x86/intel_rdt: Add mkdir to resctrl file system")
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Shaohua Li <shli@fb.com>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/1489501253-20248-1-git-send-email-jolsa@kernel.orgSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      49ec8f5b
  6. 02 3月, 2017 2 次提交
  7. 01 3月, 2017 1 次提交
  8. 09 12月, 2016 1 次提交
  9. 02 12月, 2016 1 次提交
  10. 28 11月, 2016 2 次提交
  11. 16 11月, 2016 4 次提交
    • F
      x86/intel_rdt: Update percpu closid immeditately on CPUs affected by changee · f4107702
      Fenghua Yu 提交于
      If CPUs are moved to or removed from a rdtgroup, the percpu closid storage
      is updated. If tasks running on an affected CPU use the percpu closid then
      the PQR_ASSOC MSR is only updated when the task runs through a context
      switch. Up to the context switch the CPUs operate on the wrong closid. This
      state is potentially unbound.
          
      Make the change immediately effective by invoking a smp function call on
      the affected CPUs which stores the new closid in the perpu storage and
      calls the rdt_sched_in() function which updates the MSR, if the current
      task uses the percpu closid.
      
      [ tglx: Made it work and massaged changelog once more ]
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Sai Prakhya" <sai.praneeth.prakhya@intel.com>
      Cc: "Vikas Shivappa" <vikas.shivappa@linux.intel.com>
      Cc: "Ingo Molnar" <mingo@elte.hu>
      Cc: "H. Peter Anvin" <h.peter.anvin@intel.com>
      Link: http://lkml.kernel.org/r/1478912558-55514-3-git-send-email-fenghua.yu@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      f4107702
    • F
      x86/intel_rdt: Reset per cpu closids on unmount · c7cc0cc1
      Fenghua Yu 提交于
      All CPUs in a rdtgroup are given back to the default rdtgroup before the
      rdtgroup is removed during umount. After umount, the default rdtgroup
      contains all online CPUs, but the per cpu closids are not cleared. As a
      result the stale closid value will be used immediately after the next
      mount.
      
      Move all cpus to the default group and update the percpu closid storage.
      
      [ tglx: Massaged changelong ]
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Sai Prakhya" <sai.praneeth.prakhya@intel.com>
      Cc: "Vikas Shivappa" <vikas.shivappa@linux.intel.com>
      Cc: "Ingo Molnar" <mingo@elte.hu>
      Cc: "H. Peter Anvin" <h.peter.anvin@intel.com>
      Link: http://lkml.kernel.org/r/1478912558-55514-2-git-send-email-fenghua.yu@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      c7cc0cc1
    • T
      x86/intel_rdt: Prevent deadlock against hotplug lock · a2584e1d
      Thomas Gleixner 提交于
      The cpu online/offline callbacks of intel_rdt lock rdtgroup_mutex nested
      inside of cpu hotplug lock. rdtgroup_cpus_write() does it in reverse order.
      
      Remove the get/put_online_cpus() calls from rdtgroup_cpus_write(). This is
      safe against cpu hotplug as the resource group cpumasks are protected by
      rdtgroup_mutex.
      
      Found by review, but should have been found if authors would have bothered
      to test cpu hotplug with lockdep enabled.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Shaohua Li <shli@fb.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      a2584e1d
    • F
      x86/intel_rdt: Protect info directory from removal · f57b3087
      Fenghua Yu 提交于
      The info directory and the per-resource subdirectories of the info
      directory have no reference to a struct rdtgroup in kn->priv. An attempt to
      remove one of those directories results in a NULL pointer dereference.
      
      Protect the directories from removal and return -EPERM instead of -ENOENT.
      
      [ tglx: Massaged changelog ]
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Sai Prakhya" <sai.praneeth.prakhya@intel.com>
      Cc: "Vikas Shivappa" <vikas.shivappa@linux.intel.com>
      Cc: "Ingo Molnar" <mingo@elte.hu>
      Cc: "H. Peter Anvin" <h.peter.anvin@intel.com>
      Link: http://lkml.kernel.org/r/1478912558-55514-1-git-send-email-fenghua.yu@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      f57b3087
  12. 07 11月, 2016 2 次提交
  13. 31 10月, 2016 7 次提交
    • F
      x86/intel_rdt: Add scheduler hook · 4f341a5e
      Fenghua Yu 提交于
      Hook the x86 scheduler code to update closid based on whether the current
      task is assigned to a specific closid or running on a CPU assigned to a
      specific closid.
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Shaohua Li" <shli@fb.com>
      Cc: "Sai Prakhya" <sai.praneeth.prakhya@intel.com>
      Cc: "Peter Zijlstra" <peterz@infradead.org>
      Cc: "Stephane Eranian" <eranian@google.com>
      Cc: "Dave Hansen" <dave.hansen@intel.com>
      Cc: "David Carrillo-Cisneros" <davidcc@google.com>
      Cc: "Nilay Vaish" <nilayvaish@gmail.com>
      Cc: "Vikas Shivappa" <vikas.shivappa@linux.intel.com>
      Cc: "Ingo Molnar" <mingo@elte.hu>
      Cc: "Borislav Petkov" <bp@suse.de>
      Cc: "H. Peter Anvin" <h.peter.anvin@intel.com>
      Link: http://lkml.kernel.org/r/1477692289-37412-10-git-send-email-fenghua.yu@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      4f341a5e
    • T
      x86/intel_rdt: Add schemata file · 60ec2440
      Tony Luck 提交于
      Last of the per resource group files. Also mode 0644. This one shows
      the resources available to the group. Syntax depends on whether the
      "cdp" mount option was given. With code/data prioritization disabled
      it is simply a list of masks for each cache domain. Initial value
      allows access to all of the L3 cache on all domains. E.g. on a 2 socket
      Broadwell:
              L3:0=fffff;1=fffff
      With CDP enabled, separate masks for data and instructions are provided:
              L3DATA:0=fffff;1=fffff
              L3CODE:0=fffff;1=fffff
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com>
      Cc: "Shaohua Li" <shli@fb.com>
      Cc: "Sai Prakhya" <sai.praneeth.prakhya@intel.com>
      Cc: "Peter Zijlstra" <peterz@infradead.org>
      Cc: "Stephane Eranian" <eranian@google.com>
      Cc: "Dave Hansen" <dave.hansen@intel.com>
      Cc: "David Carrillo-Cisneros" <davidcc@google.com>
      Cc: "Nilay Vaish" <nilayvaish@gmail.com>
      Cc: "Vikas Shivappa" <vikas.shivappa@linux.intel.com>
      Cc: "Ingo Molnar" <mingo@elte.hu>
      Cc: "Borislav Petkov" <bp@suse.de>
      Cc: "H. Peter Anvin" <h.peter.anvin@intel.com>
      Link: http://lkml.kernel.org/r/1477692289-37412-9-git-send-email-fenghua.yu@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      60ec2440
    • F
      x86/intel_rdt: Add tasks files · e02737d5
      Fenghua Yu 提交于
      The root directory all subdirectories are automatically populated with a
      read/write (mode 0644) file named "tasks". When read it will show all the
      task IDs assigned to the resource group. Tasks can be added (one at a time)
      to a group by writing the task ID to the file.  E.g.
      
      Membership in a resource group is indicated by a new field in the
      task_struct "int closid" which holds the CLOSID for each task. The default
      resource group uses CLOSID=0 which means that all existing tasks when the
      resctrl file system is mounted belong to the default group.
      
      If a group is removed, tasks which are members of that group are moved to
      the default group.
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Shaohua Li" <shli@fb.com>
      Cc: "Sai Prakhya" <sai.praneeth.prakhya@intel.com>
      Cc: "Peter Zijlstra" <peterz@infradead.org>
      Cc: "Stephane Eranian" <eranian@google.com>
      Cc: "Dave Hansen" <dave.hansen@intel.com>
      Cc: "David Carrillo-Cisneros" <davidcc@google.com>
      Cc: "Nilay Vaish" <nilayvaish@gmail.com>
      Cc: "Vikas Shivappa" <vikas.shivappa@linux.intel.com>
      Cc: "Ingo Molnar" <mingo@elte.hu>
      Cc: "Borislav Petkov" <bp@suse.de>
      Cc: "H. Peter Anvin" <h.peter.anvin@intel.com>
      Link: http://lkml.kernel.org/r/1477692289-37412-8-git-send-email-fenghua.yu@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      e02737d5
    • T
      x86/intel_rdt: Add cpus file · 12e0110c
      Tony Luck 提交于
      Now we populate each directory with a read/write (mode 0644) file
      named "cpus". This is used to over-ride the resources available
      to processes in the default resource group when running on specific
      CPUs.  Each "cpus" file reads as a cpumask showing which CPUs belong
      to this resource group. Initially all online CPUs are assigned to
      the default group. They can be added to other groups by writing a
      cpumask to the "cpus" file in the directory for the resource group
      (which will remove them from the previous group to which they were
      assigned). CPU online/offline operations will delete CPUs that go
      offline from whatever group they are in and add new CPUs to the
      default group.
      
      If there are CPUs assigned to a group when the directory is removed,
      they are returned to the default group.
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com>
      Cc: "Shaohua Li" <shli@fb.com>
      Cc: "Sai Prakhya" <sai.praneeth.prakhya@intel.com>
      Cc: "Peter Zijlstra" <peterz@infradead.org>
      Cc: "Stephane Eranian" <eranian@google.com>
      Cc: "Dave Hansen" <dave.hansen@intel.com>
      Cc: "David Carrillo-Cisneros" <davidcc@google.com>
      Cc: "Nilay Vaish" <nilayvaish@gmail.com>
      Cc: "Vikas Shivappa" <vikas.shivappa@linux.intel.com>
      Cc: "Ingo Molnar" <mingo@elte.hu>
      Cc: "Borislav Petkov" <bp@suse.de>
      Cc: "H. Peter Anvin" <h.peter.anvin@intel.com>
      Link: http://lkml.kernel.org/r/1477692289-37412-7-git-send-email-fenghua.yu@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      12e0110c
    • F
      x86/intel_rdt: Add mkdir to resctrl file system · 60cf5e10
      Fenghua Yu 提交于
      Resource control groups are represented as directories in the resctrl
      file system. The root directory describes the default resources available
      to tasks that have not been assigned specific resources. Other directories
      can be created at the root level to make new resource groups. It is not
      permitted to make directories within other directories.
      
      Hardware uses a CLOSID (Class of service ID) to determine which resource
      limits are currently in effect. The exact number available is enumerated
      by CPUID leaf 0x10, but on current implementations it is a small number.
      We implement a simple bitmask allocator for CLOSIDs.
      
      Each resource control group uses one CLOSID, which limits the total number
      of directories that can be created.
      
      Resource groups can be removed using rmdir.
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Shaohua Li" <shli@fb.com>
      Cc: "Sai Prakhya" <sai.praneeth.prakhya@intel.com>
      Cc: "Peter Zijlstra" <peterz@infradead.org>
      Cc: "Stephane Eranian" <eranian@google.com>
      Cc: "Dave Hansen" <dave.hansen@intel.com>
      Cc: "David Carrillo-Cisneros" <davidcc@google.com>
      Cc: "Nilay Vaish" <nilayvaish@gmail.com>
      Cc: "Vikas Shivappa" <vikas.shivappa@linux.intel.com>
      Cc: "Ingo Molnar" <mingo@elte.hu>
      Cc: "Borislav Petkov" <bp@suse.de>
      Cc: "H. Peter Anvin" <h.peter.anvin@intel.com>
      Link: http://lkml.kernel.org/r/1477692289-37412-6-git-send-email-fenghua.yu@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      60cf5e10
    • F
      x86/intel_rdt: Add "info" files to resctrl file system · 4e978d06
      Fenghua Yu 提交于
      For the convenience of applications we make the decoded values of some
      of the CPUID values available in read-only (0444) files.
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Shaohua Li" <shli@fb.com>
      Cc: "Sai Prakhya" <sai.praneeth.prakhya@intel.com>
      Cc: "Peter Zijlstra" <peterz@infradead.org>
      Cc: "Stephane Eranian" <eranian@google.com>
      Cc: "Dave Hansen" <dave.hansen@intel.com>
      Cc: "David Carrillo-Cisneros" <davidcc@google.com>
      Cc: "Nilay Vaish" <nilayvaish@gmail.com>
      Cc: "Vikas Shivappa" <vikas.shivappa@linux.intel.com>
      Cc: "Ingo Molnar" <mingo@elte.hu>
      Cc: "Borislav Petkov" <bp@suse.de>
      Cc: "H. Peter Anvin" <h.peter.anvin@intel.com>
      Link: http://lkml.kernel.org/r/1477692289-37412-5-git-send-email-fenghua.yu@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      4e978d06
    • F
      x86/intel_rdt: Add basic resctrl filesystem support · 5ff193fb
      Fenghua Yu 提交于
      Use kernfs as basis for our user interface filesystem. This patch
      supports mount/umount, and one mount parameter "cdp" to enable code/data
      prioritization (though all we do at this point is ensure that the system
      can support CDP).  The file system is not populated yet in this patch.
      
      [ tglx: Fixed up a few nits and added cdp handling in case of error ]
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Shaohua Li" <shli@fb.com>
      Cc: "Sai Prakhya" <sai.praneeth.prakhya@intel.com>
      Cc: "Peter Zijlstra" <peterz@infradead.org>
      Cc: "Stephane Eranian" <eranian@google.com>
      Cc: "Dave Hansen" <dave.hansen@intel.com>
      Cc: "David Carrillo-Cisneros" <davidcc@google.com>
      Cc: "Nilay Vaish" <nilayvaish@gmail.com>
      Cc: "Vikas Shivappa" <vikas.shivappa@linux.intel.com>
      Cc: "Ingo Molnar" <mingo@elte.hu>
      Cc: "Borislav Petkov" <bp@suse.de>
      Cc: "H. Peter Anvin" <h.peter.anvin@intel.com>
      Link: http://lkml.kernel.org/r/1477692289-37412-4-git-send-email-fenghua.yu@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      5ff193fb