06 Apr, 2016

1 commit

  • Use krealloc to implement our realloc function. This helps to avoid
    new allocations if we are still in the slab bucket. At least for the
    bmap btree root that's actually the common case.

    This also allows removing the now unused oldsize argument.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     

15 Jan, 2016

1 commit

  • 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
    fact).

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Vladimir Davydov
    Acked-by: Johannes Weiner
    Acked-by: Michal Hocko
    Cc: Tejun Heo
    Cc: Greg Thelen
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: David Rientjes
    Cc: Joonsoo Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Davydov
     

02 Feb, 2015

1 commit


07 Nov, 2013

1 commit

  • Introduce flag KM_ZERO which is used to alloc zeroed entry, and convert
    kmem_{zone_}zalloc to call kmem_{zone_}alloc() with KM_ZERO directly,
    in order to avoid the setting to zero step.
    And following Dave's suggestion, make kmem_{zone_}zalloc static inline
    into kmem.h as they're now just a simple wrapper.

    V2:
    Make kmem_{zone_}zalloc static inline into kmem.h as Dave suggested.

    Signed-off-by: Gu Zheng
    Reviewed-by: Dave Chinner
    Signed-off-by: Ben Myers

    Gu Zheng
     

11 Sep, 2013

1 commit

  • We have quite a few places now where we do:

    x = kmem_zalloc(large size)
    if (!x)
    x = kmem_zalloc_large(large size)

    and do a similar dance when freeing the memory. kmem_free() already
    does the correct freeing dance, and kmem_zalloc_large() is only ever
    called in these constructs, so just factor it all into
    kmem_zalloc_large() and kmem_free().

    Signed-off-by: Dave Chinner
    Reviewed-by: Mark Tinguely
    Signed-off-by: Ben Myers

    Dave Chinner
     

30 May, 2012

1 commit


11 Feb, 2012

1 commit

  • Stop reusing dquots from the freelist when allocating new ones directly, and
    implement a shrinker that actually follows the specifications for the
    interface. The shrinker implementation is still highly suboptimal at this
    point, but we can gradually work on it.

    This also fixes an bug in the previous lock ordering, where we would take
    the hash and dqlist locks inside of the freelist lock against the normal
    lock ordering. This is only solvable by introducing the dispose list,
    and thus not when using direct reclaim of unused dquots for new allocations.

    As a side-effect the quota upper bound and used to free ratio values in
    /proc/fs/xfs/xqm are set to 0 as these values don't make any sense in the
    new world order.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Ben Myers

    Christoph Hellwig
     

15 Sep, 2011

1 commit


13 Aug, 2011

1 commit

  • Use the move from Linux 2.6 to Linux 3.x as an excuse to kill the
    annoying subdirectories in the XFS source code. Besides the large
    amount of file rename the only changes are to the Makefile, a few
    files including headers with the subdirectory prefix, and the binary
    sysctl compat code that includes a header under fs/xfs/ from
    kernel/.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Alex Elder

    Christoph Hellwig