28 Jul, 2009

1 commit

  • mm: Pass virtual address to [__]p{te,ud,md}_free_tlb()

    Upcoming paches to support the new 64-bit "BookE" powerpc architecture
    will need to have the virtual address corresponding to PTE page when
    freeing it, due to the way the HW table walker works.

    Basically, the TLB can be loaded with "large" pages that cover the whole
    virtual space (well, sort-of, half of it actually) represented by a PTE
    page, and which contain an "indirect" bit indicating that this TLB entry
    RPN points to an array of PTEs from which the TLB can then create direct
    entries. Thus, in order to invalidate those when PTE pages are deleted,
    we need the virtual address to pass to tlbilx or tlbivax instructions.

    The old trick of sticking it somewhere in the PTE page struct page sucks
    too much, the address is almost readily available in all call sites and
    almost everybody implemets these as macros, so we may as well add the
    argument everywhere. I added it to the pmd and pud variants for consistency.

    Signed-off-by: Benjamin Herrenschmidt
    Acked-by: David Howells [MN10300 & FRV]
    Acked-by: Nick Piggin
    Acked-by: Martin Schwidefsky [s390]
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt
     

23 Jul, 2009

33 commits

  • Linus Torvalds
     
  • …git/tip/linux-2.6-tip

    * 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    genirq: Fix UP compile failure caused by irq_thread_check_affinity

    Linus Torvalds
     
  • …t/peterz/linux-2.6-lockdep

    * 'lockdep-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep:
    lockdep: Fix lockdep annotation for pipe_double_lock()

    Linus Torvalds
     
  • Since genirq: Delegate irq affinity setting to the irq thread
    (591d2fb02ea80472d846c0b8507007806bdd69cc) compilation with
    CONFIG_SMP=n fails with following error:

    /usr/src/linux-2.6/kernel/irq/manage.c:
    In function 'irq_thread_check_affinity':
    /usr/src/linux-2.6/kernel/irq/manage.c:475:
    error: 'struct irq_desc' has no member named 'affinity'
    make[4]: *** [kernel/irq/manage.o] Error 1

    That commit adds a new function irq_thread_check_affinity() which
    uses struct irq_desc.affinity which is only available for CONFIG_SMP=y.
    Move that function under #ifdef CONFIG_SMP.

    [ tglx@brownpaperbag: compile and boot tested on UP and SMP ]

    Signed-off-by: Bruno Premont
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Bruno Premont
     
  • The presumed use of the pipe_double_lock() routine is to lock 2 locks in
    a deadlock free way by ordering the locks by their address. However it
    fails to keep the specified lock classes in order and explicitly
    annotates a deadlock.

    Rectify this.

    Signed-off-by: Peter Zijlstra
    Acked-by: Miklos Szeredi
    LKML-Reference:

    Peter Zijlstra
     
  • …nel/git/peterz/linux-2.6-perf

    * 'perf-counters-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-perf: (31 commits)
    perf_counter tools: Give perf top inherit option
    perf_counter tools: Fix vmlinux symbol generation breakage
    perf_counter: Detect debugfs location
    perf_counter: Add tracepoint support to perf list, perf stat
    perf symbol: C++ demangling
    perf: avoid structure size confusion by using a fixed size
    perf_counter: Fix throttle/unthrottle event logging
    perf_counter: Improve perf stat and perf record option parsing
    perf_counter: PERF_SAMPLE_ID and inherited counters
    perf_counter: Plug more stack leaks
    perf: Fix stack data leak
    perf_counter: Remove unused variables
    perf_counter: Make call graph option consistent
    perf_counter: Add perf record option to log addresses
    perf_counter: Log vfork as a fork event
    perf_counter: Synthesize VDSO mmap event
    perf_counter: Make sure we dont leak kernel memory to userspace
    perf_counter tools: Fix index boundary check
    perf_counter: Fix the tracepoint channel to perfcounters
    perf_counter, x86: Extend perf_counter Pentium M support
    ...

    Linus Torvalds
     
  • …el/git/tip/linux-2.6-tip

    * 'core-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    softirq: introduce tasklet_hrtimer infrastructure

    Linus Torvalds
     
  • …el/git/tip/linux-2.6-tip

    * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    clocksource: Prevent NULL pointer dereference
    timer: Avoid reading uninitialized data

    Linus Torvalds
     
  • …git/tip/linux-2.6-tip

    * 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    genirq: Delegate irq affinity setting to the irq thread

    Linus Torvalds
     
  • …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: fix nr_uninterruptible accounting of frozen tasks really
    sched: fix load average accounting vs. cpu hotplug
    sched: Account for vruntime wrapping

    Linus Torvalds
     
  • * 'tj-block-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc:
    virtio_blk: mark virtio_blk with __refdata to kill spurious section mismatch
    block: sysfs fix mismatched queue_var_{store,show} in 64bit kernel
    ataflop: adjust NULL test
    block: fix failfast merge testing in elv_rq_merge_ok()
    z2ram: Small cleanup for z2ram.c

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
    fs/Kconfig: move nilfs2 out

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6:
    ide-tape: Don't leak kernel stack information
    ide: fix memory leak when flush command is issued

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (37 commits)
    sky2: Avoid races in sky2_down
    drivers/net/mlx4: Adjust constant
    drivers/net: Move a dereference below a NULL test
    drivers/net: Move a dereference below a NULL test
    connector: maintainer/mail update.
    USB host CDC Phonet network interface driver
    macsonic, jazzsonic: fix oops on module unload
    macsonic: move probe function to .devinit.text
    can: switch carrier on if device was stopped while in bus-off state
    can: restart device even if dev_alloc_skb() fails
    can: sja1000: remove duplicated includes
    New device ID for sc92031 [1088:2031]
    3c589_cs: re-initialize the multicast in the tc589_reset
    Fix error return for setsockopt(SO_TIMESTAMPING)
    netxen: fix thermal check and shutdown
    netxen: fix deadlock on dev close
    netxen: fix context deletion sequence
    net: Micrel KS8851 SPI network driver
    tcp: Use correct peer adr when copying MD5 keys
    tcp: Fix MD5 signature checking on IPv4 mapped sockets
    ...

    Linus Torvalds
     
  • * 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
    NFSv4: Fix a problem whereby a buggy server can oops the kernel
    NFSv4: Fix an NFSv4 mount regression
    NFSv4: Fix an Oops in nfs4_free_lock_state

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
    ALSA: ctxfi: Swapped SURROUND-SIDE channels on emu20k2
    ALSA: ca0106 - Fix the max capture buffer size
    ALSA: hda - Fix pin-setup for Sony VAIO with STAC9872 codecs
    ALSA: hda - Add quirk for Gateway T6834c laptop
    ALSA: OSS sequencer should be initialized after snd_seq_system_client_init
    ALSA: sound/isa: convert nested spin_lock_irqsave to spin_lock
    ALSA: hda_codec: Check for invalid zero connections

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
    HID: Move dereferences below a NULL test
    HID: hiddev, fix lock imbalance

    Linus Torvalds
     
  • the "reserved" field was not initialized to zero, resulting in 4 bytes
    of stack data leaking to userspace....

    Signed-off-by: Arjan van de Ven
    Acked-by: Peter Zijlstra
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • * 'linux-next' of git://git.infradead.org/ubi-2.6:
    UBI: fix bug in image sequence number handling
    UBI: gluebi: initialize ubi_num field

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: atkbd - add force relese key quirk for Soltech TA12
    Input: fix EVIOCGNAME/JSIOCGNAME regression
    Input: atkbd - add forced release keys quirk for FSC Amilo Pi 3525
    Input: pcspkr - switch driver to dev_pm_ops
    Input: xpad - don't resend successfully sent outgoing requests
    Input: wistron_btns - recognize Maxdata Pro 7000 notebooks

    Linus Torvalds
     
  • Currently, perf top -p only tracks the pid provided, which isn't very useful
    for watching forky loads, so give it an inherit option.

    Signed-off-by: Mike Galbraith
    Cc: Ingo Molnar
    Signed-off-by: Peter Zijlstra
    LKML-Reference:

    Mike Galbraith
     
  • vmlinux meets the criteria for symbol adjustment, which breaks vmlinux generated symbols.
    Fix this by exempting vmlinux. This is a bit fragile in that someone could change the
    kernel dso's name, but currently that name is also hardwired.

    Signed-off-by: Mike Galbraith
    Cc: Ingo Molnar
    Signed-off-by: Peter Zijlstra
    LKML-Reference:

    Mike Galbraith
     
  • If "/sys/kernel/debug" is not a debugfs mount point, search for the debugfs
    filesystem in /proc/mounts, but also allows the user to specify
    '--debugfs-dir=blah' or set the environment variable: 'PERF_DEBUGFS_DIR'

    Signed-off-by: Jason Baron
    [ also made it probe "/debug" by default ]
    Signed-off-by: Peter Zijlstra
    LKML-Reference:

    Jason Baron
     
  • Add support to 'perf list' and 'perf stat' for kernel tracepoints. The
    implementation creates a 'for_each_subsystem' and 'for_each_event' for
    easy iteration over the tracepoints.

    Signed-off-by: Jason Baron
    Signed-off-by: Peter Zijlstra
    LKML-Reference:

    Jason Baron
     
  • [acme@doppio ~]$ perf report -s comm,dso,symbol -C firefox -d /usr/lib64/xulrunner-1.9.1/libxul.so | grep :: | head
    2.21% [.] nsDeque::Push(void*)
    1.78% [.] GraphWalker::DoWalk(nsDeque&)
    1.30% [.] GCGraphBuilder::AddNode(void*, nsCycleCollectionParticipant*)
    1.27% [.] XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode)
    1.18% [.] imgContainer::DrawFrameTo(gfxIImageFrame*, gfxIImageFrame*, nsRect&)
    1.13% [.] nsDeque::PopFront()
    1.11% [.] nsGlobalWindow::RunTimeout(nsTimeout*)
    0.97% [.] nsXPConnect::Traverse(void*, nsCycleCollectionTraversalCallback&)
    0.95% [.] nsJSEventListener::cycleCollection::Traverse(void*, nsCycleCollectionTraversalCallback&)
    0.95% [.] nsCOMPtr_base::~nsCOMPtr_base()
    [acme@doppio ~]$

    Cc: Pekka Enberg
    Cc: Vegard Nossum
    Cc: Paul Mackerras
    Cc: Frédéric Weisbecker
    Suggested-by: Clark Williams
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Peter Zijlstra
    LKML-Reference:

    Arnaldo Carvalho de Melo
     
  • for some reason, this structure gets compiled as 36 bytes in some files
    (the ones that alloacte it) but 40 bytes in others (the ones that use it).
    The cause is an off_t type that gets a different size in different
    compilation units for some yet-to-be-explained reason.

    But the effect is disasterous; the size/offset members of the struct
    are at different offsets, and result in mostly complete garbage.
    The parser in perf is so robust that this all gets hidden, and after
    skipping an certain amount of samples, it recovers.... so this bug
    is not normally noticed.

    .... except when you want every sample to be exact.

    Fix this by just using an explicitly sized type.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Peter Zijlstra
    LKML-Reference:

    Arjan van de Ven
     
  • Right now we only print PERF_EVENT_THROTTLE + 1 (ie PERF_EVENT_UNTHROTTLE).
    Fix this to print both a throttle and unthrottle event.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Peter Zijlstra
    LKML-Reference:

    Anton Blanchard
     
  • perf stat and perf record currently look for all options on the command
    line. This can lead to some confusion:

    # perf stat ls -l
    Error: unknown switch `l'

    While we can work around this by adding '--' before the command, the git
    option parsing code can stop at the first non option:

    # perf stat ls -l
    Performance counter stats for 'ls -l':
    ....

    Signed-off-by: Anton Blanchard
    Signed-off-by: Peter Zijlstra
    LKML-Reference:

    Anton Blanchard
     
  • Anton noted that for inherited counters the counter-id as provided by
    PERF_SAMPLE_ID isn't mappable to the id found through PERF_RECORD_ID
    because each inherited counter gets its own id.

    His suggestion was to always return the parent counter id, since that
    is the primary counter id as exposed. However, these inherited
    counters have a unique identifier so that events like
    PERF_EVENT_PERIOD and PERF_EVENT_THROTTLE can be specific about which
    counter gets modified, which is important when trying to normalize the
    sample streams.

    This patch removes PERF_EVENT_PERIOD in favour of PERF_SAMPLE_PERIOD,
    which is more useful anyway, since changing periods became a lot more
    common than initially thought -- rendering PERF_EVENT_PERIOD the less
    useful solution (also, PERF_SAMPLE_PERIOD reports the more accurate
    value, since it reports the value used to trigger the overflow,
    whereas PERF_EVENT_PERIOD simply reports the requested period changed,
    which might only take effect on the next cycle).

    This still leaves us PERF_EVENT_THROTTLE to consider, but since that
    _should_ be a rare occurrence, and linking it to a primary id is the
    most useful bit to diagnose the problem, we introduce a
    PERF_SAMPLE_STREAM_ID, for those few cases where the full
    reconstruction is important.

    [Does change the ABI a little, but I see no other way out]

    Suggested-by: Anton Blanchard
    Signed-off-by: Peter Zijlstra
    LKML-Reference:

    Peter Zijlstra
     
  • Per example of Arjan's patch, I went through and found a few more.

    Signed-off-by: Peter Zijlstra

    Peter Zijlstra
     
  • the "reserved" field was not initialized to zero, resulting in 4 bytes
    of stack data leaking to userspace....

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Peter Zijlstra

    Arjan van de Ven
     
  • Fix a gcc unused variables warning.

    Signed-off-by: Peter Zijlstra

    Peter Zijlstra
     
  • Peter Zijlstra
     

22 Jul, 2009

6 commits

  • There's some odd bug in gcc-4.2 where it miscompiles a simple loop whent
    he loop counter is of type 'unsigned char' and it should count to 128.

    The compiler will incorrectly decide that a trivial loop like this:

    unsigned char i, ...

    for (i = 0; i < 128; i++) {
    ..

    is endless, and will compile it to a single instruction that just
    branches to itself.

    This was triggered by the addition of '-fno-strict-overflow', and we
    could play games with compiler versions and go back to '-fwrapv'
    instead, but the trivial way to avoid it is to just make the loop
    induction variable be an 'int' instead.

    Thanks to Krzysztof Oledzki for reporting and testing and to Troy Moure
    for digging through assembler differences and finding it.

    Reported-and-tested-by: Krzysztof Oledzki
    Found-by: Troy Moure
    Gcc-bug-acked-by: Ian Lance Taylor
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • commit ca109491f (hrtimer: removing all ur callback modes) moved all
    hrtimer callbacks into hard interrupt context when high resolution
    timers are active. That breaks code which relied on the assumption
    that the callback happens in softirq context.

    Provide a generic infrastructure which combines tasklets and hrtimers
    together to provide an in-softirq hrtimer experience.

    Signed-off-by: Peter Zijlstra
    Cc: torvalds@linux-foundation.org
    Cc: kaber@trash.net
    Cc: David Miller
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Peter Zijlstra
     
  • Reset rx chain before trying to drain it.
    Shut interrupts off last, incase there's something to report.

    Signed-off-by: Mike McCormack
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Mike McCormack
     
  • Don't leak kernel stack information through uninitialized structure members.

    Signed-off-by: Michael Buesch
    Acked-by: Borislav Petkov .
    Signed-off-by: David S. Miller

    Michael Buesch
     
  • I'm using ide on 2.6.30.1 with xfs filesystem. I noticed a kernel memory
    leak after writing lots of data, the kmalloc-96 slab cache keeps
    growing. It seems the struct ide_cmd kmalloced by idedisk_prepare_flush
    is never kfreed.

    Commit a09485df9cda49fbde2766c86eb18a9cae585162 ("ide: move request
    type specific code from ide_end_drive_cmd() to callers (v3)") and
    f505d49ffd25ed062e76ffd17568d3937fcd338c ("ide: fix barriers support")
    cause this regression, cmd->rq must now be set for ide_complete_cmd to
    honor the IDE_TFLAG_DYN flag.

    Signed-off-by: Maxime Bizon
    Acked-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Maxime Bizon
     
  • We just had a case in which a buggy server occasionally returns the wrong
    attributes during an OPEN call. While the client does catch this sort of
    condition in nfs4_open_done(), and causes the nfs4_atomic_open() to return
    -EISDIR, the logic in nfs_atomic_lookup() is broken, since it causes a
    fallback to an ordinary lookup instead of just returning the error.

    When the buggy server then returns a regular file for the fallback lookup,
    the VFS allows the open, and bad things start to happen, since the open
    file doesn't have any associated NFSv4 state.

    The fix is firstly to return the EISDIR/ENOTDIR errors immediately, and
    secondly to ensure that we are always careful when dereferencing the
    nfs_open_context state pointer.

    Signed-off-by: Trond Myklebust

    Trond Myklebust