08 Jul, 2009

4 commits

  • The kmalloc_large() and kmalloc_large_node() functions were missed when
    adding the kmemleak hooks to the slub allocator. However, they should be
    traced to avoid false positives.

    Signed-off-by: Catalin Marinas
    Cc: Christoph Lameter
    Acked-by: Pekka Enberg

    Catalin Marinas
     
  • Many of the false positives in kmemleak happen on busy systems where
    objects are allocated during a kmemleak scanning episode. These objects
    aren't scanned by default until the next memory scan. When such object
    is added, for example, at the head of a list, it is possible that all
    the other objects in the list become unreferenced until the next scan.

    This patch adds checking for newly allocated objects at the end of the
    scan and repeats the scanning on these objects. If Linux allocates
    new objects at a higher rate than their scanning, it stops after a
    predefined number of passes.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • Initially, the scan_mutex was acquired in kmemleak_open() and released
    in kmemleak_release() (corresponding to /sys/kernel/debug/kmemleak
    operations). This was causing some lockdep reports when the file was
    closed from a different task than the one opening it. This patch moves
    the scan_mutex acquiring in kmemleak_write() or kmemleak_seq_start()
    with releasing in kmemleak_seq_stop().

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • Since the leaks are no longer printed to the syslog, there is no point
    in keeping this limitation. All the suspected leaks are shown on
    /sys/kernel/debug/kmemleak file.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     

07 Jul, 2009

