1. 15 2月, 2014 1 次提交
  2. 30 7月, 2013 1 次提交
    • H
      cpu topology: remove stale arch_provides_topology_pointers and define_siblings_show_map/list() · 29f1953d
      Hanjun Guo 提交于
      arch_provides_topology_pointers was introduced in commit 23ca4bba (x86:
      cleanup early per cpu variables/accesses v4) to indicate pointers to the
      topology cpumask_t maps are valid to avoid copying data on to/off of the
      stack.
      
      But later in commit fbd59a8d (cpumask: Use topology_core_cpumask()/
      topology_thread_cpumask()), the pointers to the topology struct cpumask maps
      are always valid.
      
      After that commit, the only difference is that there is a redundant
      "unsigned int cpu = dev->id;" if arch_provides_topology_pointers defined, but
      dev->id is type 'u32' which devolves to 'unsigned int' on all supported arches.
      So this arch_provides_topology_pointers define is pointless and only cause
      obfuscation now, remove it.
      
      Tested on x86 machine, topology information in sys/devices/system/cpu/
      cpuX/topology/ is the same after appling this patch set.
      Signed-off-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      29f1953d
  3. 15 7月, 2013 1 次提交
  4. 22 12月, 2011 1 次提交
    • K
      cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem · 8a25a2fd
      Kay Sievers 提交于
      This moves the 'cpu sysdev_class' over to a regular 'cpu' subsystem
      and converts the devices to regular devices. The sysdev drivers are
      implemented as subsystem interfaces now.
      
      After all sysdev classes are ported to regular driver core entities, the
      sysdev implementation will be entirely removed from the kernel.
      
      Userspace relies on events and generic sysfs subsystem infrastructure
      from sysdev devices, which are made available with this conversion.
      
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      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>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Borislav Petkov <bp@amd64.org>
      Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8a25a2fd
  5. 10 9月, 2010 1 次提交
  6. 28 5月, 2010 1 次提交
  7. 12 1月, 2009 1 次提交
  8. 08 1月, 2009 1 次提交
    • D
      topology: Fix sparc64 build. · b13d3720
      David Miller 提交于
      Due to changeset ba84be23 ("remove
      linux/hardirq.h from asm-generic/local.h") the sparc64 build started
      failing on drivers/base/topology.c:
      
        drivers/base/topology.c: In function ‘show_physical_package_id’:
        drivers/base/topology.c:103: error: implicit declaration of function ‘cpu_data’
        drivers/base/topology.c:103: error: request for member ‘proc_id’ in something not a structure or union
        drivers/base/topology.c: In function ‘show_core_id’:
        drivers/base/topology.c:106: error: request for member ‘core_id’ in something not a structure or union
      
      Adding the obvious fix of including asm/cpudata.h into asm/topology.h on
      sparc64 doesn't fix it, in fact it makes things worse because of the
      header file dependency chain:
      
      	linux/gfp.h --> linux/mmzone.h --> linux/topology.h -->
      	asm/topology.h --> asm/cpudata.h --> linux/percpu.h -->
      	linux/slab.h
      
      which results in:
      
        include/linux/slub_def.h: In function ‘kmalloc_large’:
        include/linux/slub_def.h:209: error: implicit declaration of function ‘__get_free_pages’
        include/linux/slub_def.h:209: error: ‘__GFP_COMP’ undeclared (first use in this function)
        include/linux/slub_def.h:209: error: (Each undeclared identifier is reported only once
        include/linux/slub_def.h:209: error: for each function it appears in.)
        include/linux/slub_def.h:209: warning: cast to pointer from integer of different size
      
      The simplest thing to do is to add yet another one-off hack like parts
      of the guilty changeset did, by putting an explicit linux/hardirq.h
      include into drivers/base/topology.c
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b13d3720
  9. 13 12月, 2008 1 次提交
    • R
      cpumask: change cpumask_scnprintf, cpumask_parse_user, cpulist_parse, and... · 29c0177e
      Rusty Russell 提交于
      cpumask: change cpumask_scnprintf, cpumask_parse_user, cpulist_parse, and cpulist_scnprintf to take pointers.
      
      Impact: change calling convention of existing cpumask APIs
      
      Most cpumask functions started with cpus_: these have been replaced by
      cpumask_ ones which take struct cpumask pointers as expected.
      
      These four functions don't have good replacement names; fortunately
      they're rarely used, so we just change them over.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NMike Travis <travis@sgi.com>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Cc: paulus@samba.org
      Cc: mingo@redhat.com
      Cc: tony.luck@intel.com
      Cc: ralf@linux-mips.org
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: cl@linux-foundation.org
      Cc: srostedt@redhat.com
      29c0177e
  10. 22 7月, 2008 1 次提交
    • A
      sysdev: Pass the attribute to the low level sysdev show/store function · 4a0b2b4d
      Andi Kleen 提交于
      This allow to dynamically generate attributes and share show/store
      functions between attributes. Right now most attributes are generated
      by special macros and lots of duplicated code. With the attribute
      passed it's instead possible to attach some data to the attribute
      and then use that in shared low level functions to do different things.
      
      I need this for the dynamically generated bank attributes in the x86
      machine check code, but it'll allow some further cleanups.
      
      I converted all users in tree to the new show/store prototype. It's a single
      huge patch to avoid unbisectable sections.
      
      Runtime tested: x86-32, x86-64
      Compiled only: ia64, powerpc
      Not compile tested/only grep converted: sh, arm, avr32
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4a0b2b4d
  11. 08 7月, 2008 1 次提交
    • M
      x86: cleanup early per cpu variables/accesses v4 · 23ca4bba
      Mike Travis 提交于
        * Introduce a new PER_CPU macro called "EARLY_PER_CPU".  This is
          used by some per_cpu variables that are initialized and accessed
          before there are per_cpu areas allocated.
      
          ["Early" in respect to per_cpu variables is "earlier than the per_cpu
          areas have been setup".]
      
          This patchset adds these new macros:
      
      	DEFINE_EARLY_PER_CPU(_type, _name, _initvalue)
      	EXPORT_EARLY_PER_CPU_SYMBOL(_name)
      	DECLARE_EARLY_PER_CPU(_type, _name)
      
      	early_per_cpu_ptr(_name)
      	early_per_cpu_map(_name, _idx)
      	early_per_cpu(_name, _cpu)
      
          The DEFINE macro defines the per_cpu variable as well as the early
          map and pointer.  It also initializes the per_cpu variable and map
          elements to "_initvalue".  The early_* macros provide access to
          the initial map (usually setup during system init) and the early
          pointer.  This pointer is initialized to point to the early map
          but is then NULL'ed when the actual per_cpu areas are setup.  After
          that the per_cpu variable is the correct access to the variable.
      
          The early_per_cpu() macro is not very efficient but does show how to
          access the variable if you have a function that can be called both
          "early" and "late".  It tests the early ptr to be NULL, and if not
          then it's still valid.  Otherwise, the per_cpu variable is used
          instead:
      
      	#define early_per_cpu(_name, _cpu) 			\
      		(early_per_cpu_ptr(_name) ?			\
      			early_per_cpu_ptr(_name)[_cpu] :	\
      			per_cpu(_name, _cpu))
      
          A better method is to actually check the pointer manually.  In the
          case below, numa_set_node can be called both "early" and "late":
      
      	void __cpuinit numa_set_node(int cpu, int node)
      	{
      	    int *cpu_to_node_map = early_per_cpu_ptr(x86_cpu_to_node_map);
      
      	    if (cpu_to_node_map)
      		    cpu_to_node_map[cpu] = node;
      	    else
      		    per_cpu(x86_cpu_to_node_map, cpu) = node;
      	}
      
        * Add a flag "arch_provides_topology_pointers" that indicates pointers
          to topology cpumask_t maps are available.  Otherwise, use the function
          returning the cpumask_t value.  This is useful if cpumask_t set size
          is very large to avoid copying data on to/off of the stack.
      
        * The coverage of CONFIG_DEBUG_PER_CPU_MAPS has been increased while
          the non-debug case has been optimized a bit.
      
        * Remove an unreferenced compiler warning in drivers/base/topology.c
      
        * Clean up #ifdef in setup.c
      
      For inclusion into sched-devel/latest tree.
      
      Based on:
      	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
          +   sched-devel/latest  .../mingo/linux-2.6-sched-devel.git
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      23ca4bba
  12. 13 6月, 2008 2 次提交
  13. 20 4月, 2008 1 次提交
  14. 19 10月, 2007 1 次提交
  15. 10 5月, 2007 1 次提交
    • R
      Add suspend-related notifications for CPU hotplug · 8bb78442
      Rafael J. Wysocki 提交于
      Since nonboot CPUs are now disabled after tasks and devices have been
      frozen and the CPU hotplug infrastructure is used for this purpose, we need
      special CPU hotplug notifications that will help the CPU-hotplug-aware
      subsystems distinguish normal CPU hotplug events from CPU hotplug events
      related to a system-wide suspend or resume operation in progress.  This
      patch introduces such notifications and causes them to be used during
      suspend and resume transitions.  It also changes all of the
      CPU-hotplug-aware subsystems to take these notifications into consideration
      (for now they are handled in the same way as the corresponding "normal"
      ones).
      
      [oleg@tv-sign.ru: cleanups]
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8bb78442
  16. 08 12月, 2006 1 次提交
  17. 02 12月, 2006 1 次提交
  18. 19 10月, 2006 1 次提交
  19. 01 8月, 2006 1 次提交
  20. 28 6月, 2006 2 次提交
  21. 26 4月, 2006 1 次提交
  22. 04 2月, 2006 1 次提交
    • Z
      [PATCH] Export cpu topology in sysfs · 69dcc991
      Zhang, Yanmin 提交于
      The patch implements cpu topology exportation by sysfs.
      
      Items (attributes) are similar to /proc/cpuinfo.
      
      1) /sys/devices/system/cpu/cpuX/topology/physical_package_id:
      	represent the physical package id of  cpu X;
      2) /sys/devices/system/cpu/cpuX/topology/core_id:
      	represent the cpu core id to cpu X;
      3) /sys/devices/system/cpu/cpuX/topology/thread_siblings:
      	represent the thread siblings to cpu X in the same core;
      4) /sys/devices/system/cpu/cpuX/topology/core_siblings:
      	represent the thread siblings to cpu X in the same physical package;
      
      To implement it in an architecture-neutral way, a new source file,
      driver/base/topology.c, is to export the 5 attributes.
      
      If one architecture wants to support this feature, it just needs to
      implement 4 defines, typically in file include/asm-XXX/topology.h.
      The 4 defines are:
      #define topology_physical_package_id(cpu)
      #define topology_core_id(cpu)
      #define topology_thread_siblings(cpu)
      #define topology_core_siblings(cpu)
      
      The type of **_id is int.
      The type of siblings is cpumask_t.
      
      To be consistent on all architectures, the 4 attributes should have
      deafult values if their values are unavailable. Below is the rule.
      
      1) physical_package_id: If cpu has no physical package id, -1 is the
      default value.
      
      2) core_id: If cpu doesn't support multi-core, its core id is 0.
      
      3) thread_siblings: Just include itself, if the cpu doesn't support
      HT/multi-thread.
      
      4) core_siblings: Just include itself, if the cpu doesn't support
      multi-core and HT/Multi-thread.
      
      So be careful when declaring the 4 defines in include/asm-XXX/topology.h.
      
      If an attribute isn't defined on an architecture, it won't be exported.
      
      Thank Nathan, Greg, Andi, Paul and Venki.
      
      The patch provides defines for i386/x86_64/ia64.
      Signed-off-by: NZhang, Yanmin <yanmin.zhang@intel.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      69dcc991