Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcontainer: add support for Intel RDT/CAT in runc #1198

Commits on Nov 22, 2016

  1. Godeps: specs-go: update specs for Intel RDT/CAT

    NOTE: this patch is only for purpose of compiling runc. It is not necessary
    if the dependent runtime-spec patch is merged.
    
    Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
    xiaochenshen committed Nov 22, 2016
    Configuration menu
    Copy the full SHA
    e0f5d46 View commit details
    Browse the repository at this point in the history
  2. libcontainer/SPEC.md: add documentation for Intel RDT/CAT

    Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
    xiaochenshen committed Nov 22, 2016
    Configuration menu
    Copy the full SHA
    e6adcba View commit details
    Browse the repository at this point in the history
  3. libcontainer: add support for Intel RDT/CAT in runc

    About Intel RDT/CAT feature:
    Intel platforms with new Xeon CPU support Intel Resource Director Technology
    (RDT). Cache Allocation Technology (CAT) is a sub-feature of RDT, which
    currently supports L3 cache resource allocation.
    
    This feature provides a way for the software to restrict cache allocation to a
    defined 'subset' of L3 cache which may be overlapping with other 'subsets'.
    The different subsets are identified by class of service (CLOS) and each CLOS
    has a capacity bitmask (CBM).
    
    For more information about Intel RDT/CAT can be found in the section 17.17
    of Intel Software Developer Manual.
    
    About Intel RDT/CAT kernel interface:
    In Linux kernel, the interface is defined and exposed via "resource control"
    filesystem, which is a "cgroup-like" interface.
    
    Comparing with cgroups, it has similar process management lifecycle and
    interfaces in a container. But unlike cgroups' hierarchy, it has single level
    filesystem layout.
    
    Intel RDT "resource control" filesystem hierarchy:
    mount -t resctrl resctrl /sys/fs/resctrl
    tree /sys/fs/resctrl
    /sys/fs/resctrl/
    |-- info
    |   |-- L3
    |       |-- cbm_mask
    |       |-- num_closids
    |-- cpus
    |-- schemata
    |-- tasks
    |-- <container_id>
        |-- cpus
        |-- schemata
        |-- tasks
    
    For runc, we can make use of `tasks` and `schemata` configuration for L3 cache
    resource constraints.
    
     The file `tasks` has a list of tasks that belongs to this group (e.g.,
    <container_id>" group). Tasks can be added to a group by writing the task ID
    to the "tasks" file  (which will automatically remove them from the previous
    group to which they belonged). New tasks created by fork(2) and clone(2) are
    added to the same group as their parent. If a pid is not in any sub group, it
    Is in root group.
    
    The file `schemata` has allocation bitmasks/values for L3 cache on each socket,
    which contains L3 cache id and capacity bitmask (CBM).
    	Format: "L3:<cache_id0>=<cbm0>;<cache_id1>=<cbm1>;..."
    For example, on a two-socket machine, L3's schema line could be `L3:0=ff;1=c0`
    which means L3 cache id 0's CBM is 0xff, and L3 cache id 1's CBM is 0xc0.
    
    The valid L3 cache CBM is a *contiguous bits set* and number of bits that can
    be set is less than the max bit. The max bits in the CBM is varied among
    supported Intel Xeon platforms. In Intel RDT "resource control" filesystem
    layout, the CBM in a group should be a subset of the CBM in root. Kernel will
    check if it is valid when writing. e.g., 0xfffff in root indicates the max bits
    of CBM is 20 bits, which mapping to entire L3 cache capacity. Some valid CBM
    values to set in a group: 0xf, 0xf0, 0x3ff, 0x1f00 and etc.
    
    For more information about Intel RDT/CAT kernel interface:
    https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?h=x86/cache&id=f20e57892806ad244eaec7a7ae365e78fee53377
    
    An example for runc:
    There are two L3 caches in the two-socket machine, the default CBM is 0xfffff
    and the max CBM length is 20 bits. This configuration assigns 4/5 of L3 cache
    id 0 and the whole L3 cache id 1 for the container:
    
    "linux": {
    	"resources": {
    		"intelRdt": {
    			"l3CacheSchema": "L3:0=ffff0;1=fffff"
    		}
    	}
    }
    
    Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
    xiaochenshen committed Nov 22, 2016
    Configuration menu
    Copy the full SHA
    12877b2 View commit details
    Browse the repository at this point in the history