02 Oct, 2009

17 commits

  • In charge/uncharge/reclaim path, usage_in_excess is calculated repeatedly
    and it takes res_counter's spin_lock every time.

    This patch removes unnecessary calls for res_count_soft_limit_excess.

    Reviewed-by: Daisuke Nishimura
    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Paul Menage
    Cc: Li Zefan
    Cc: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • This patch clean up/fixes for memcg's uncharge soft limit path.

    Problems:
    Now, res_counter_charge()/uncharge() handles softlimit information at
    charge/uncharge and softlimit-check is done when event counter per memcg
    goes over limit. Now, event counter per memcg is updated only when
    memory usage is over soft limit. Here, considering hierarchical memcg
    management, ancesotors should be taken care of.

    Now, ancerstors(hierarchy) are handled in charge() but not in uncharge().
    This is not good.

    Prolems:
    1. memcg's event counter incremented only when softlimit hits. That's bad.
    It makes event counter hard to be reused for other purpose.

    2. At uncharge, only the lowest level rescounter is handled. This is bug.
    Because ancesotor's event counter is not incremented, children should
    take care of them.

    3. res_counter_uncharge()'s 3rd argument is NULL in most case.
    ops under res_counter->lock should be small. No "if" sentense is better.

    Fixes:
    * Removed soft_limit_xx poitner and checks in charge and uncharge.
    Do-check-only-when-necessary scheme works enough well without them.

    * make event-counter of memcg incremented at every charge/uncharge.
    (per-cpu area will be accessed soon anyway)

    * All ancestors are checked at soft-limit-check. This is necessary because
    ancesotor's event counter may never be modified. Then, they should be
    checked at the same time.

    Reviewed-by: Daisuke Nishimura
    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Paul Menage
    Cc: Li Zefan
    Cc: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • __css_put() doesn't check a bug as refcnt goes to minus.
    I think it should be caught. This patch adds a check for it.

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Paul Menage
    Cc: Li Zefan
    Cc: Balbir Singh
    Cc: Daisuke Nishimura
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • __mem_cgroup_largest_soft_limit_node() returns a mem_cgroup_per_zone "mz"
    with incremnted mz->mem->css's refcnt. Then, the caller of this function
    has to call css_put(mz->mem->css).

    But, mz can be !NULL even if "not found" i.e. without css_get(). By
    this, css->refcnt will go down to minus.

    This may cause various things...one of results will be
    initite-loop in css_tryget() as this.

    INFO: RCU detected CPU 0 stall (t=10000 jiffies)
    sending NMI to all CPUs:
    NMI backtrace for cpu 0
    CPU 0:

    <> [] trace_hardirqs_off+0xd/0x10
    [] flat_send_IPI_mask+0x90/0xb0
    [] flat_send_IPI_all+0x69/0x70
    [] arch_trigger_all_cpu_backtrace+0x62/0xa0
    [] __rcu_pending+0x7e/0x370
    [] rcu_check_callbacks+0x47/0x130
    [] update_process_times+0x46/0x70
    [] tick_sched_timer+0x60/0x160
    [] ? tick_sched_timer+0x0/0x160
    [] __run_hrtimer+0xba/0x150
    [] hrtimer_interrupt+0xd5/0x1b0
    [] ? trace_hardirqs_off_thunk+0x3a/0x3c
    [] smp_apic_timer_interrupt+0x6d/0x9b
    [] apic_timer_interrupt+0x13/0x20
    [] ? mem_cgroup_walk_tree+0x156/0x180
    [] ? mem_cgroup_walk_tree+0x73/0x180
    [] ? mem_cgroup_walk_tree+0x32/0x180
    [] ? mem_cgroup_get_local_stat+0x0/0x110
    [] ? mem_control_stat_show+0x14b/0x330
    [] ? cgroup_seqfile_show+0x3d/0x60

    Above shows CPU0 caught in css_tryget()'s inifinite loop because
    of bad refcnt.

    This is a fix to set mz=NULL at the top of retry path.

    Signed-off-by: KAMEZAWA Hiroyuki
    Acked-by: Paul Menage
    Cc: Li Zefan
    Cc: Balbir Singh
    Cc: Daisuke Nishimura
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • Some configurations of the Timberdale FPGA has the uartlite
    included.

    Signed-off-by: Richard Röjfors
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Röjfors
     
  • This patch size comment is like so last millenium. Update it to modern
    times.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Some manufacturers provide vendor information in non-vendor specific CIS
    tuples. For example, Broadcom uses an Extended Function tuple to provide
    the MAC address on some of their network cards, as in the case of the
    Nintendo Wii WLAN daughter card.

    This patch allows passing whitelisted FUNCE tuples unknown to the SDIO
    core to a matching SDIO driver instead of rejecting them and failing.

    Signed-off-by: Albert Herranz
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Albert Herranz
     
  • The page_address_in_vma() is not only used in unuse_vma().

    Signed-off-by: Huang Shijie
    Acked-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Shijie
     
  • Just like ip_fast_csum, the assembly snippet in csum_ipv6_magic needs a
    memory clobber, as it is only passed the address of the buffer, not a
    memory reference to the buffer itself.

    This caused failures in Hurd's pfinetv4 when we tried to compile it with
    gcc-4.3 (bogus checksums).

    Signed-off-by: Samuel Thibault
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Acked-by: "David S. Miller"
    Cc: Andi Kleen
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samuel Thibault
     
  • Fix some build failures when using gcc-4.x for MN10300.

    Firstly, __get_user() fails to build because the pointer points to a const and
    __gu_val ends up being read-only:

    In file included from include/linux/mempolicy.h:62,
    from init/main.c:50:
    include/linux/pagemap.h: In function 'fault_in_pages_readable':
    include/linux/pagemap.h:394: error: read-only variable '__gu_val' used as 'asm' output
    include/linux/pagemap.h:394: error: read-only variable '__gu_val' used as 'asm' output
    include/linux/pagemap.h:394: error: read-only variable '__gu_val' used as 'asm' output
    include/linux/pagemap.h:400: error: read-only variable '__gu_val' used as 'asm' output
    include/linux/pagemap.h:400: error: read-only variable '__gu_val' used as 'asm' output
    include/linux/pagemap.h:400: error: read-only variable '__gu_val' used as 'asm' output
    make[1]: *** [init/main.o] Error 1

    Secondly, gcc-4 doesn't allow casts of lvalues:

    UPD include/linux/compile.h
    arch/mn10300/kernel/rtc.c: In function 'calibrate_clock':
    arch/mn10300/kernel/rtc.c:170: error: lvalue required as left operand of assignment
    arch/mn10300/kernel/rtc.c:172: error: lvalue required as left operand of assignment
    make[1]: *** [arch/mn10300/kernel/rtc.o] Error 1

    These are seen with gcc 4.2.1.

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

    Mark Salter
     
  • Signed-off-by: Joe Perches
    Acked-by: Marek Vasut
    Acked-by: Tomas Cech
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Stanse found (again) a BKL imbalance in vt_ioctl.

    It's easily triggerable by ioctl(dev_tty_fd, VT_SETACTIVATE, NULL);

    Introduced by

    commit d3b5cffcf84a8bdc7073dce4745d67c72629af85 Author: Alan Cox
    Date: Sat Sep 19 13:13:26 2009 -0700

    vt: add an activate and lock

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

    Jiri Slaby
     
  • Revert 45d80eea87c9f8292d2d33173d6866c0ec57238a ("m68k: convert to
    asm-generic/hardirq.h") - it fails to compile due to an inclusion tangle:

    In file included from include/linux/irq.h:12,
    from include/asm-generic/hardirq.h:6,
    from /usr/src/devel/arch/m68k/include/asm/hardirq_mm.h:6,
    from /usr/src/devel/arch/m68k/include/asm/hardirq.h:4,
    from include/linux/hardirq.h:10,
    from /usr/src/devel/arch/m68k/include/asm/system_mm.h:69,
    from /usr/src/devel/arch/m68k/include/asm/system.h:4,
    from include/linux/list.h:7,
    from include/linux/preempt.h:11,
    from include/linux/spinlock.h:50,
    from include/linux/seqlock.h:29,
    from include/linux/time.h:8,
    from include/linux/timex.h:56,
    from include/linux/sched.h:56,
    from arch/m68k/kernel/asm-offsets.c:14:
    include/linux/smp.h:17: error: field 'list' has incomplete type

    Cc: Christoph Hellwig
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • The asm-generic/gpio.h header uses the might_sleep() macro but doesn't
    include the header for it, so any source code that might include
    linux/gpio.h before linux/kernel.h can easily lead to a build failure.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • [akpm@linux-foundation.org: fix KVM]
    Signed-off-by: Alexey Dobriyan
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • drivers/input/input.c:1277: warning: 'input_dev_reset' defined but not used

    Acked-by: Dmitry Torokhov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Starting from commit 4a4962263f07d14660849ec134ee42b63e95ea9a "reduce
    symbol table for loaded modules (v2)", the kernel/module.c build is broken
    with CONFIG_KALLSYMS disabled.

    CC kernel/module.o
    kernel/module.c:1995: warning: type defaults to 'int' in declaration of 'Elf_Hdr'
    kernel/module.c:1995: error: expected ';', ',' or ')' before '*' token
    kernel/module.c: In function 'load_module':
    kernel/module.c:2203: error: 'strmap' undeclared (first use in this function)
    kernel/module.c:2203: error: (Each undeclared identifier is reported only once
    kernel/module.c:2203: error: for each function it appears in.)
    kernel/module.c:2239: error: 'symoffs' undeclared (first use in this function)
    kernel/module.c:2239: error: implicit declaration of function 'layout_symtab'
    kernel/module.c:2240: error: 'stroffs' undeclared (first use in this function)
    make[1]: *** [kernel/module.o] Error 1
    make: *** [kernel/module.o] Error 2

    There are three different issues:

    - layout_symtab() takes a const Elf_Ehdr

    - layout_symtab() needs to return a value

    - symoffs/stroffs/strmap are referenced by the load_module() code
    despite being ifdefed out, which seems unnecessary given the noop
    behaviour of layout_symtab()/add_kallsyms() in the case of
    CONFIG_KALLSYMS=n.

    Signed-off-by: Paul Mundt
    Acked-by: Jan Beulich
    Acked-by: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Mundt
     

01 Oct, 2009

23 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
    ax25: Fix possible oops in ax25_make_new
    net: restore tx timestamping for accelerated vlans
    Phonet: fix mutex imbalance
    sit: fix off-by-one in ipip6_tunnel_get_prl
    net: Fix sock_wfree() race
    net: Make setsockopt() optlen be unsigned.

    Linus Torvalds
     
  • In ax25_make_new, if kmemdup of digipeat returns an error, there would
    be an oops in sk_free while calling sk_destruct, because sk_protinfo
    is NULL at the moment; move sk->sk_destruct initialization after this.

    BTW of reported-by: Bernard Pidoux F6BVP

    Signed-off-by: Jarek Poplawski
    Signed-off-by: David S. Miller

    Jarek Poplawski
     
  • Since commit 9b22ea560957de1484e6b3e8538f7eef202e3596
    ( net: fix packet socket delivery in rx irq handler )

    We lost rx timestamping of packets received on accelerated vlans.

    Effect is that tcpdump on real dev can show strange timings, since it gets rx timestamps
    too late (ie at skb dequeueing time, not at skb queueing time)

    14:47:26.986871 IP 192.168.20.110 > 192.168.20.141: icmp 64: echo request seq 1
    14:47:26.986786 IP 192.168.20.141 > 192.168.20.110: icmp 64: echo reply seq 1

    14:47:27.986888 IP 192.168.20.110 > 192.168.20.141: icmp 64: echo request seq 2
    14:47:27.986781 IP 192.168.20.141 > 192.168.20.110: icmp 64: echo reply seq 2

    14:47:28.986896 IP 192.168.20.110 > 192.168.20.141: icmp 64: echo request seq 3
    14:47:28.986780 IP 192.168.20.141 > 192.168.20.110: icmp 64: echo reply seq 3

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • From: Rémi Denis-Courmont

    port_mutex was unlocked twice.

    Signed-off-by: Rémi Denis-Courmont
    Signed-off-by: David S. Miller

    Rémi Denis-Courmont
     
  • When requesting all prl entries (kprl.addr == INADDR_ANY) and there are
    more prl entries than there is space passed from userspace, the existing
    code would always copy cmax+1 entries, which is more than can be handled.

    This patch makes the kernel copy only exactly cmax entries.

    Signed-off-by: Sascha Hlusiak
    Acked-By: Fred L. Templin
    Signed-off-by: David S. Miller

    Sascha Hlusiak
     
  • Commit 2b85a34e911bf483c27cfdd124aeb1605145dc80
    (net: No more expensive sock_hold()/sock_put() on each tx)
    opens a window in sock_wfree() where another cpu
    might free the socket we are working on.

    A fix is to call sk->sk_write_space(sk) while still
    holding a reference on sk.

    Reported-by: Jike Song
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • This provides safety against negative optlen at the type
    level instead of depending upon (sometimes non-trivial)
    checks against this sprinkled all over the the place, in
    each and every implementation.

    Based upon work done by Arjan van de Ven and feedback
    from Linus Torvalds.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • …l/git/tip/linux-2.6-tip

    * 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    sched_clock: Fix atomicity/continuity bug by using cmpxchg64()
    x86: Provide an alternative() based cmpxchg64()

    Linus Torvalds
     
  • Commit def0a9b2573 (sched_clock: Make it NMI safe) assumed
    cmpxchg() of 64bit values was available on X86_32.

    That is not so - and causes some subtle scheduler misbehavior due
    to incorrect timestamps off to up by ~4 seconds.

    Two symptoms are known right now:

    - interactivity problems seen by Arjan: up to 600 msecs
    latencies instead of the expected 20-40 msecs. These
    latencies are very visible on the desktop.

    - incorrect CPU stats: occasionally too high percentages in 'top',
    and crazy CPU usage stats.

    Reported-by: Martin Schwidefsky
    Signed-off-by: Eric Dumazet
    Signed-off-by: Arjan van de Ven
    Acked-by: Linus Torvalds
    Cc: John Stultz
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Eric Dumazet
     
  • cmpxchg64() today generates, to quote Linus, "barf bag" code.

    cmpxchg64() is about to get used in the scheduler to fix a bug there,
    but it's a prerequisite that cmpxchg64() first be made non-sucking.

    This patch turns cmpxchg64() into an efficient implementation that
    uses the alternative() mechanism to just use the raw instruction on
    all modern systems.

    Note: the fallback is NOT smp safe, just like the current fallback
    is not SMP safe. (Interested parties with i486 based SMP systems
    are welcome to submit fix patches for that.)

    Signed-off-by: Arjan van de Ven
    Acked-by: Linus Torvalds
    [ fixed asm constraint bug ]
    Fixed-by: Eric Dumazet
    Cc: Martin Schwidefsky
    Cc: John Stultz
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arjan van de Ven
     
  • * 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
    MIPS: Avoid spurious make includecheck message
    MIPS: VPE: Get rid of BKL.
    MIPS: VPE: Fix build after the credential changes a while ago.
    MIPS: Excite: Get rid of BKL.
    MIPS: Sibyte: Get rid of BKL.
    MIPS: BCM63xx: Add PCMCIA & Cardbus support.
    MIPS: MSP71xx: request_irq() failure ignored in msp_pcibios_config_access()
    MIPS: Decrease size of au1xxx_dbdma_pm_regs[][]
    MIPS: SMP: Inline arch_send_call_function_{single_ipi,ipi_mask}
    MIPS: SMP: Fix build.
    MIPS: MIPSxx SC: Avoid destructive invalidation on partial L2 cachelines.
    MIPS: Sibyte: Fix compilation error.
    MIPS: BCM1480: Re-apply patch lost due to bad resolution of merge conflict.
    MIPS: BCM63xx: Add serial driver for bcm63xx integrated UART.
    MIPS: Loongson2: Fix typo "enalbe" -> "enable"
    MIPS: SMTC: Remove duplicate structure field initialization
    MIPS: Remove duplicated #include
    MIPS: BCM63xx: Remove duplicated #include

    Linus Torvalds
     
  • arch/mips/include/asm/unaligned.h: linux/unaligned/generic.h is included more than once.

    Entirely legitimate but just noise.

    Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • It's not obvious what good it was supposed to do here anyway.

    Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • Signed-off-by: Maxime Bizon
    Reviewed-by: Wolfram Sang
    Signed-off-by: Ralf Baechle

    Maxime Bizon
     
  • Produce an error if request_irq() fails.

    Signed-off-by: Roel Kluin
    Cc: "Ithamar R. Adema"
    Signed-off-by: Andrew Morton
    Signed-off-by: Ralf Baechle

    Roel Kluin
     
  • There are 16 individual channels (NUM_DBDMA_CHANS) to save/restore plus the
    global ddma block config (the +1). The last register in a channel can be
    skipped since it's read-only (at offset 0x18).

    Signed-off-by: Roel Kluin
    Cc: Manuel Lauss
    Signed-off-by: Andrew Morton
    Signed-off-by: Ralf Baechle

    Roel Kluin
     
  • Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • commit 48a048fed82a8e5fdd8618574f6d3de1a0d67a50
    Author: Rusty Russell
    Date: Thu Sep 24 09:34:44 2009 -0600

    apparently only passed the "looks good" level of QA ;-)

    Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • This extends commit a8ca8b64e3fdfec17679cba0ca5ce6e3ffed092d to cover
    MIPSxx-style board cache code.

    Signed-off-by: Kevin Cernekee
    Signed-off-by: Ralf Baechle

    Kevin Cernekee
     
  • Build error introduced by d4f587c67fc39e0030ddd718675e252e208da4d7.

    Signed-off-by: Mark Mason
    Signed-off-by: Ralf Baechle

    Mark Mason