1. 05 4月, 2016 2 次提交
    • K
      mm, fs: remove remaining PAGE_CACHE_* and page_cache_{get,release} usage · ea1754a0
      Kirill A. Shutemov 提交于
      Mostly direct substitution with occasional adjustment or removing
      outdated comments.
      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>
      ea1754a0
    • 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
  2. 04 4月, 2016 2 次提交
  3. 03 4月, 2016 13 次提交
  4. 02 4月, 2016 2 次提交
  5. 01 4月, 2016 2 次提交
  6. 31 3月, 2016 4 次提交
  7. 30 3月, 2016 2 次提交
    • J
      MIPS: cpu_name_string: Use raw_smp_processor_id(). · e95008a1
      James Hogan 提交于
      If cpu_name_string() is used in non-atomic context when preemption is
      enabled, it can trigger a BUG such as this one:
      
      BUG: using smp_processor_id() in preemptible [00000000] code: unaligned/156
      caller is __show_regs+0x1e4/0x330
      CPU: 2 PID: 156 Comm: unaligned Tainted: G        W       4.3.0-00366-ga3592179816d-dirty #1501
      Stack : ffffffff80900000 ffffffff8019bc18 000000000000005f ffffffff80a20000
               0000000000000000 0000000000000009 ffffffff8019c0e0 ffffffff80835648
               a8000000ff2bdec0 ffffffff80a1e628 000000000000009c 0000000000000002
               ffffffff80840000 a8000000fff2ffb0 0000000000000020 ffffffff8020e43c
               a8000000fff2fcf8 ffffffff80a20000 0000000000000000 ffffffff808f2607
               ffffffff8082b138 ffffffff8019cd1c 0000000000000030 ffffffff8082b138
               0000000000000002 000000000000009c 0000000000000000 0000000000000000
               0000000000000000 a8000000fff2fc40 0000000000000000 ffffffff8044dbf4
               0000000000000000 0000000000000000 0000000000000000 ffffffff8010c400
               ffffffff80855bb0 ffffffff8010d008 0000000000000000 ffffffff8044dbf4
               ...
      Call Trace:
      [<ffffffff8010d008>] show_stack+0x90/0xb0
      [<ffffffff8044dbf4>] dump_stack+0x84/0xe0
      [<ffffffff8046d4ec>] check_preemption_disabled+0x10c/0x110
      [<ffffffff8010c40c>] __show_regs+0x1e4/0x330
      [<ffffffff8010d060>] show_registers+0x28/0xc0
      [<ffffffff80110748>] do_ade+0xcc8/0xce0
      [<ffffffff80105b84>] resume_userspace_check+0x0/0x10
      
      This is possible because cpu_name_string() is used by __show_regs(),
      which is used by both show_regs() and show_registers(). These two
      functions are used by various exception handling functions, only some of
      which ensure that interrupts or preemption is disabled.
      
      However the following have interrupts explicitly enabled or not
      explicitly disabled:
      - do_reserved() (irqs enabled)
      - do_ade() (irqs not disabled)
      
      This can be hit by setting /sys/kernel/debug/mips/unaligned_action to 2,
      and triggering an address error exception, e.g. an unaligned access or
      access to kernel segment from user mode.
      
      To fix the above cases, use raw_smp_processor_id() instead. It is
      unusual for CPU names to be different in the same system, and even if
      they were, its possible the process has migrated between the exception
      of interest and the cpu_name_string() call anyway.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/12212/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e95008a1
    • M
      pcmcia: db1xxx_ss: fix last irq_to_gpio user · e34b6fcf
      Manuel Lauss 提交于
      remove the usage of removed irq_to_gpio() function.  On pre-DB1200
      boards, pass the actual carddetect GPIO number instead of the IRQ,
      because we need the gpio to actually test card status (inserted or
      not) and can get the irq number with gpio_to_irq() instead.
      
      Tested on DB1300 and DB1500, this patch fixes PCMCIA on the DB1500,
      which used irq_to_gpio().
      
      Fixes: 832f5dac ("MIPS: Remove all the uses of custom gpio.h")
      Signed-off-by: NManuel Lauss <manuel.lauss@gmail.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Cc: linux-pcmcia@lists.infradead.org
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Cc: stable@vger.kernel.org	# v4.3+
      Patchwork: https://patchwork.linux-mips.org/patch/12747/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e34b6fcf
  8. 29 3月, 2016 13 次提交