1. 17 9月, 2013 1 次提交
  2. 13 9月, 2013 7 次提交
  3. 12 9月, 2013 1 次提交
    • N
      mm: migrate: check movability of hugepage in unmap_and_move_huge_page() · 83467efb
      Naoya Horiguchi 提交于
      Currently hugepage migration works well only for pmd-based hugepages
      (mainly due to lack of testing,) so we had better not enable migration of
      other levels of hugepages until we are ready for it.
      
      Some users of hugepage migration (mbind, move_pages, and migrate_pages) do
      page table walk and check pud/pmd_huge() there, so they are safe.  But the
      other users (softoffline and memory hotremove) don't do this, so without
      this patch they can try to migrate unexpected types of hugepages.
      
      To prevent this, we introduce hugepage_migration_support() as an
      architecture dependent check of whether hugepage are implemented on a pmd
      basis or not.  And on some architecture multiple sizes of hugepages are
      available, so hugepage_migration_support() also checks hugepage size.
      Signed-off-by: NNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Hillf Danton <dhillf@gmail.com>
      Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      83467efb
  4. 07 9月, 2013 2 次提交
    • C
      tile: refresh tile defconfig files · 06da6629
      Chris Metcalf 提交于
      These are based on the current shipping versions of the config files
      from Tilera, as synced up to the tip, so are a better starting point
      for folks who want a default configuration.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      06da6629
    • C
      tile: rework <asm/cmpxchg.h> · 6dc9658f
      Chris Metcalf 提交于
      The macrology in cmpxchg.h was designed to allow arbitrary pointer
      and integer values to be passed through the routines.  To support
      cmpxchg() on 64-bit values on the 32-bit tilepro architecture, we
      used the idiom "(typeof(val))(typeof(val-val))".  This way, in the
      "size 8" branch of the switch, when the underlying cmpxchg routine
      returns a 64-bit quantity, we cast it first to a typeof(val-val)
      quantity (i.e. size_t if "val" is a pointer) with no warnings about
      casting between pointers and integers of different sizes, then cast
      onwards to typeof(val), again with no warnings.  If val is not a
      pointer type, the additional cast is a no-op.  We can't replace the
      typeof(val-val) cast with (for example) unsigned long, since then if
      "val" is really a 64-bit type, we cast away the high bits.
      
      HOWEVER, this fails with current gcc (through 4.7 at least) if "val"
      is a pointer to an incomplete type.  Unfortunately gcc isn't smart
      enough to realize that "val - val" will always be a size_t type
      even if it's an incomplete type pointer.
      
      Accordingly, I've reworked the way we handle the casting.  We have
      given up the ability to use cmpxchg() on 64-bit values on tilepro,
      which is OK in the kernel since we should use cmpxchg64() explicitly
      on such values anyway.  As a result, I can just use simple "unsigned
      long" casts internally.
      
      As I reworked it, I realized it would be cleaner to move the
      architecture-specific conditionals for cmpxchg and xchg out of the
      atomic.h headers and into cmpxchg, and then use the cmpxchg() and
      xchg() primitives directly in atomic.h and elsewhere.  This allowed
      the cmpxchg.h header to stand on its own without relying on the
      implicit include of it that is performed by <asm/atomic.h>.
      It also allowed collapsing the atomic_xchg/atomic_cmpxchg routines
      from atomic_{32,64}.h into atomic.h.
      
      I improved the tests that guard the allowed size of the arguments
      to the routines to use a __compiletime_error() test.  (By avoiding
      the use of BUILD_BUG, I could include cmpxchg.h into bitops.h as
      well and use the macros there, which is otherwise impossible due
      to include order dependency issues.)
      
      The tilepro _atomic_xxx internal methods were previously set up to
      take atomic_t and atomic64_t arguments, which isn't as convenient
      with the new model, so I modified them to take int or u64 arguments,
      which is consistent with how they used the arguments internally
      anyway, so provided some nice simplification there too.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      6dc9658f
  5. 04 9月, 2013 23 次提交
  6. 30 8月, 2013 6 次提交
    • C
      tile: handle super huge pages in virt_to_pte · a718e10c
      Chris Metcalf 提交于
      This tile-specific API had a minor bug, in that if a super huge (>4GB)
      page mapped a particular address range, we wouldn't handle it correctly.
      As part of fixing that bug, I also cleaned up some of the pud and pmd
      accessors to make them more consistent.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      a718e10c
    • C
      tilegx: change how we find the kernel stack · 35f05976
      Chris Metcalf 提交于
      Previously, we used a special-purpose register (SPR_SYSTEM_SAVE_K_0)
      to hold the CPU number and the top of the current kernel stack
      by using the low bits to hold the CPU number, and using the high
      bits to hold the address of the page just above where we'd want
      the kernel stack to be.  That way we could initialize a new SP
      when first entering the kernel by just masking the SPR value and
      subtracting a couple of words.
      
      However, it's actually more useful to be able to place an arbitrary
      kernel-top value in the SPR.  This allows us to create a new stack
      context (e.g. for virtualization) with an arbitrary top-of-stack VA.
      To make this work, we now store the CPU number in the high bits,
      above the highest legal VA bit (42 bits in the current tilegx
      microarchitecture).  The full 42 bits are thus available to store the
      top of stack value.  Getting the current cpu (a relatively common
      operation) is still fast; it's now a shift rather than a mask.
      
      We make this change only for tilegx, since tilepro has too few SPR
      bits to do this, and we don't need this support on tilepro anyway.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      35f05976
    • C
      tile: don't call show_regs_print_info() with corrupt current · 4036c7d3
      Chris Metcalf 提交于
      We use the validate_current() API to make sure that "current" seems
      plausible before using it.  With the new show_regs_print_info()
      API, we want to check that current is OK before calling it, since
      otherwise we will end up in a recursive panic.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      4036c7d3
    • C
      tile: fix some -Wsign-compare warnings · 6fbeee29
      Chris Metcalf 提交于
      Normally the build doesn't include these warnings, but at one
      point I built with -Wsign-compare, and noticed a few things that
      are technically bugs.  This change fixes those things.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      6fbeee29
    • C
      tile: group .hottext* sections properly in vmlinux.lds · e56059f2
      Chris Metcalf 提交于
      With this change such sections are grouped with regular text
      in the vmlinux image; this change puts them at the front,
      which is where the standard Linux includes .text.hot*.
      This change should fix a recently-observed bug where a bunch of
      symbols were being omitted from the /proc/kallsyms output
      because they fell between _etext and _sinittext.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      e56059f2
    • C
      tile: fix strncpy_from_user bug · c0f06010
      Chris Metcalf 提交于
      In strncpy_from_user_asm, when the destination buffer length was the
      same as the actual string length, we were returning the size of the
      destination buffer.  But since it's a NUL terminated string, we should
      return the length of the string instead.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      c0f06010