1. 02 Mar, 2017 1 commit
  2. 15 Jan, 2016 1 commit
    • Vladimir Davydov's avatar
      kmemcg: account certain kmem allocations to memcg · 5d097056
      Vladimir Davydov authored
      Mark those kmem allocations that are known to be easily triggered from
      userspace as __GFP_ACCOUNT/SLAB_ACCOUNT, which makes them accounted to
      memcg.  For the list, see below:
       - threadinfo
       - task_struct
       - task_delay_info
       - pid
       - cred
       - mm_struct
       - vm_area_struct and vm_region (nommu)
       - anon_vma and anon_vma_chain
       - signal_struct
       - sighand_struct
       - fs_struct
       - files_struct
       - fdtable and fdtable->full_fds_bits
       - dentry and external_name
       - inode for all filesystems. This is the most tedious part, because
         most filesystems overwrite the alloc_inode method.
      The list is far from complete, so feel free to add more objects.
      Nevertheless, it should be close to "account everything" approach and
      keep most workloads within bounds.  Malevolent users will be able to
      breach the limit, but this was possible even with the former "account
      everything" approach (simply because it did not account everything in
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: default avatarVladimir Davydov <vdavydov@virtuozzo.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  3. 23 Aug, 2015 1 commit
  4. 08 Jun, 2015 1 commit
    • Tejun Heo's avatar
      v9fs: fix error handling in v9fs_session_init() · 412a19b6
      Tejun Heo authored
      On failure, v9fs_session_init() returns with the v9fs_session_info
      struct partially initialized and expects the caller to invoke
      v9fs_session_close() to clean it up; however, it doesn't track whether
      the bdi is initialized or not and curiously invokes bdi_destroy() in
      both vfs_session_init() failure path too.
      A. If v9fs_session_init() fails before the bdi is initialized, the
         follow-up v9fs_session_close() will invoke bdi_destroy() on an
         uninitialized bdi.
      B. If v9fs_session_init() fails after the bdi is initialized,
         bdi_destroy() will be called twice on the same bdi - once in the
         failure path of v9fs_session_init() and then by
      A is broken no matter what.  B used to be okay because bdi_destroy()
      allowed being invoked multiple times on the same bdi, which BTW was
      broken in its own way - if bdi_destroy() was invoked on an initialiezd
      but !registered bdi, it'd fail to free percpu counters.  Since
      f0054bb1 ("writeback: move backing_dev_info->wb_lock and
      ->worklist into bdi_writeback"), this no longer work - bdi_destroy()
      on an initialized but not registered bdi works correctly but multiple
      invocations of bdi_destroy() is no longer allowed.
      The obvious culprit here is v9fs_session_init()'s odd and broken error
      behavior.  It should simply clean up after itself on failures.  This
      patch makes the following updates to v9fs_session_init().
      * @rc -> @retval error return propagation removed.  It didn't serve
        any purpose.  Just use @rc.
      * Move addition to v9fs_sessionlist to the end of the function so that
        incomplete sessions are not put on the list or iterated and error
        path doesn't have to worry about it.
      * Update error handling so that it cleans up after itself.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
  5. 20 Jan, 2015 1 commit
  6. 04 Jun, 2014 1 commit
  7. 10 Jan, 2014 1 commit
  8. 18 Sep, 2013 1 commit
  9. 12 Feb, 2013 3 commits
  10. 03 Oct, 2012 1 commit
  11. 17 Sep, 2012 1 commit
  12. 21 Mar, 2012 1 commit
  13. 05 Jan, 2012 1 commit
    • Joe Perches's avatar
      9p: Reduce object size with CONFIG_NET_9P_DEBUG · 5d385153
      Joe Perches authored
      Reduce object size by deduplicating formats.
      Use vsprintf extension %pV.
      Rename P9_DPRINTK uses to p9_debug, align arguments.
      Add function for _p9_debug and macro to add __func__.
      Add missing "\n"s to p9_debug uses.
      Remove embedded function names as p9_debug adds it.
      Remove P9_EPRINTK macro and convert use to pr_<level>.
      Add and use pr_fmt and pr_<level>.
      $ size fs/9p/built-in.o*
         text	   data	    bss	    dec	    hex	filename
        62133	    984	  16000	  79117	  1350d	fs/9p/built-in.o.new
        67342	    984	  16928	  85254	  14d06	fs/9p/built-in.o.old
      $ size net/9p/built-in.o*
         text	   data	    bss	    dec	    hex	filename
        88792	   4148	  22024	 114964	  1c114	net/9p/built-in.o.new
        94072	   4148	  23232	 121452	  1da6c	net/9p/built-in.o.old
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
  14. 24 Oct, 2011 1 commit
  15. 23 Jul, 2011 2 commits
  16. 15 Mar, 2011 4 commits
  17. 28 Oct, 2010 1 commit
  18. 02 Aug, 2010 2 commits
  19. 22 Apr, 2010 1 commit
  20. 05 Apr, 2010 2 commits
  21. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      The script does the followings.
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
      The conversion was done in the following steps.
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
      6. percpu.h was updated not to include slab.h.
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
  22. 05 Mar, 2010 2 commits
  23. 08 Feb, 2010 2 commits
  24. 23 Sep, 2009 1 commit
    • Abhishek Kulkarni's avatar
      9p: Add fscache support to 9p · 60e78d2c
      Abhishek Kulkarni authored
      This patch adds a persistent, read-only caching facility for
      9p clients using the FS-Cache caching backend.
      When the fscache facility is enabled, each inode is associated
      with a corresponding vcookie which is an index into the FS-Cache
      indexing tree. The FS-Cache indexing tree is indexed at 3 levels:
      - session object associated with each mount.
      - inode/vcookie
      - actual data (pages)
      A cache tag is chosen randomly for each session. These tags can
      be read off /sys/fs/9p/caches and can be passed as a mount-time
      parameter to re-attach to the specified caching session.
      Signed-off-by: default avatarAbhishek Kulkarni <adkulkar@umail.iu.edu>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
  25. 17 Aug, 2009 1 commit
  26. 19 Dec, 2008 1 commit
  27. 17 Oct, 2008 2 commits
    • Eric Van Hensbergen's avatar
      9p: move readn meta-function from client to fs layer · fbedadc1
      Eric Van Hensbergen authored
      There are a couple of methods in the client code which aren't actually
      wire operations.  To keep things organized cleaner, these operations are
      being moved to the fs layer.
      This patch moves the readn meta-function (which executes multiple wire
      reads until a buffer is full) to the fs layer.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
    • Eric Van Hensbergen's avatar
      9p: consolidate transport structure · 8b81ef58
      Eric Van Hensbergen authored
      Right now there is a transport module structure which provides per-transport
      type functions and data and a transport structure which contains per-instance
      public data as well as function pointers to instance specific functions.
      This patch moves public transport visible instance data to the client
      structure (which in some cases had duplicate data) and consolidates the
      functions into the transport module structure.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
  28. 13 Oct, 2008 1 commit
  29. 15 May, 2008 1 commit
    • Eric Van Hensbergen's avatar
      9p: fix error path during early mount · 887b3ece
      Eric Van Hensbergen authored
      There was some cleanup issues during early mount which would trigger
      a kernel bug for certain types of failure.  This patch reorganizes the
      cleanup to get rid of the bad behavior.
      This also merges the 9pnet and 9pnet_fd modules for the purpose of
      configuration and initialization.  Keeping the fd transport separate
      from the core 9pnet code seemed like a good idea at the time, but in
      practice has caused more harm and confusion than good.
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>