19 Dec, 2008
1 commit
-
Impact: add new sysfs files.
Add sysfs files "kernel_max" and "offline" to display the max CPU index
allowed (NR_CPUS-1), and the map of cpus that are offline.Cpus can be offlined via HOTPLUG, disabled by the BIOS ACPI tables, or
if they exceed the number of cpus allowed by the NR_CPUS config option,
or the "maxcpus=NUM" kernel start parameter.The "possible_cpus=NUM" parameter can also extend the number of possible
cpus allowed, in which case the cpus not present at startup will be
in the offline state. (These cpus can be HOTPLUGGED ON after system
startup [pending a follow-on patch to provide the capability via the
/sys/devices/sys/cpu/cpuN/online mechanism to bring them online.])By design, the "offlined cpus > possible cpus" display will always
use the following formats:* all possible cpus online: "x$" or "x-y$"
* some possible cpus offline: ".*,x$" or ".*,x-y$"where:
x == number of possible cpus (nr_cpu_ids); and
y == number of cpus >= NR_CPUS or maxcpus (if y > x).One use of this feature is for distros to select (or configure) the
appropriate kernel to install for the resident system.Notes:
* cpus offlined possible cpus will only be printed for arches that
set 'total_cpus' [X86 only in this patch].Based on tip/cpus4096 + .../rusty/linux-2.6-for-ingo.git/master +
x86-only-patches sent 12/15.Signed-off-by: Mike Travis
Signed-off-by: Rusty Russell
13 Dec, 2008
1 commit
-
…t_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: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Ingo 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
30 Oct, 2008
2 commits
-
SYSFS: Fix return values for sysdev_store_{ulong,int}
Always return the full size instead of the consumed
length of the string in sysdev_store_{ulong,int}This avoids EINVAL errors in some echo versions.
Signed-off-by: Andi Kleen
Cc: stable
Signed-off-by: Greg Kroah-Hartman -
There are no functions named sys_device_shutdown or sys_device_suspend
in the kernel.
They should be fixed to sysdev_shutdown and sysdev_suspend respectively.Signed-off-by: Qinghuang Feng
Signed-off-by: Greg Kroah-Hartman
20 Oct, 2008
5 commits
-
This attribute just has a write operation.
[akpm@linux-foundation.org: use S_IWUSR as suggested by Randy]
Signed-off-by: Shaohua Li
Cc: Randy Dunlap
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch adds a function to scan individual or all zones' unevictable
lists and move any pages that have become evictable onto the respective
zone's inactive list, where shrink_inactive_list() will deal with them.Adds sysctl to scan all nodes, and per node attributes to individual
nodes' zones.Kosaki: If evictable page found in unevictable lru when write
/proc/sys/vm/scan_unevictable_pages, print filename and file offset of
these pages.[akpm@linux-foundation.org: fix one CONFIG_MMU=n build error]
[kosaki.motohiro@jp.fujitsu.com: adapt vmscan-unevictable-lru-scan-sysctl.patch to new sysfs API]
Signed-off-by: Lee Schermerhorn
Signed-off-by: Rik van Riel
Signed-off-by: KOSAKI Motohiro
Signed-off-by: KOSAKI Motohiro
Signed-off-by: Hugh Dickins
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add NR_MLOCK zone page state, which provides a (conservative) count of
mlocked pages (actually, the number of mlocked pages moved off the LRU).Reworked by lts to fit in with the modified mlock page support in the
Reclaim Scalability series.[kosaki.motohiro@jp.fujitsu.com: fix incorrect Mlocked field of /proc/meminfo]
[lee.schermerhorn@hp.com: mlocked-pages: add event counting with statistics]
Signed-off-by: Nick Piggin
Signed-off-by: Lee Schermerhorn
Signed-off-by: Rik van Riel
Signed-off-by: KOSAKI Motohiro
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Report unevictable pages per zone and system wide.
Kosaki Motohiro added support for memory controller unevictable
statistics.[riel@redhat.com: fix printk in show_free_areas()]
[akpm@linux-foundation.org: fix units in /proc/vmstats]
Signed-off-by: Lee Schermerhorn
Signed-off-by: Rik van Riel
Signed-off-by: KOSAKI Motohiro
Debugged-by: Hiroshi Shimamoto
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Split the LRU lists in two, one set for pages that are backed by real file
systems ("file") and one for pages that are backed by memory and swap
("anon"). The latter includes tmpfs.The advantage of doing this is that the VM will not have to scan over lots
of anonymous pages (which we generally do not want to swap out), just to
find the page cache pages that it should evict.This patch has the infrastructure and a basic policy to balance how much
we scan the anon lists and how much we scan the file lists. The big
policy changes are in separate patches.[lee.schermerhorn@hp.com: collect lru meminfo statistics from correct offset]
[kosaki.motohiro@jp.fujitsu.com: prevent incorrect oom under split_lru]
[kosaki.motohiro@jp.fujitsu.com: fix pagevec_move_tail() doesn't treat unevictable page]
[hugh@veritas.com: memcg swapbacked pages active]
[hugh@veritas.com: splitlru: BDI_CAP_SWAP_BACKED]
[akpm@linux-foundation.org: fix /proc/vmstat units]
[nishimura@mxp.nes.nec.co.jp: memcg: fix handling of shmem migration]
[kosaki.motohiro@jp.fujitsu.com: adjust Quicklists field of /proc/meminfo]
[kosaki.motohiro@jp.fujitsu.com: fix style issue of get_scan_ratio()]
Signed-off-by: Rik van Riel
Signed-off-by: Lee Schermerhorn
Signed-off-by: KOSAKI Motohiro
Signed-off-by: Hugh Dickins
Signed-off-by: Daisuke Nishimura
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Oct, 2008
14 commits
-
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (46 commits)
UIO: Fix mapping of logical and virtual memory
UIO: add automata sercos3 pci card support
UIO: Change driver name of uio_pdrv
UIO: Add alignment warnings for uio-mem
Driver core: add bus_sort_breadthfirst() function
NET: convert the phy_device file to use bus_find_device_by_name
kobject: Cleanup kobject_rename and !CONFIG_SYSFS
kobject: Fix kobject_rename and !CONFIG_SYSFS
sysfs: Make dir and name args to sysfs_notify() const
platform: add new device registration helper
sysfs: use ilookup5() instead of ilookup5_nowait()
PNP: create device attributes via default device attributes
Driver core: make bus_find_device_by_name() more robust
usb: turn dev_warn+WARN_ON combos into dev_WARN
debug: use dev_WARN() rather than WARN_ON() in device_pm_add()
debug: Introduce a dev_WARN() function
sysfs: fix deadlock
device model: Do a quickcheck for driver binding before doing an expensive check
Driver core: Fix cleanup in device_create_vargs().
Driver core: Clarify device cleanup.
... -
Add resource_type() and IORESOURCE_TYPE_BITS. They make it easier to add
more resource types without having to rewrite tons of code.Signed-off-by: Magnus Damm
Cc: Ben Dooks
Cc: Jean Delvare
Cc: Paul Mundt
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert printks to use dev_printk().
Signed-off-by: Bjorn Helgaas
Cc: David Woodhouse
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Alberto Bertogli
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Use the '%pF' format to get rid of an "#ifdef DEBUG" and make some printks
atomic.This removes the last in-tree uses of print_fn_descriptor_symbol(). I
marked print_fn_descriptor_symbol() deprecated and scheduled it for
removal next year to give time for out-of-tree modules to be updated.parisc's print_fn_descriptor_symbol() is currently broken there (it needs
to dereference the function pointer similar to ia64 and power). This
patch shouldn't make anything worse, but it means we need to fix
dereference_function_descriptor() instead of print_fn_descriptor_symbol()
to get meaningful initcall_debug output.Signed-off-by: Bjorn Helgaas
Cc: Jesse Barnes
Cc: Kyle McMartin
Cc: "Rafael J. Wysocki"
Cc: Kay Sievers
Cc: Greg KH
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The PCI core wants to reorder the devices in the bus list. So move this
functionality out of the pci core and into the driver core so that
anyone else can also do this if needed. This also lets us change how
struct device is attached to drivers in the future without messing with
the PCI core.Acked-by: Jesse Barnes
Signed-off-by: Greg Kroah-Hartman -
When looking at kobject_rename I found two bugs with
that exist when sysfs support is disabled in the kernel.kobject_rename does not change the name on the kobject when
sysfs support is not compiled in.kobject_rename without locking attempts to check the
validity of a rename operation, which the kobject layer
simply does not have the infrastructure to do.This patch documents the previously unstated requirement of
kobject_rename that is the responsibility of the caller to
provide mutual exclusion and to be certain that the new_name
for the kobject is valid.This patch modifies sysfs_rename_dir in !CONFIG_SYSFS case
to call kobject_set_name to actually change the kobject_name.This patch removes the bogus and misleading check in kobject_rename
that attempts to see if a rename is valid. The check is bogus
because we do not have the proper locking. The check is misleading
because it looks like we can and do perform checking at the kobject
level that we don't.Signed-off-by: Eric W. Biederman
Signed-off-by: Greg Kroah-Hartman -
Add a helper that registers simple platform_device w/o resources but with
parent and device data.This is usefull to cleanup platform code from code that registers such
simple devices as leds-gpio, generic-bl, etc.Signed-off-by: Dmitry Baryshkov
Cc: David Brownell
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman -
Use sysfs_streq() in bus_find_device_by_name() so trailing newlines
are ignored (E.G. in bind/unbind).Signed-off-by: Peter Korsgaard
Signed-off-by: Greg Kroah-Hartman -
device_pm_add() has a WARN_ON that is showing relatively high on
kerneloops.org, but unfortunately the WARN_ON is less than useful
in that it doesn't print any information about what device is causing
the issue.This patch fixes this by turning the WARN_ON() into the newly
introduces dev_WARN() which will print information about the
device in question.Signed-off-by: Arjan van de Ven
Signed-off-by: Greg Kroah-Hartman -
This patch adds a quick check for the driverdevice match before
taking the locks and doin gthe expensive checks. Taking the lock hurts
in asynchronous boot context where the device lock gets hit; one of the
init functions takes the lock and goes to do an expensive hardware init;
the other init functions walk the same PCI list and get stuck on the
lock as a result.For the common case, we can know there's no chance whatsoever of a match
if the device isn't in the drivers ID table... so this patch does that
check as a best-effort-avoid-the-lock approach.Bootcharts for before and after can be seen at
http://www.fenrus.org/before.svg
http://www.fenrus.org/after.svgNote the long time "agp_ali_init" takes in the first graph; my laptop
doesn't even have an ALI chip in it! (the bootgraphs look a bit
dissimilar, but that's the point, the first one has a bunch of arbitrary
delays in it that cause it to look very different)This reduces my kernel boot time by about 20%
Signed-off-by: Arjan van de Ven
Cc: Alan Stern
Signed-off-by: Greg Kroah-Hartman -
If device_register() in device_create_vargs() fails, the device
must be cleaned up with put_device() (which is also fine on NULL)
instead of kfree().Signed-off-by: Cornelia Huck
Cc: stable
Signed-off-by: Greg Kroah-Hartman -
Make the comments on how to use device_initialize(), device_add()
and device_register() a bit clearer - in particular, explicitly
note that put_device() must be used once we tried to add the device
to the hierarchy.Signed-off-by: Cornelia Huck
Cc: stable
Signed-off-by: Greg Kroah-Hartman -
This patch makes the needlessly global struct platform_pm_ops static.
Signed-off-by: Adrian Bunk
Signed-off-by: Greg Kroah-Hartman
09 Oct, 2008
1 commit
-
Iterating over entries using callback usually isn't too fun especially
when the entry being iterated over can't be manipulated freely. This
patch converts class->p->class_devices to klist and implements class
device iterator so that the users can freely build their own control
structure. The users are also free to call back into class code
without worrying about locking.class_for_each_device() and class_find_device() are converted to use
the new iterators, so their users don't have to worry about locking
anymore either.Note: This depends on klist-dont-iterate-over-deleted-entries patch
because class_intf->add/remove_dev() depends on proper synchronization
with device removal.Signed-off-by: Tejun Heo
Cc: Greg Kroah-Hartman
Cc: Jens Axboe
Signed-off-by: Jens Axboe
22 Aug, 2008
6 commits
-
PM: Remove WARN_ON from device_pm_add
Fix message in device_pm_add() saying that the device will not be
added to dpm_list, although in fact the device is going to be added
to the list regardless of the ordering violation.Remove the WARN_ON(true) triggered in that situation, because it is
hit by USB very often and spams the users' logs.This patch fixes bug #11263
Signed-off-by: Rafael J. Wysocki
Signed-off-by: Greg Kroah-Hartman -
This gives us a way to handle both the bus_id and init_name values being
used for a while during the transition period.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
This patch (as1124) fixes a couple of bugs in the PM core. The new
dev->power.status field should be initialized regardless of whether
CONFIG_PM_SLEEP is enabled, and similarly dpm_sysfs_add() should be
called whenever CONFIG_PM is enabled.The patch separates out the call to dpm_sysfs_add() from the call to
device_pm_add(). As a result device_pm_add() can no longer return an
error, so its return type is changed to void.Signed-off-by: Alan Stern
Tested-by: Romit Dasgupta
Acked-by: Rafael J. Wysocki
Signed-off-by: Greg Kroah-Hartman -
Anti-oops medicine for the class iterators ... the oops was
observed when a class was implicitly referenced before it
was initialized.[Modified by Greg to spit a warning back so someone knows to fix their code]
Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman -
Add const markings to dev_name and dev_driver_string to make it clear that
dev_printk doesn't modify dev. This is a prerequisite to adding more
const markings to other functions make it clearer, which functions can
modify dev and which can't.Signed-off-by: Jean Delvare
Cc: Kay Sievers
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman -
Signed-off-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
02 Aug, 2008
1 commit
-
…/git/tip/linux-2.6-tip
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
locking: fix mutex @key parameter kernel-doc notation
29 Jul, 2008
1 commit
-
Fix @key parameter to mutex_init() and one of its callers.
Warning(linux-2.6.26-git11//drivers/base/class.c:210): No description found for parameter 'key'
Signed-off-by: Randy Dunlap
Acked-by: Greg Kroah-Hartman
Signed-off-by: Ingo Molnar
28 Jul, 2008
1 commit
-
Noticed because of this warning:
drivers/base/memory.c:279: warning: initialization from incompatible pointer type
Signed-off-by: Stephen Rothwell
Signed-off-by: Linus Torvalds
27 Jul, 2008
2 commits
-
Use WARN() instead of a printk+WARN_ON() pair; this way the message
becomes part of the warning section for better reporting/collection.Signed-off-by: Arjan van de Ven
Cc: Greg KH
Cc: Kay Sievers
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
dma_alloc_coherent() on x86 currently takes a passed in NULL device
pointer to mean that it should allocate an ISA compatible (24-bit) buffer
which is a bit of a hack.The ALSA ISA drivers are the main consumers of this but have a struct
device in fact readily available.For the legacy drivers, this sets the device dma_mask in preparation for
using the actual device with the DMA API so as to eventually not need the
NULL hack in dma_alloc_coherent().This does not fix a current bug -- 2.6.26-rc1 stumbled over the NULL hack
in dma_alloc_coherent() but this has already been fixed in commit
4a367f3a9dbf2e7ffcee4702203479809236ee6e by Takashi Iwai.Signed-off-by: Rene Herman
Cc: Bjorn Helgaas
Acked-by: Takashi Iwai
Cc: Alan Cox
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
26 Jul, 2008
1 commit
-
Signed-off-by: Akinobu Mita
Cc: Greg Kroah-Hartman
Cc: Markus Rechberger
Cc: Kay Sievers
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
25 Jul, 2008
1 commit
-
Memory may be hot-removed on a per-memory-block basis, particularly on
POWER where the SPARSEMEM section size often matches the memory-block
size. A user-level agent must be able to identify which sections of
memory are likely to be removable before attempting the potentially
expensive operation. This patch adds a file called "removable" to the
memory directory in sysfs to help such an agent. In this patch, a memory
block is considered removable if;o It contains only MOVABLE pageblocks
o It contains only pageblocks with free pages regardless of pageblock typeOn the other hand, a memory block starting with a PageReserved() page will
never be considered removable. Without this patch, the user-agent is
forced to choose a memory block to remove randomly.Sample output of the sysfs files:
./memory/memory0/removable: 0
./memory/memory1/removable: 0
./memory/memory2/removable: 0
./memory/memory3/removable: 0
./memory/memory4/removable: 0
./memory/memory5/removable: 0
./memory/memory6/removable: 0
./memory/memory7/removable: 1
./memory/memory8/removable: 0
./memory/memory9/removable: 0
./memory/memory10/removable: 0
./memory/memory11/removable: 0
./memory/memory12/removable: 0
./memory/memory13/removable: 0
./memory/memory14/removable: 0
./memory/memory15/removable: 0
./memory/memory16/removable: 0
./memory/memory17/removable: 1
./memory/memory18/removable: 1
./memory/memory19/removable: 1
./memory/memory20/removable: 1
./memory/memory21/removable: 1
./memory/memory22/removable: 1Signed-off-by: Badari Pulavarty
Signed-off-by: Mel Gorman
Acked-by: KAMEZAWA Hiroyuki
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
24 Jul, 2008
1 commit
-
* 'cpus4096-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (31 commits)
NR_CPUS: Replace NR_CPUS in speedstep-centrino.c
cpumask: Provide a generic set of CPUMASK_ALLOC macros, FIXUP
NR_CPUS: Replace NR_CPUS in cpufreq userspace routines
NR_CPUS: Replace per_cpu(..., smp_processor_id()) with __get_cpu_var
NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genapic_flat_64.c
NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genx2apic_uv_x.c
NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/proc.c
NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/mcheck/mce_64.c
cpumask: Optimize cpumask_of_cpu in lib/smp_processor_id.c, fix
cpumask: Use optimized CPUMASK_ALLOC macros in the centrino_target
cpumask: Provide a generic set of CPUMASK_ALLOC macros
cpumask: Optimize cpumask_of_cpu in lib/smp_processor_id.c
cpumask: Optimize cpumask_of_cpu in kernel/time/tick-common.c
cpumask: Optimize cpumask_of_cpu in drivers/misc/sgi-xp/xpc_main.c
cpumask: Optimize cpumask_of_cpu in arch/x86/kernel/ldt.c
cpumask: Optimize cpumask_of_cpu in arch/x86/kernel/io_apic_64.c
cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr
Revert "cpumask: introduce new APIs"
cpumask: make for_each_cpu_mask a bit smaller
net: Pass reference to cpumask variable in net/sunrpc/svc.c
...Fix up trivial conflicts in drivers/cpufreq/cpufreq.c manually
22 Jul, 2008
2 commits
-
This adds a new sysdev_ext_attribute that stores a pointer to the variable
it manages and some utility functions/macro to easily use them.Previously all users wrote custom macros to generate show/store
functions for each variable, with this it is possible to avoid
that in many cases.Signed-off-by: Andi Kleen
Signed-off-by: Greg Kroah-Hartman -
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, avr32Signed-off-by: Andi Kleen
Signed-off-by: Greg Kroah-Hartman