1. 08 5月, 2016 1 次提交
  2. 15 4月, 2016 4 次提交
  3. 05 4月, 2016 1 次提交
    • K
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov 提交于
      PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
      ago with promise that one day it will be possible to implement page
      cache with bigger chunks than PAGE_SIZE.
      
      This promise never materialized.  And unlikely will.
      
      We have many places where PAGE_CACHE_SIZE assumed to be equal to
      PAGE_SIZE.  And it's constant source of confusion on whether
      PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
      especially on the border between fs and mm.
      
      Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
      breakage to be doable.
      
      Let's stop pretending that pages in page cache are special.  They are
      not.
      
      The changes are pretty straight-forward:
      
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
      
       - page_cache_get() -> get_page();
      
       - page_cache_release() -> put_page();
      
      This patch contains automated changes generated with coccinelle using
      script below.  For some reason, coccinelle doesn't patch header files.
      I've called spatch for them manually.
      
      The only adjustment after coccinelle is revert of changes to
      PAGE_CAHCE_ALIGN definition: we are going to drop it later.
      
      There are few places in the code where coccinelle didn't reach.  I'll
      fix them manually in a separate patch.  Comments and documentation also
      will be addressed with the separate patch.
      
      virtual patch
      
      @@
      expression E;
      @@
      - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      expression E;
      @@
      - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      @@
      - PAGE_CACHE_SHIFT
      + PAGE_SHIFT
      
      @@
      @@
      - PAGE_CACHE_SIZE
      + PAGE_SIZE
      
      @@
      @@
      - PAGE_CACHE_MASK
      + PAGE_MASK
      
      @@
      expression E;
      @@
      - PAGE_CACHE_ALIGN(E)
      + PAGE_ALIGN(E)
      
      @@
      expression E;
      @@
      - page_cache_get(E)
      + get_page(E)
      
      @@
      expression E;
      @@
      - page_cache_release(E)
      + put_page(E)
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      09cbfeaf
  4. 31 3月, 2016 1 次提交
  5. 29 3月, 2016 1 次提交
  6. 18 3月, 2016 2 次提交
  7. 27 2月, 2016 1 次提交
  8. 23 2月, 2016 8 次提交
  9. 15 1月, 2016 1 次提交
    • V
      kmemcg: account certain kmem allocations to memcg · 5d097056
      Vladimir Davydov 提交于
      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: NVladimir Davydov <vdavydov@virtuozzo.com>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: NMichal 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: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5d097056
  10. 12 1月, 2016 2 次提交
  11. 09 1月, 2016 1 次提交
  12. 04 1月, 2016 1 次提交
  13. 31 12月, 2015 3 次提交
  14. 17 12月, 2015 5 次提交
  15. 16 12月, 2015 2 次提交
  16. 15 12月, 2015 1 次提交
  17. 10 12月, 2015 1 次提交
  18. 05 12月, 2015 2 次提交
    • C
      f2fs: fix memory leak of kobject in error path of fill_super · 29ba108d
      Chao Yu 提交于
      f2fs_sb_info::s_kobj should be released in error path of fill_super,
      otherwise it will lead to memory leak.
      
      This bug was found by kmemleak:
      
      dmesg:
      kmemleak: 2 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
      
      cat /sys/kernel/debug/kmemleak
      unreferenced object 0xffff8800838dc358 (size 8):
        comm "mount", pid 4154, jiffies 4297482839 (age 1911.412s)
        hex dump (first 8 bytes):
          7a 72 61 6d 31 00 ff ff                          zram1...
        backtrace:
          [<ffffffff817a3668>] kmemleak_alloc+0x28/0x50
          [<ffffffff811dc99f>] __kmalloc_track_caller+0xef/0x1c0
          [<ffffffff8119d1c5>] kstrdup+0x45/0x80
          [<ffffffff8119d228>] kstrdup_const+0x28/0x30
          [<ffffffff813d2333>] kvasprintf_const+0x63/0xa0
          [<ffffffff813c59fc>] kobject_set_name_vargs+0x3c/0xa0
          [<ffffffff813c5a85>] kobject_add_varg+0x25/0x60
          [<ffffffff813c5b13>] kobject_init_and_add+0x53/0x70
          [<ffffffffa07ced19>] f2fs_fill_super+0x9d9/0xc40 [f2fs]
          [<ffffffff811ff0b2>] mount_bdev+0x192/0x1d0
          [<ffffffffa07cd3e5>] f2fs_mount+0x15/0x20 [f2fs]
          [<ffffffff811fec93>] mount_fs+0x43/0x170
          [<ffffffff81220256>] vfs_kern_mount+0x76/0x160
          [<ffffffff812211c8>] do_mount+0x258/0xdc0
          [<ffffffff81221dab>] SyS_mount+0x7b/0xc0
          [<ffffffff817aecd7>] entry_SYSCALL_64_fastpath+0x12/0x6f
      ...
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      29ba108d
    • C
      f2fs: report error of f2fs_create_root_stats · 787c7b8c
      Chao Yu 提交于
      f2fs_create_root_stats can fail due to no memory, report it to user.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      787c7b8c
  19. 13 10月, 2015 1 次提交
    • C
      f2fs: export ra_nid_pages to sysfs · ea1a29a0
      Chao Yu 提交于
      After finishing building free nid cache, we will try to readahead
      asynchronously 4 more pages for the next reloading, the count of
      readahead nid pages is fixed.
      
      In some case, like SMR drive, read less sectors with fixed count
      each time we trigger RA may be low efficient, since we will face
      high seeking overhead, so we'd better let user to configure this
      parameter from sysfs in specific workload.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      ea1a29a0
  20. 10 10月, 2015 1 次提交