29 commits

  • Following recent fix to no longer reschedule in the scan_block()
    function, the system may become unresponsive with !PREEMPT. This patch
    re-adds the cond_resched() call to scan_block() but conditioned by the
    allow_resched parameter.

    Signed-off-by: Catalin Marinas
    Cc: Ingo Molnar

    Catalin Marinas
     
  • This is a long-running thread but not high-priority. So it makes sense
    to renice it to +10.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • …git/tip/linux-2.6-tip

    * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86: fix usage of bios intcall()
    x86: Remove unused function lapic_watchdog_ok()
    x86: Remove unused variable disable_x2apic
    x86, kvm: Fix section mismatches in kvm.c
    x86: Add missing annotation to arch/x86/lib/copy_user_64.S::copy_to_user
    x86: Fix fixmap page order for FIX_TEXT_POKE0,1
    amd-iommu: set evt_buf_size correctly
    amd-iommu: handle alias entries correctly in init code
    x86: Fix printk call in print_local_apic()
    x86: Declare check_efer() before it gets used
    x86: Mark device_nb as static and fix NULL noise
    x86: Remove double declaration of MSR_P6_EVNTSEL0 and MSR_P6_EVNTSEL1
    xen: Use kcalloc() in xen_init_IRQ()
    x86: Fix fixmap ordering
    x86: Fix symbol annotation for arch/x86/lib/clear_page_64.S::clear_page_c

    Linus Torvalds
     
  • * master.kernel.org:/home/rmk/linux-2.6-arm:
    [ARM] amba: fix amba device resources
    [ARM] pgtable: file pte layout documentation
    [ARM] pgtable: swp pte layout documentation, definitions, and check
    [ARM] export __cpu_flush_dcache_page
    [ARM] 5576/1: Update kb9202_defconfig
    [ARM] 5581/1: U300 clock updates
    [ARM] 5579/1: Updated U300 defconfig

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6:
    Revert "ide: improve handling of Power Management requests"

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (39 commits)
    Revert "p54: Use SKB list handling helpers instead of by-hand code."
    sctp: fix warning at inet_sock_destruct() while release sctp socket
    tun/tap: Fix crashes if open() /dev/net/tun and then poll() it.
    dsa: fix 88e6xxx statistics counter snapshotting
    forcedeth: Fix NAPI race.
    drivers/net/smsc911x.c: Fix resource size off by 1 error
    pcnet_cs: add new id
    bnx2x: Fix the maximal values of coalescing timeouts.
    bnx2x: Disable HC coalescing when setting timeout to zero.
    tun: Fix device unregister race
    be2net: fix spurious interrupt handling in intx mode
    e1000e: disable K1 at 1000Mbps for 82577/82578
    e1000e: delay second read of PHY_STATUS register on failure of first read
    e1000e: prevent NVM corruption on sectors larger than 4K
    e1000e: do not write SmartSpeed register bits on parts without support
    e1000e: delay after LCD reset and proper checks for PHY configuration done
    e1000e: PHY loopback broken on 82578
    ixgbe: Not allow 8259x unsupported wol options change from ethtool
    ixgbe: fix inconsistent SFP/SFP+ failure results.
    ixgbe: fix regression on some 82598 adapters
    ...

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
    PCI: Fix IRQ swizzling for ARI-enabled devices
    ia64/PCI: adjust section annotation for pcibios_setup()
    x86/PCI: get root CRS before scanning children
    x86/PCI: fix boundary checking when using root CRS
    PCI MSI: Fix restoration of MSI/MSI-X mask states in suspend/resume
    PCI MSI: Unmask MSI if setup failed
    PCI MSI: shorten PCI_MSIX_ENTRY_* symbol names
    PCI: make pci_name() take const argument
    PCI: More PATA quirks for not entering D3
    PCI: fix kernel-doc warnings
    PCI: check if bus has a proper bridge device before triggering SBR
    PCI: remove pci_dac_dma_... APIs on mn10300
    PCI ECRC: Remove unnecessary semicolons
    PCI MSI: Return if alloc_msi_entry for MSI-X failed

    Linus Torvalds
     
  • * 'fixes-for-linus' of git://git.monstr.eu/linux-2.6-microblaze:
    microblaze: Fix cast warning for init.c
    microblaze: Wire up new syscalls
    microblaze: use generic syscalls.h
    microblaze: clean up signal handling
    microblaze: convert all simple headers to use asm-generic
    microblaze: use the generic lib/checksum.c
    microblaze: fall back on generic header files for the ABI

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
    SLAB: Fix lockdep annotations
    fix RCU-callback-after-kmem_cache_destroy problem in sl[aou]b

    Linus Torvalds
     
  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (25 commits)
    V4L/DVB (12206): get_dvb_firmware: Correct errors in MPC718 firmware extraction logic
    V4L/DVB (12203): radio-si470x: fix lock imbalance
    V4L/DVB (12202): em28xx, fix lock imbalance
    V4L/DVB (12172): em28xx: Add autodetection code for Silvercrest 1.3 mpix
    V4L/DVB (12171): em28xx: fix webcam usage with different output formats
    V4L/DVB (12169): em28xx-video: fix VIDIOC_G_FMT and VIDIOC_ENUMFMT with webcams
    V4L/DVB (12156): em28xx: Fix tuning for Terratec Cinergy T XS USB (zl10353 version)
    V4L/DVB (12139): em28xx: add other video formats
    V4L/DVB (12138): em28xx: add support for Silvercrest Webcam
    V4L/DVB (12174): mt9v011: let's stick with datasheet values where it works
    V4L/DVB (12173): mt9v011: properly calculate image resolution registers
    V4L/DVB (12137): mt9v011: CodingStyle fixes
    V4L/DVB (12136): mt9v011: Some fixes at the register initialization table
    V4L/DVB (12135): Add a driver for mt9v011 sensor
    V4L/DVB (12166): cx23885: add FIXME comment above set_frontend override
    V4L/DVB (12165): cx23885: override set_frontend to allow rf input path switching on the HVR1275
    V4L/DVB (12148): move V4L2_PIX_FMT_SGRBG8 to the proper place
    V4L/DVB (12182): cx18: Add DVB-T support for Yuan MPC-718 cards with an MT352 or ZL10353
    V4L/DVB (12181): get_dvb_firmware: Add Yuan MPC718 MT352 DVB-T "firmware" extraction
    V4L/DVB (12180): cx18: Update Yuan MPC-718 card entry with better information and guesses
    ...

    Linus Torvalds
     
  • * git://git.infradead.org/iommu-2.6:
    intel-iommu: Don't use identity mapping for PCI devices behind bridges
    intel-iommu: Use iommu_should_identity_map() at startup time too.
    intel-iommu: No mapping for non-PCI devices
    intel-iommu: Restore DMAR_BROKEN_GFX_WA option for broken graphics drivers
    intel-iommu: Add iommu_should_identity_map() function
    intel-iommu: Fix reattaching of devices to identity mapping domain
    intel-iommu: Don't set identity mapping for bypassed graphics devices
    intel-iommu: Fix dma vs. mm page confusion with aligned_nrpages()

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
    ieee1394: sbp2: add support for disks >2 TB (and 16 bytes long CDBs)
    firewire: sbp2: add support for disks >2 TB (and 16 bytes long CDBs)
    firewire: core: do not DMA-map stack addresses

    Linus Torvalds
     
  • This way they'll be properly initialized early enough for users that may
    touch them before the framebuffer has been registered.

    Drivers that allocate their fb_info structure some other way (like
    matrocfb's broken static allocation) need to be fixed up appropriately.

    Signed-off-by: Paul Mundt
    Signed-off-by: Linus Torvalds

    Paul Mundt
     
  • do_execve() and ptrace_attach() return -EINTR if
    mutex_lock_interruptible(->cred_guard_mutex) fails.

    This is not right, change the code to return ERESTARTNOINTR.

    Perhaps we should also change proc_pid_attr_write().

    Signed-off-by: Oleg Nesterov
    Cc: David Howells
    Acked-by: Roland McGrath
    Cc: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • In include/linux/sysrq.h the constant EINVAL is being used but is undefined
    if include/linux/errno.h is not included before.

    Fix this by adding #include at the beginning.

    Signed-off-by: Tobias Doerffel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tobias Doerffel
     
  • Correct the CLKVAL_F field value of VIDEO MAIN CONTROLLER 0 REGITSTER.

    Frame Rate is 1 / [ { (VSPW+1) + (VBPD+1) + (LIINEVAL + 1) + (VFPD+1)
    } x {(HSPW+1) + (HBPD +1)
    + (HFPD+1) + (HOZVAL + 1) } x { ( CLKVAL+1 ) / ( Frequency of Clock
    source ) } ] and VCLK = Video Clock Source / (CLKVAL +1).

    therefore CLKVAL_F should be "CLKVAL_F = Frequency of Clock source / pixel
    clock * refresh".

    for this, I added refresh value in platform data like below.

    static struct s3c_fb_pd_win xxx_fb_win0 = {
    /* this is to ensure we use win0 */
    .win_mode = {
    .refresh = 60,
    .pixclock = (66+4+2+480)*(15+5+3+800),
    .left_margin = 66,
    .right_margin = 2,
    .upper_margin = 15,
    .lower_margin = 3,
    .hsync_len = 4,
    .vsync_len = 5,
    .xres = 480,
    .yres = 800,
    },
    .max_bpp = 32,
    .default_bpp = 24,
    };

    static struct s3c_fb_platdata xxx_lcd_pdata __initdata = {
    .win[0] = &xxx_fb_win0,
    .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
    .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC
    | VIDCON1_INV_VCLK | VIDCON1_INV_VDEN,
    .setup_gpio = s5pc1xx_fb_gpio_setup_24bpp,
    };

    xxx_machine_init()
    {
    .
    .
    .
    s3c_fb_set_platdata(&xxx_lcd_pdata);
    }

    platform data defined in machine code should be setting using
    s3c_fb_set_platdata().

    Signed-off-by: InKi Dae
    Cc: Kyungmin Park
    Cc: Krzysztof Helt
    Cc: Marek Szyprowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    InKi Dae
     
  • These warnings were observed on MIPS32 using 2.6.31-rc1 and gcc-4.2.0:

    mm/page_alloc.c: In function 'alloc_pages_exact':
    mm/page_alloc.c:1986: warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast

    drivers/usb/mon/mon_bin.c: In function 'mon_alloc_buff':
    drivers/usb/mon/mon_bin.c:1264: warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast

    [akpm@linux-foundation.org: fix kernel/perf_counter.c too]
    Signed-off-by: Kevin Cernekee
    Cc: Andi Kleen
    Cc: Ralf Baechle
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kevin Cernekee
     
  • In testing a backport of the write_begin/write_end AOPs, a 10% re-read
    regression was noticed when running iozone. This regression was
    introduced because the old AOPs would always do a mark_page_accessed(page)
    after the commit_write, but when the new AOPs where introduced, the only
    place this was kept was in pagecache_write_end().

    This patch does the same thing in the generic case as what is done in
    pagecache_write_end(), which is just to mark the page accessed before we
    do write_end().

    Signed-off-by: Josef Bacik
    Acked-by: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josef Bacik
     
  • Fix the multithread program core thread message error.

    This issue affects arches with neither has CORE_DUMP_USE_REGSET nor
    ELF_CORE_COPY_TASK_REGS, ARM is one of them.

    The thread message of core file is generated in elf_dump_thread_status.
    The register values is set by elf_core_copy_task_regs in this function.

    If an arch doesn't define ELF_CORE_COPY_TASK_REGS,
    elf_core_copy_task_regs() will do nothing. Then the core file will not
    have the register message of thread.

    So add elf_core_copy_regs to set regiser values if ELF_CORE_COPY_TASK_REGS
    doesn't define.

    The following is how to reproduce this issue:

    cat 1.c
    #include
    #include
    #include

    void td1(void * i)
    {
    while (1)
    {
    printf ("1\n");
    sleep (1);
    }

    return;
    }

    void td2(void * i)
    {
    while (1)
    {
    printf ("2\n");
    sleep (1);
    }

    return;
    }

    int
    main(int argc,char *argv[],char *envp[])
    {
    pthread_t t1,t2;

    pthread_create(&t1, NULL, (void*)td1, NULL);
    pthread_create(&t2, NULL, (void*)td2, NULL);

    sleep (10);

    assert(0);

    return (0);
    }
    arm-xxx-gcc -g -lpthread 1.c -o 1
    copy 1.c and 1 to a arm board.
    Goto this board.
    ulimit -c 1800000
    ./1
    # ./1
    1
    2
    1
    ...
    ...
    1
    1: 1.c:37: main: Assertion `0' failed.
    Aborted (core dumped)
    Then you can get a core file.
    gdb 1 core.xxx
    Without the patch:
    (gdb) info threads
    3 process 909 0x00000000 in ?? ()
    2 process 908 0x00000000 in ?? ()
    * 1 process 907 0x4a6e2238 in raise () from /lib/libc.so.6
    You can found that the pc of 909 and 908 is 0x00000000.
    With the patch:
    (gdb) info threads
    3 process 885 0x4a749974 in nanosleep () from /lib/libc.so.6
    2 process 884 0x4a749974 in nanosleep () from /lib/libc.so.6
    * 1 process 883 0x4a6e2238 in raise () from /lib/libc.so.6
    The pc of 885 and 884 is right.

    Signed-off-by: Hui Zhu
    Cc: Amerigo Wang
    Cc: Al Viro
    Cc: David Howells
    Cc: Roland McGrath
    Cc: Jakub Jelinek
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hui Zhu
     
  • I run many ffsb test cases on JBODs (typically 13/12 disks). Comparing
    with kernel 2.6.30, 2.6.31-rc1 has about 16% regression with
    ffsb_create_4k. The sub test case creates files continuously for 10
    minitues and every file is 1MB.

    Bisect located below patch.

    5cee5815d1564bbbd505fea86f4550f1efdb5cd0 is first bad commit
    commit 5cee5815d1564bbbd505fea86f4550f1efdb5cd0
    Author: Jan Kara
    Date: Mon Apr 27 16:43:51 2009 +0200

    vfs: Make sys_sync() use fsync_super() (version 4)

    It is unnecessarily fragile to have two places (fsync_super() and do_sync())
    doing data integrity sync of the filesystem. Alter __fsync_super() to
    accommodate needs of both callers and use it. So after this patch
    __fsync_super() is the only place where we gather all the calls needed to
    properly send all data on a filesystem to disk.

    As a matter of fact, ffsb calls sys_sync in the end to make sure all data
    is flushed to disks and the flushing is counted into the result. vmstat
    shows ffsb is blocked when syncing for a long time. With 2.6.30, ffsb is
    blocked for a short time.

    I checked the patch and did experiments to recover the original methods.
    Eventually, the root cause is the patch deletes the calling to
    wakeup_pdflush when syncing, so only ffsb is blocked on disk I/O.
    wakeup_pdflush could ask pdflush to write back pages with ffsb at the
    same time.

    [akpm@linux-foundation.org: restore comment too]
    Signed-off-by: Zhang Yanmin
    Cc: Jan Kara
    Cc: Al Viro
    Acked-by: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zhang, Yanmin
     
  • Fix for this issue on x86_64:

    rostedt@goodmis.org wrote:
    > On bootup of the latest kernel my init segfaults. Debugging it,
    > I found that vread_tsc (a vsyscall) increments some strange
    > kernel memory:
    >
    > 0000000000000000 :
    > 0: 55 push %rbp
    > 1: 48 ff 05 00 00 00 00 incq 0(%rip)
    > # 8
    > 4: R_X86_64_PC32 .bss+0x3c
    > 8: 48 89 e5 mov %rsp,%rbp
    > b: 66 66 90 xchg %ax,%ax
    > e: 48 ff 05 00 00 00 00 incq 0(%rip)
    > # 15
    > 11: R_X86_64_PC32 .bss+0x44
    > 15: 66 66 90 xchg %ax,%ax
    > 18: 48 ff 05 00 00 00 00 incq 0(%rip)
    > # 1f
    > 1b: R_X86_64_PC32 .bss+0x4c
    > 1f: 0f 31 rdtsc
    >
    >
    > Those "incq" is very bad to happen in vsyscall memory, since
    > userspace can not modify it. You need to make something prevent
    > profiling of vsyscall memory (like I do with ftrace).

    Signed-off-by: Peter Oberparleiter
    Cc: Ingo Molnar
    Reported-by: Steven Rostedt
    Tested-by: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Oberparleiter
     
  • When i2c_smbus_read_byte_data fails in ds1374_work, we forgot to unlock
    the held lock. Fix that.

    Signed-off-by: Jiri Slaby
    Cc: Alessandro Zummo
    Cc: Scott Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     
  • Fix a typo in the VLYNQ bus driver Kconfig which prevented to turn on
    VLYNQ bus debugging.

    Signed-off-by: Florian Fainelli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florian Fainelli
     
  • Fix a typo in the vlynq bus driver which was missing the CONFIG_ prefix to
    turn on debugging code.

    Signed-off-by: Robert P. J. Day
    Signed-off-by: Florian Fainelli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Remove redundant call to the sisfb_get_fix() before sis frambuffer is
    registered.

    This fixes a problem with uninitialized the fb_info->mm_lock mutex
    introduced by the commit 537a1bf059f " fbdev: add mutex for fb_mmap
    locking"

    Signed-off-by: Krzysztof Helt
    Tested-by: Wu Zhangjin
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • This reverts commit a1091aae19b1d9c85d91c86915a611387f67a26b.

    David S. Miller
     
  • Commit 'net: Move rx skb_orphan call to where needed' broken sctp protocol
    with warning at inet_sock_destruct(). Actually, sctp can do this right with
    sctp_sock_rfree_frag() and sctp_skb_set_owner_r_frag() pair.

    sctp_sock_rfree_frag(skb);
    sctp_skb_set_owner_r_frag(skb, newsk);

    This patch not revert the commit d55d87fdff8252d0e2f7c28c2d443aee17e9d70f,
    instead remove the sctp_sock_rfree_frag() function.

    ------------[ cut here ]------------
    WARNING: at net/ipv4/af_inet.c:151 inet_sock_destruct+0xe0/0x142()
    Modules linked in: sctp ipv6 dm_mirror dm_region_hash dm_log dm_multipath
    scsi_mod ext3 jbd uhci_hcd ohci_hcd ehci_hcd [last unloaded: scsi_wait_scan]
    Pid: 1808, comm: sctp_test Not tainted 2.6.31-rc2 #40
    Call Trace:
    [] warn_slowpath_common+0x6a/0x81
    [] ? inet_sock_destruct+0xe0/0x142
    [] warn_slowpath_null+0x12/0x15
    [] inet_sock_destruct+0xe0/0x142
    [] __sk_free+0x19/0xcc
    [] sk_free+0x18/0x1a
    [] sctp_close+0x192/0x1a1 [sctp]
    [] inet_release+0x47/0x4d
    [] sock_release+0x19/0x5e
    [] sock_close+0x21/0x25
    [] __fput+0xde/0x189
    [] fput+0x18/0x1a
    [] filp_close+0x56/0x60
    [] put_files_struct+0x5d/0xa1
    [] exit_files+0x39/0x3d
    [] do_exit+0x1a5/0x5dd
    [] ? d_kill+0x35/0x3b
    [] ? dequeue_signal+0xa6/0x115
    [] do_group_exit+0x63/0x8a
    [] get_signal_to_deliver+0x2e1/0x2f9
    [] do_notify_resume+0x7c/0x6b5
    [] ? autoremove_wake_function+0x0/0x34
    [] ? __d_free+0x3d/0x40
    [] ? d_free+0x2a/0x3c
    [] ? vfs_write+0x103/0x117
    [] ? sys_socketcall+0x178/0x182
    [] work_notifysig+0x13/0x19
    ---[ end trace 9db92c463e789fba ]---

    Signed-off-by: Wei Yongjun
    Acked-by: Herbert Xu
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • Fix NULL pointer dereference in tun_chr_pool() introduced by commit
    33dccbb050bbe35b88ca8cf1228dcf3e4d4b3554 ("tun: Limit amount of queued
    packets per device") and triggered by this code:

    int fd;
    struct pollfd pfd;
    fd = open("/dev/net/tun", O_RDWR);
    pfd.fd = fd;
    pfd.events = POLLIN | POLLOUT;
    poll(&pfd, 1, 0);

    Reported-by: Eugene Kapun
    Signed-off-by: Mariusz Kozlowski
    Signed-off-by: David S. Miller

    Mariusz Kozlowski
     
  • This reverts commit a1317f714af7aed60ddc182d0122477cbe36ee9b.

    David S. Miller
     

06 Jul, 2009

7 commits