Skip to content
Snippets Groups Projects
  1. Jan 19, 2023
  2. Sep 24, 2022
  3. Jul 04, 2022
    • Roman Gushchin's avatar
      tools: add memcg_shrinker.py · d261ea23
      Roman Gushchin authored
      Add a simple tool which prints a sorted list of shrinker lists in the
      following format: (number of objects, shrinker name, cgroup).
      
      Example:
        $ ./memcg_shrinker.py -n 10
        2090     sb-sysfs-26          /sys/fs/cgroup/system.slice
        1809     sb-sysfs-26          /sys/fs/cgroup/system.slice/systemd-udevd.service
        1044     sb-btrfs:vda2-24     /sys/fs/cgroup/system.slice/system-dbus\x2d:1.3\...
        861      sb-btrfs:vda2-24     /sys/fs/cgroup/system.slice/system-dbus\x2d:1.3\...
        804      sb-btrfs:vda2-24     /sys/fs/cgroup/system.slice
        643      sb-btrfs:vda2-24     /sys/fs/cgroup/system.slice/firewalld.service
        616      sb-cgroup2-30        /sys/fs/cgroup/init.scope
        275      sb-sysfs-26          /
        238      sb-proc-25           /sys/fs/cgroup/system.slice/systemd-journald.service
        225      sb-proc-25           /sys/fs/cgroup/system.slice/abrtd.service
      
      Link: https://lkml.kernel.org/r/20220601032227.4076670-6-roman.gushchin@linux.dev
      
      
      Signed-off-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Dave Chinner <dchinner@redhat.com>
      Cc: Hillf Danton <hdanton@sina.com>
      Cc: Kent Overstreet <kent.overstreet@gmail.com>
      Cc: Muchun Song <songmuchun@bytedance.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      d261ea23
  4. Feb 21, 2022
    • Roman Gushchin's avatar
      tools/cgroup/slabinfo: update to work with struct slab · 22194473
      Roman Gushchin authored
      
      After the introduction of the dedicated struct slab to describe slab
      pages by commit d122019b ("mm: Split slab into its own type") and
      the following removal of the corresponding struct page's fields by
      commit 07f910f9 ("mm: Remove slab from struct page") the
      memcg_slabinfo tool broke. An attempt to run it produces a trace like
      this:
      Traceback (most recent call last):
        File "/usr/bin/drgn", line 33, in <module>
          sys.exit(load_entry_point('drgn==0.0.16', 'console_scripts', 'drgn')())
        File "/usr/lib64/python3.9/site-packages/drgn/internal/cli.py", line 133, in main
          runpy.run_path(args.script[0], init_globals=init_globals, run_name="__main__")
        File "/usr/lib64/python3.9/runpy.py", line 268, in run_path
          return _run_module_code(code, init_globals, run_name,
        File "/usr/lib64/python3.9/runpy.py", line 97, in _run_module_code
          _run_code(code, mod_globals, init_globals,
        File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
          exec(code, run_globals)
        File "memcg_slabinfo.py", line 226, in <module>
          main()
        File "memcg_slabinfo.py", line 199, in main
          cache = page.slab_cache
      AttributeError: 'struct page' has no member 'slab_cache'
      
      The problem can be fixed by explicitly casting struct page * to struct
      slab * for slab pages. The tools works as expected with this fix, e.g.:
      
      cred_jar             776    776    192   21    1 : tunables    0    0    0 : slabdata    547    547      0
      kmalloc-cg-32          6      6     32  128    1 : tunables    0    0    0 : slabdata      9      9      0
      files_cache            3      3    832   39    8 : tunables    0    0    0 : slabdata      8      8      0
      kmalloc-cg-512         1      1    512   32    4 : tunables    0    0    0 : slabdata     10     10      0
      task_struct           10     10   6720    4    8 : tunables    0    0    0 : slabdata     63     63      0
      mm_struct              3      3   1664   19    8 : tunables    0    0    0 : slabdata      9      9      0
      kmalloc-cg-16          1      1     16  256    1 : tunables    0    0    0 : slabdata      8      8      0
      pde_opener             1      1     40  102    1 : tunables    0    0    0 : slabdata      8      8      0
      anon_vma_chain       375    375     64   64    1 : tunables    0    0    0 : slabdata     81     81      0
      radix_tree_node        3      3    584   28    4 : tunables    0    0    0 : slabdata    419    419      0
      dentry                98     98    312   26    2 : tunables    0    0    0 : slabdata   1420   1420      0
      btrfs_inode            3      3   2368   13    8 : tunables    0    0    0 : slabdata    730    730      0
      signal_cache           3      3   1600   20    8 : tunables    0    0    0 : slabdata     17     17      0
      sighand_cache          3      3   2240   14    8 : tunables    0    0    0 : slabdata     20     20      0
      filp                  90     90    512   32    4 : tunables    0    0    0 : slabdata     95     95      0
      anon_vma             214    214    200   20    1 : tunables    0    0    0 : slabdata    162    162      0
      kmalloc-cg-1k          1      1   1024   32    8 : tunables    0    0    0 : slabdata     22     22      0
      pid                   10     10    256   32    2 : tunables    0    0    0 : slabdata     14     14      0
      kmalloc-cg-64          2      2     64   64    1 : tunables    0    0    0 : slabdata      8      8      0
      kmalloc-cg-96          3      3     96   42    1 : tunables    0    0    0 : slabdata      8      8      0
      sock_inode_cache       5      5   1408   23    8 : tunables    0    0    0 : slabdata     29     29      0
      UNIX                   7      7   1920   17    8 : tunables    0    0    0 : slabdata     21     21      0
      inode_cache           36     36   1152   28    8 : tunables    0    0    0 : slabdata    680    680      0
      proc_inode_cache      26     26   1224   26    8 : tunables    0    0    0 : slabdata     64     64      0
      kmalloc-cg-2k          2      2   2048   16    8 : tunables    0    0    0 : slabdata      9      9      0
      
      v2: change naming and count_partial()/count_free()/for_each_slab()
          signatures to work with slabs, suggested by Matthew Wilcox
      
      Fixes: 07f910f9 ("mm: Remove slab from struct page")
      Reported-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Signed-off-by: default avatarRoman Gushchin <guro@fb.com>
      Tested-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Link: https://lore.kernel.org/linux-patches/Yg2cKKnIboNu7j+p@carbon.DHCP.thefacebook.com/
      22194473
  5. Apr 23, 2021
  6. Sep 02, 2020
  7. Aug 07, 2020
    • Roman Gushchin's avatar
      tools/cgroup: add memcg_slabinfo.py tool · fbc1ac9d
      Roman Gushchin authored
      
      Add a drgn-based tool to display slab information for a given memcg.  Can
      replace cgroup v1 memory.kmem.slabinfo interface on cgroup v2, but in a
      more flexiable way.
      
      Currently supports only SLUB configuration, but SLAB can be trivially
      added later.
      
      Output example:
      $ sudo ./tools/cgroup/memcg_slabinfo.py /sys/fs/cgroup/user.slice/user-111017.slice/user\@111017.service
      shmem_inode_cache     92     92    704   46    8 : tunables    0    0    0 : slabdata      2      2      0
      eventpoll_pwq         56     56     72   56    1 : tunables    0    0    0 : slabdata      1      1      0
      eventpoll_epi         32     32    128   32    1 : tunables    0    0    0 : slabdata      1      1      0
      kmalloc-8              0      0      8  512    1 : tunables    0    0    0 : slabdata      0      0      0
      kmalloc-96             0      0     96   42    1 : tunables    0    0    0 : slabdata      0      0      0
      kmalloc-2048           0      0   2048   16    8 : tunables    0    0    0 : slabdata      0      0      0
      kmalloc-64           128    128     64   64    1 : tunables    0    0    0 : slabdata      2      2      0
      mm_struct            160    160   1024   32    8 : tunables    0    0    0 : slabdata      5      5      0
      signal_cache          96     96   1024   32    8 : tunables    0    0    0 : slabdata      3      3      0
      sighand_cache         45     45   2112   15    8 : tunables    0    0    0 : slabdata      3      3      0
      files_cache          138    138    704   46    8 : tunables    0    0    0 : slabdata      3      3      0
      task_delay_info      153    153     80   51    1 : tunables    0    0    0 : slabdata      3      3      0
      task_struct           27     27   3520    9    8 : tunables    0    0    0 : slabdata      3      3      0
      radix_tree_node       56     56    584   28    4 : tunables    0    0    0 : slabdata      2      2      0
      btrfs_inode          140    140   1136   28    8 : tunables    0    0    0 : slabdata      5      5      0
      kmalloc-1024          64     64   1024   32    8 : tunables    0    0    0 : slabdata      2      2      0
      kmalloc-192           84     84    192   42    2 : tunables    0    0    0 : slabdata      2      2      0
      inode_cache           54     54    600   27    4 : tunables    0    0    0 : slabdata      2      2      0
      kmalloc-128            0      0    128   32    1 : tunables    0    0    0 : slabdata      0      0      0
      kmalloc-512           32     32    512   32    4 : tunables    0    0    0 : slabdata      1      1      0
      skbuff_head_cache     32     32    256   32    2 : tunables    0    0    0 : slabdata      1      1      0
      sock_inode_cache      46     46    704   46    8 : tunables    0    0    0 : slabdata      1      1      0
      cred_jar             378    378    192   42    2 : tunables    0    0    0 : slabdata      9      9      0
      proc_inode_cache      96     96    672   24    4 : tunables    0    0    0 : slabdata      4      4      0
      dentry               336    336    192   42    2 : tunables    0    0    0 : slabdata      8      8      0
      filp                 697    864    256   32    2 : tunables    0    0    0 : slabdata     27     27      0
      anon_vma             644    644     88   46    1 : tunables    0    0    0 : slabdata     14     14      0
      pid                 1408   1408     64   64    1 : tunables    0    0    0 : slabdata     22     22      0
      vm_area_struct      1200   1200    200   40    2 : tunables    0    0    0 : slabdata     30     30      0
      
      Signed-off-by: default avatarRoman Gushchin <guro@fb.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Shakeel Butt <shakeelb@google.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Link: http://lkml.kernel.org/r/20200623174037.3951353-20-guro@fb.com
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fbc1ac9d
  8. Jul 30, 2020
  9. May 05, 2020
    • Tejun Heo's avatar
      iocost: protect iocg->abs_vdebt with iocg->waitq.lock · 0b80f986
      Tejun Heo authored
      
      abs_vdebt is an atomic_64 which tracks how much over budget a given cgroup
      is and controls the activation of use_delay mechanism. Once a cgroup goes
      over budget from forced IOs, it has to pay it back with its future budget.
      The progress guarantee on debt paying comes from the iocg being active -
      active iocgs are processed by the periodic timer, which ensures that as time
      passes the debts dissipate and the iocg returns to normal operation.
      
      However, both iocg activation and vdebt handling are asynchronous and a
      sequence like the following may happen.
      
      1. The iocg is in the process of being deactivated by the periodic timer.
      
      2. A bio enters ioc_rqos_throttle(), calls iocg_activate() which returns
         without anything because it still sees that the iocg is already active.
      
      3. The iocg is deactivated.
      
      4. The bio from #2 is over budget but needs to be forced. It increases
         abs_vdebt and goes over the threshold and enables use_delay.
      
      5. IO control is enabled for the iocg's subtree and now IOs are attributed
         to the descendant cgroups and the iocg itself no longer issues IOs.
      
      This leaves the iocg with stuck abs_vdebt - it has debt but inactive and no
      further IOs which can activate it. This can end up unduly punishing all the
      descendants cgroups.
      
      The usual throttling path has the same issue - the iocg must be active while
      throttled to ensure that future event will wake it up - and solves the
      problem by synchronizing the throttling path with a spinlock. abs_vdebt
      handling is another form of overage handling and shares a lot of
      characteristics including the fact that it isn't in the hottest path.
      
      This patch fixes the above and other possible races by strictly
      synchronizing abs_vdebt and use_delay handling with iocg->waitq.lock.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarVlad Dmitriev <vvd@fb.com>
      Cc: stable@vger.kernel.org # v5.4+
      Fixes: e1518f63 ("blk-iocost: Don't let merges push vtime into the future")
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      0b80f986
  10. Apr 30, 2020
  11. Mar 25, 2020
  12. Jan 17, 2020
  13. Sep 10, 2019
  14. Aug 29, 2019
  15. Feb 22, 2018
    • Martin Kelly's avatar
      tools: fix cross-compile var clobbering · 7ed1c190
      Martin Kelly authored
      Currently a number of Makefiles break when used with toolchains that
      pass extra flags in CC and other cross-compile related variables (such
      as --sysroot).
      
      Thus we get this error when we use a toolchain that puts --sysroot in
      the CC var:
      
        ~/src/linux/tools$ make iio
        [snip]
        iio_event_monitor.c:18:10: fatal error: unistd.h: No such file or directory
          #include <unistd.h>
                   ^~~~~~~~~~
      
      This occurs because we clobber several env vars related to
      cross-compiling with lines like this:
      
        CC = $(CROSS_COMPILE)gcc
      
      Although this will point to a valid cross-compiler, we lose any extra
      flags that might exist in the CC variable, which can break toolchains
      that rely on them (for example, those that use --sysroot).
      
      This easily shows up using a Yocto SDK:
      
        $ . [snip]/sdk/environment-setup-cortexa8hf-neon-poky-linux-gnueabi
      
        $ echo $CC
        arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard
        -mcpu=cortex-a8
        --sysroot=[snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi
      
        $ echo $CROSS_COMPILE
        arm-poky-linux-gnueabi-
      
        $ echo ${CROSS_COMPILE}gcc
        krm-poky-linux-gnueabi-gcc
      
      Although arm-poky-linux-gnueabi-gcc is a cross-compiler, we've lost the
      --sysroot and other flags that enable us to find the right libraries to
      link against, so we can't find unistd.h and other libraries and headers.
      Normally with the --sysroot flag we would find unistd.h in the sdk
      directory in the sysroot:
      
        $ find [snip]/sdk/sysroots -path '*/usr/include/unistd.h'
        [snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/include/unistd.h
      
      The perf Makefile adds CC = $(CROSS_COMPILE)gcc if and only if CC is not
      already set, and it compiles correctly with the above toolchain.
      
      So, generalize the logic that perf uses in the common Makefile and
      remove the manual CC = $(CROSS_COMPILE)gcc lines from each Makefile.
      
      Note that this patch does not fix cross-compile for all the tools (some
      have other bugs), but it does fix it for all except usb and acpi, which
      still have other unrelated issues.
      
      I tested both with and without the patch on native and cross-build and
      there appear to be no regressions.
      
      Link: http://lkml.kernel.org/r/20180107214028.23771-1-martin@martingkelly.com
      
      
      Signed-off-by: default avatarMartin Kelly <martin@martingkelly.com>
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: Pali Rohar <pali.rohar@gmail.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Lv Zheng <lv.zheng@intel.com>
      Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Valentina Manea <valentina.manea.m@gmail.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7ed1c190
  16. Nov 02, 2017
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  17. Jan 08, 2013
    • Greg Thelen's avatar
      cgroups: fix cgroup_event_listener error handling · 799105d5
      Greg Thelen authored
      
      The error handling in cgroup_event_listener.c did not correctly deal
      with either an error opening either <control_file> or
      cgroup.event_control.  Due to an uninitialized variable the program
      exit code was undefined if either of these opens failed.
      
      This patch simplifies and corrects cgroup_event_listener.c error
      handling by:
      1. using err*() rather than printf(),exit()
      2. depending on process exit to close open files
      
      With this patch failures always return non-zero error.
      
      Signed-off-by: default avatarGreg Thelen <gthelen@google.com>
      Acked-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      799105d5
  18. Jan 07, 2013
Loading