1. 27 Jan, 2013 1 commit
    • Frederic Weisbecker's avatar
      cputime: Librarize per nsecs resolution cputime definitions · 39613766
      Frederic Weisbecker authored
      
      
      The full dynticks cputime accounting that we'll soon introduce
      will rely on sched_clock(). And its clock can have a per
      nanosecond granularity.
      
      To prepare for this, we need to have a cputime_t implementation
      that has this precision.
      
      ia64 virtual cputime accounting already uses that granularity
      so all we need is to librarize its implementation in the asm
      generic headers.
      
      Also librarize the default per jiffy granularity cputime_t
      as well so that we can easily pick either implementation
      depending on the cputime accounting config we choose.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Li Zhong <zhong@linux.vnet.ibm.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      39613766
  2. 03 Jan, 2013 2 commits
  3. 19 Dec, 2012 3 commits
  4. 28 Nov, 2012 2 commits
  5. 19 Nov, 2012 1 commit
    • Frederic Weisbecker's avatar
      vtime: Consolidate a bit the ctx switch code · e3942ba0
      Frederic Weisbecker authored
      
      
      On ia64 and powerpc, vtime context switch only consists
      in flushing system and user pending time, plus a few
      arch housekeeping.
      
      Consolidate that into a generic implementation. s390 is
      a special case because pending user and system time accounting
      there is hard to dissociate. So it's keeping its own implementation.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Reviewed-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      e3942ba0
  6. 14 Nov, 2012 1 commit
    • Mika Westerberg's avatar
      driver core / ACPI: Move ACPI support to core device and driver types · 06f64c8f
      Mika Westerberg authored
      
      
      With ACPI 5 we are starting to see devices that don't natively support
      discovery but can be enumerated with the help of the ACPI namespace.
      Typically, these devices can be represented in the Linux device driver
      model as platform devices or some serial bus devices, like SPI or I2C
      devices.
      
      Since we want to re-use existing drivers for those devices, we need a
      way for drivers to specify the ACPI IDs of supported devices, so that
      they can be matched against device nodes in the ACPI namespace.  To
      this end, it is sufficient to add a pointer to an array of supported
      ACPI device IDs, that can be provided by the driver, to struct device.
      
      Moreover, things like ACPI power management need to have access to
      the ACPI handle of each supported device, because that handle is used
      to invoke AML methods associated with the corresponding ACPI device
      node.  The ACPI handles of devices are now stored in the archdata
      member structure of struct device whose definition depends on the
      architecture and includes the ACPI handle only on x86 and ia64. Since
      the pointer to an array of supported ACPI IDs is added to struct
      device_driver in an architecture-independent way, it is logical to
      move the ACPI handle from archdata to struct device itself at the same
      time.  This also makes code more straightforward in some places and
      follows the example of Device Trees that have a poiter to struct
      device_node in there too.
      
      This changeset is based on Mika Westerberg's work.
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: default avatarH. Peter Anvin <hpa@zytor.com>
      Acked-by: default avatarTony Luck <tony.luck@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      06f64c8f
  7. 13 Nov, 2012 1 commit
  8. 01 Nov, 2012 1 commit
    • Pavel Emelyanov's avatar
      sk-filter: Add ability to get socket filter program (v2) · a8fc9277
      Pavel Emelyanov authored
      
      
      The SO_ATTACH_FILTER option is set only. I propose to add the get
      ability by using SO_ATTACH_FILTER in getsockopt. To be less
      irritating to eyes the SO_GET_FILTER alias to it is declared. This
      ability is required by checkpoint-restore project to be able to
      save full state of a socket.
      
      There are two issues with getting filter back.
      
      First, kernel modifies the sock_filter->code on filter load, thus in
      order to return the filter element back to user we have to decode it
      into user-visible constants. Fortunately the modification in question
      is interconvertible.
      
      Second, the BPF_S_ALU_DIV_K code modifies the command argument k to
      speed up the run-time division by doing kernel_k = reciprocal(user_k).
      Bad news is that different user_k may result in same kernel_k, so we
      can't get the original user_k back. Good news is that we don't have
      to do it. What we need to is calculate a user2_k so, that
      
        reciprocal(user2_k) == reciprocal(user_k) == kernel_k
      
      i.e. if it's re-loaded back the compiled again value will be exactly
      the same as it was. That said, the user2_k can be calculated like this
      
        user2_k = reciprocal(kernel_k)
      
      with an exception, that if kernel_k == 0, then user2_k == 1.
      
      The optlen argument is treated like this -- when zero, kernel returns
      the amount of sock_fprog elements in filter, otherwise it should be
      large enough for the sock_fprog array.
      
      changes since v1:
      * Declared SO_GET_FILTER in all arch headers
      * Added decode of vlan-tag codes
      Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a8fc9277
  9. 24 Oct, 2012 1 commit
  10. 19 Oct, 2012 2 commits
  11. 18 Oct, 2012 1 commit
    • David Howells's avatar
      UAPI: Make arch/ia64/include/asm/kvm_para.h generic · 7e3cdf24
      David Howells authored
      
      
      Make arch/ia64/include/asm/kvm_para.h generic since it's the same as the
      asm-generic version.  This deals with the problem when ia64 is compiled with
      allmodconfig you get:
      
      In file included from include/uapi/linux/kvm_para.h:26:0,
                       from include/linux/kvm_para.h:4,
                       from kernel/watchdog.c:28:
      arch/ia64/include/asm/kvm_para.h:24:28: error: redefinition of 'kvm_arch_para_features'
      include/asm-generic/kvm_para.h:16:28: note: previous definition of 'kvm_arch_para_features' was here
      arch/ia64/include/asm/kvm_para.h:29:20: error: redefinition of 'kvm_check_and_clear_guest_paused'
      include/asm-generic/kvm_para.h:11:20: note: previous definition of 'kvm_check_and_clear_guest_paused' was here
      
      This does not happen for ia64 defconfig.
      Reported-by: default avatarYuanhan Liu <yuanhan.liu@intel.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Yuanhan Liu <yuanhan.liu@intel.com>
      cc: fengguang.wu@intel.com
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      7e3cdf24
  12. 17 Oct, 2012 1 commit
    • David Howells's avatar
      UAPI: Put a comment into uapi/asm-generic/kvm_para.h and use it from arches · 0420c87e
      David Howells authored
      
      
      Make uapi/asm-generic/kvm_para.h non-empty by addition of a comment to stop
      the patch program from deleting it when it creates it.
      
      Then delete empty arch-specific uapi/asm/kvm_para.h files and tell the Kbuild
      files to use the generic instead.
      
      Should this perhaps instead be a #warning or #error that the facility is
      unsupported on this arch?
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Arnd Bergmann <arnd@arndb.de>
      cc: Avi Kivity <avi@redhat.com>
      cc: Marcelo Tosatti <mtosatti@redhat.com>
      cc: kvm@vger.kernel.org
      0420c87e
  13. 09 Oct, 2012 2 commits
  14. 03 Oct, 2012 1 commit
  15. 02 Oct, 2012 1 commit
  16. 01 Oct, 2012 1 commit
    • Al Viro's avatar
      sanitize tsk_is_polling() · 16a80163
      Al Viro authored
      
      
      Make default just return 0.  The current default (checking
      TIF_POLLING_NRFLAG) is taken to architectures that need it;
      ones that don't do polling in their idle threads don't need
      to defined TIF_POLLING_NRFLAG at all.
      
      ia64 defined both TS_POLLING (used by its tsk_is_polling())
      and TIF_POLLING_NRFLAG (not used at all).  Killed the latter...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      16a80163
  17. 27 Sep, 2012 1 commit
    • David Howells's avatar
      Make most arch asm/module.h files use asm-generic/module.h · 786d35d4
      David Howells authored
      Use the mapping of Elf_[SPE]hdr, Elf_Addr, Elf_Sym, Elf_Dyn, Elf_Rel/Rela,
      ELF_R_TYPE() and ELF_R_SYM() to either the 32-bit version or the 64-bit version
      into asm-generic/module.h for all arches bar MIPS.
      
      Also, use the generic definition mod_arch_specific where possible.
      
      To this end, I've defined three new config bools:
      
       (*) HAVE_MOD_ARCH_SPECIFIC
      
           Arches define this if they don't want to use the empty generic
           mod_arch_specific struct.
      
       (*) MODULES_USE_ELF_RELA
      
           Arches define this if their modules can contain RELA records.  This causes
           the Elf_Rela mapping to be emitted and allows apply_relocate_add() to be
           defined by the arch rather than have the core emit an error message.
      
       (*) MODULES_USE_ELF_REL
      
           Arches define this if their modules can contain REL records.  This causes
           the Elf_Rel mapping to be emitted and allows apply_relocate() to be
           defined by the arch rather than have the core emit an error mes...
      786d35d4
  18. 20 Sep, 2012 1 commit
  19. 10 Sep, 2012 1 commit
    • Jianguo Wu's avatar
      [IA64] Fix a node distance bug · 7cd10a60
      Jianguo Wu authored
      
      
      In arch ia64, has following definition:
      extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
      #define node_distance(from,to) (numa_slit[(from) * num_online_nodes() + (to)])
      
      num_online_nodes() is a variable value, it can be changed after hot-remove/add
      a node.
      
      In my practice, I found node distance is wrong after offline
      a node in IA64 platform. For example system has 4 nodes:
      node distances:
      node   0   1   2   3
        0:  10  21  21  32
        1:  21  10  32  21
        2:  21  32  10  21
        3:  32  21  21  10
      
      linux-drf:/sys/devices/system/node/node0 # cat distance
      10  21  21  32
      linux-drf:/sys/devices/system/node/node1 # cat distance
      21  10  32  21
      
      After offline node2:
      linux-drf:/sys/devices/system/node/node0 # cat distance
      10 21 32
      linux-drf:/sys/devices/system/node/node1 # cat distance
      32 21 32	--------->expected value is: 21  10  21
      Signed-off-by: default avatarJianguo Wu <wujianguo@huawei.com>
      Signed-off-by: default avatarJiang Liu <jiang.liu@huawei.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      7cd10a60
  20. 23 Aug, 2012 1 commit
  21. 21 Aug, 2012 1 commit
  22. 20 Aug, 2012 1 commit
    • Frederic Weisbecker's avatar
      cputime: Consolidate vtime handling on context switch · baa36046
      Frederic Weisbecker authored
      
      
      The archs that implement virtual cputime accounting all
      flush the cputime of a task when it gets descheduled
      and sometimes set up some ground initialization for the
      next task to account its cputime.
      
      These archs all put their own hooks in their context
      switch callbacks and handle the off-case themselves.
      
      Consolidate this by creating a new account_switch_vtime()
      callback called in generic code right after a context switch
      and that these archs must implement to flush the prev task
      cputime and initialize the next task cputime related state.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      baa36046
  23. 14 Sep, 2012 1 commit
  24. 26 Jul, 2012 1 commit
    • Tony Luck's avatar
      [IA64] Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the casts · a1193655
      Tony Luck authored
      
      
      The following build error occured during a ia64 build with
      swap-over-NFS patches applied.
      
      net/core/sock.c:274:36: error: initializer element is not constant
      net/core/sock.c:274:36: error: (near initialization for 'memalloc_socks')
      net/core/sock.c:274:36: error: initializer element is not constant
      
      This is identical to a parisc build error. Fengguang Wu, Mel Gorman
      and James Bottomley did all the legwork to track the root cause of
      the problem. This fix and entire commit log is shamelessly copied
      from them with one extra detail to change a dubious runtime use of
      ATOMIC_INIT() to atomic_set() in drivers/char/mspec.c
      
      Dave Anglin says:
      > Here is the line in sock.i:
      >
      > struct static_key memalloc_socks = ((struct static_key) { .enabled =
      > ((atomic_t) { (0) }) });
      
      The above line contains two compound literals.  It also uses a designated
      initializer to initialize the field enabled.  A compound literal is not a
      constant expression.
      
      The location of the above statement isn't fully clear, but if a compound
      literal occurs outside the body of a function, the initializer list must
      consist of constant expressions.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      a1193655
  25. 25 Jul, 2012 1 commit
  26. 25 Jun, 2012 1 commit
  27. 18 Jun, 2012 1 commit
  28. 01 Jun, 2012 2 commits
  29. 30 May, 2012 1 commit
  30. 16 May, 2012 3 commits
  31. 11 May, 2012 1 commit