01 Oct, 2006

40 commits

  • Powerpc already has a directed yield for CONFIG_PREEMPT="n". To make it
    work with CONFIG_PREEMPT="y" as well the _raw_{spin,read,write}_relax
    primitives need to be defined to call __spin_yield() for spinlocks and
    __rw_yield() for rw-locks.

    Acked-by: Paul Mackerras
    Signed-off-by: Martin Schwidefsky
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Schwidefsky
     
  • On systems running with virtual cpus there is optimization potential in
    regard to spinlocks and rw-locks. If the virtual cpu that has taken a lock
    is known to a cpu that wants to acquire the same lock it is beneficial to
    yield the timeslice of the virtual cpu in favour of the cpu that has the
    lock (directed yield).

    With CONFIG_PREEMPT="n" this can be implemented by the architecture without
    common code changes. Powerpc already does this.

    With CONFIG_PREEMPT="y" the lock loops are coded with _raw_spin_trylock,
    _raw_read_trylock and _raw_write_trylock in kernel/spinlock.c. If the lock
    could not be taken cpu_relax is called. A directed yield is not possible
    because cpu_relax doesn't know anything about the lock. To be able to
    yield the lock in favour of the current lock holder variants of cpu_relax
    for spinlocks and rw-locks are needed. The new _raw_spin_relax,
    _raw_read_relax and _raw_write_relax primitives differ from cpu_relax
    insofar that they have an argument: a pointer to the lock structure.

    Signed-off-by: Martin Schwidefsky
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Haavard Skinnemoen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Schwidefsky
     
  • I was playing with LED triggers when I noticed that changing from heartbeat
    (or ide-disk) to "none" at the right moment would leave the LED stuck on.
    This is easy to reproduce by doing "find / >/dev/null" with the ide-disk
    trigger enabled and then switching to "none".

    Here is a patch that fixes the problem by explicitly turning the LED off
    after removing the existing trigger.

    Signed-off-by: Paul Collins
    Acked-by: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Collins
     
  • Signed-off-by: Jim Cromie
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jim Cromie
     
  • Cc: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Convert various spin_lock_irqsave() callers to correctly use `unsigned long'.

    Signed-off-by: Alexey Dobriyan
    Cc: Miles Bader
    Cc: "Luck, Tony"
    Acked-by: Kyle McMartin
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • VFS: Use SEEK_{SET,CUR,END} instead of hardcoded values

    Signed-off-by: Josef 'Jeff' Sipek
    Acked-by: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josef 'Jeff' Sipek
     
  • EICON ISDN: Removed unused definitions for OS_SEEK_*

    Signed-off-by: Josef 'Jeff' Sipek
    Cc: Karsten Keil
    Acked-by: Armin Schindler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josef 'Jeff' Sipek
     
  • MBCS: Use SEEK_{SET,CUR,END} instead of hardcoded values

    Signed-off-by: Josef 'Jeff' Sipek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josef 'Jeff' Sipek
     
  • If we can clean up these remainders we can finally delete pci_find_*

    Signed-off-by: Alan Cox
    Cc: Greg KH
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Mirrors the drivers/ata version, hold a reference to the host bridge while we
    are doing setup.

    Signed-off-by: Alan Cox
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • As we don't support hotplug we end up leaking an isa_dev reference which if
    unload was ever added we would drop at the end of unloading. This is fine
    because we do genuinely need the isa_dev pointer until unload.

    Signed-off-by: Alan Cox
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Simple conversion

    Signed-off-by: Alan Cox
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Fairly trivial change in this case

    Signed-off-by: Alan Cox
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • pci_find_device is not refcounting and should be getting killed off.

    Signed-off-by: Alan Cox
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • The driver for /proc/config.gz consumes rather a lot of memory and it is in
    fact possible to build it as a module.

    In some ways this is a bit risky, because the .config which is used for
    compiling kernel/configs.c isn't necessarily the same as the .config which was
    used to build vmlinux.

    But OTOH the potential memory savings are decent, and it'd be fairly dumb to
    build your configs.o with a different .config.

    Signed-off-by: Andrew Morton
    Cc: "Randy.Dunlap"
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ross Biro
     
  • Fix up kernel/sys.c to be consistent with CodingStyle and the rest of the
    file.

    Signed-off-by: Cal Peake
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cal Peake
     
  • Stop some other people peering into the baud bits on their own and make
    them use the tty_get_baud_rate() helper as a preperation for the move to
    the new termios. Corrected dependancy previous one had on new termios
    structs

    Signed-off-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Add support for logical volumes >2TB. All SAS/SATA controllers support
    large volumes.

    Signed-off-by: Mike Miller
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Miller (OS Dev)
     
  • * fs/open.c is getting bit crowdy
    * preparation to lutimes(2)

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • One of idiomatic ways to duplicate a region of memory is

    dst = kmalloc(len, GFP_KERNEL);
    if (!dst)
    return -ENOMEM;
    memcpy(dst, src, len);

    which is neat code except a programmer needs to write size twice. Which
    sometimes leads to mistakes. If len passed to kmalloc is smaller that len
    passed to memcpy, it's straight overwrite-beyond-end. If len passed to
    memcpy is smaller than len passed to kmalloc, it's either a) legit
    behaviour ;-), or b) cloned buffer will contain garbage in second half.

    Slight trolling of commit lists shows several duplications bugs
    done exactly because of diverged lenghts:

    Linux:
    [CRYPTO]: Fix memcpy/memset args.
    [PATCH] memcpy/memset fixes
    OpenBSD:
    kerberosV/src/lib/asn1: der_copy.c:1.4

    If programmer is given only one place to play with lengths, I believe, such
    mistakes could be avoided.

    With kmemdup, the snippet above will be rewritten as:

    dst = kmemdup(src, len, GFP_KERNEL);
    if (!dst)
    return -ENOMEM;

    This also leads to smaller code (kzalloc effect). Quick grep shows
    200+ places where kmemdup() can be used.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Add maximum latency tracking to the ALSA subsystem for PCM playback. In
    ALSA, the playback application controls the buffer size and thus indirectly
    the period of latency that it can deal with. This patch uses 75% of the
    total available latency as threshold to announce to the latency subsystem;
    While 75% is a crude heuristic it's a quite reasonable one; the remaining
    25% can be used for all driver processing for the next samples which is
    also proportional to the size of the buffer.

    With ogg123 a latency setting of about 4msec was seen (at 44Khz), while
    with the "play" command a much longer maximum tolerable latency was seen.
    Other, more multimedia oriented players as well as games, will have a lot
    smaller buffers to allow better synchronization and those will actually get
    into the latency domains where there is impact on the power management
    rules.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     
  • Add infrastructure to track "maximum allowable latency" for power saving
    policies.

    The reason for adding this infrastructure is that power management in the
    idle loop needs to make a tradeoff between latency and power savings
    (deeper power save modes have a longer latency to running code again). The
    code that today makes this tradeoff just does a rather simple algorithm;
    however this is not good enough: There are devices and use cases where a
    lower latency is required than that the higher power saving states provide.
    An example would be audio playback, but another example is the ipw2100
    wireless driver that right now has a very direct and ugly acpi hook to
    disable some higher power states randomly when it gets certain types of
    error.

    The proposed solution is to have an interface where drivers can

    * announce the maximum latency (in microseconds) that they can deal with
    * modify this latency
    * give up their constraint

    and a function where the code that decides on power saving strategy can
    query the current global desired maximum.

    This patch has a user of each side: on the consumer side, ACPI is patched
    to use this, on the producer side the ipw2100 driver is patched.

    A generic maximum latency is also registered of 2 timer ticks (more and you
    lose accurate time tracking after all).

    While the existing users of the patch are x86 specific, the infrastructure
    is not. I'd like to ask the arch maintainers of other architectures if the
    infrastructure is generic enough for their use (assuming the architecture
    has such a tradeoff as concept at all), and the sound/multimedia driver
    owners to look at the driver facing API to see if this is something they
    can use.

    [akpm@osdl.org: cleanups]
    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Acked-by: Jesse Barnes
    Cc: "Brown, Len"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • Conversion of booleans to: generic-boolean.patch (2006-08-23)

    Signed-off-by: Richard Knutsson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Knutsson
     
  • Conversion of booleans to: generic-boolean.patch (2006-08-23)

    Signed-off-by: Richard Knutsson
    Cc: Dave Kleikamp
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Knutsson
     
  • Conversion of booleans to: generic-boolean.patch (2006-08-23)

    Signed-off-by: Richard Knutsson
    Signed-off-by: Anton Altaparmakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Knutsson
     
  • This patch defines:
    * a generic boolean-type, named 'bool'
    * aliases to 0 and 1, named 'false' and 'true'

    Removing colliding definitions of 'bool', 'false' and 'true'.

    Signed-off-by: Richard Knutsson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Knutsson
     
  • - Add soothing comment

    - uninline thrice-called function

    Cc: OGAWA Hirofumi
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • The api for hot-add memory already has a construct for finding nodes based on
    an address, memory_add_physaddr_to_nid. This patch allows the fucntion to do
    something besides return 0. It uses the nodes_add infomation to lookup to
    node info for a hot add event.

    Signed-off-by: Keith Mannthey
    Cc: KAMEZAWA Hiroyuki
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keith Mannthey
     
  • Migate CONFIG_MEMORY_HOTPLUG to CONFIG_MEMORY_HOTPLUG_SPARSE where needed.

    Signed-off-by: Keith Mannthey
    Cc: KAMEZAWA Hiroyuki
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keith Mannthey
     
  • In cases where the acpi memory-add event does not containe the pxm (node)
    infomation allow the driver to look up node info based on the address. The
    acpi_get_node call returns -1 if it can't decode the pxm info, this causes
    add_memory to panic. acpi_get_node would have to decode the resource from the
    handle (a lenghty proposition). This seems to be the cleanist point to
    interject the hook.

    [kamezawa.hiroyu@jp.fujitsu.com: build fixes]
    [y-goto@jp.fujitsu.com: build fixes]
    Signed-off-by: Keith Mannthey
    Cc: KAMEZAWA Hiroyuki
    Cc: Andi Kleen
    Signed-off-by: KAMEZAWA Hiroyuki
    Signed-off-by: Yasunori Goto
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keith Mannthey
     
  • The api for hot-add memory already has a construct for finding nodes based on
    an address, memory_add_physaddr_to_nid. This patch allows the fucntion to do
    something besides return 0. It uses the nodes_add infomation to lookup to
    node info for a hot add event.

    Signed-off-by: Keith Mannthey
    Cc: KAMEZAWA Hiroyuki
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keith Mannthey
     
  • Enable x86_64 srat.c to share code between both reserve and sparsemem based
    add memory paths. Both paths need the hot-add area node locality infomration
    (nodes_add). This code refactors the code path to allow this.

    Signed-off-by: Keith Mannthey
    Cc: KAMEZAWA Hiroyuki
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keith Mannthey
     
  • Create Kconfig namespace for MEMORY_HOTPLUG_RESERVE and MEMORY_HOTPLUG_SPARSE.
    This is needed to create a disticiton between the 2 paths. Selecting the
    high level opiton of MEMORY_HOTPLUG will get you MEMORY_HOTPLUG_SPARSE if you
    have sparsemem enabled or MEMORY_HOTPLUG_RESERVE if you are x86_64 with
    discontig and ACPI numa support.

    Signed-off-by: Keith Mannthey
    Cc: KAMEZAWA Hiroyuki
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keith Mannthey
     
  • Fix up externs in memory_hotplug.c. Cleanup.

    Signed-off-by: Keith Mannthey
    Cc: KAMEZAWA Hiroyuki
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keith Mannthey
     
  • This fixes two things

    Firstly someone mistakenly used "errata" for the singular. This causes
    Dave Woodhouse to emit diagnostics whenever the string is read, and so
    should be fixed.

    Secondly the AMD AGP tunnel has an erratum which causes hangs if you try
    and do direct PCI to AGP transfers in some cases. We have a flag for
    PCI/PCI failures but we need a different flag for this really as in this
    case we don't want to stop PCI/PCI transfers using things like IOAT and the
    new RAID offload work.

    I'll post some updates to make proper use of the PCIAGP flag in the
    media/video drivers to Mauro.

    Signed-off-by: Alan Cox
    Cc: David Woodhouse
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Don't try and give NULL to fput() in the error handling in do_mmap_pgoff()
    as it'll cause an oops.

    Signed-off-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gavin Lambert
     
  • These two BUG_ON()s are redundant and undesired: we're checking for this
    condition further on in the function, only better.

    Cc: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • The ->flags in struct request was split into two variables, in a recent
    changeset. The merge of this change forgot to update SCSI's libsas,
    probably because libsas was a very recent merge.

    Signed-off-by: Jeff Garzik
    Signed-off-by: Linus Torvalds

    Jeff Garzik