1. 06 2月, 2008 8 次提交
    • O
      remove handle_group_stop() in favor of do_signal_stop() · f558b7e4
      Oleg Nesterov 提交于
      Every time we set SIGNAL_GROUP_EXIT or clear SIGNAL_STOP_DEQUEUED we also
      reset ->group_stop_count.
      
      This means that the SIGNAL_GROUP_EXIT check in handle_group_stop() is not
      needed, and do_signal_stop() should check SIGNAL_STOP_DEQUEUED only when
      ->group_stop_count == 0. With these changes handle_group_stop() becomes the
      subset of do_signal_stop(), we can kill it and use do_signal_stop() instead.
      
      Also, a preparation for the next patch.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: Davide Libenzi <davidel@xmailserver.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Robin Holt <holt@sgi.com>
      Cc: Roland McGrath <roland@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f558b7e4
    • O
      __group_complete_signal(): fix coredump with group stop race · 198466b4
      Oleg Nesterov 提交于
      When __group_complete_signal() sees sig_kernel_coredump() signal, it starts
      the group stop, but sets ->group_exit_task = t in a hope that "t" will
      actually dequeue this signal and invoke do_coredump().  However, by the
      time "t" enters get_signal_to_deliver() it is possible that the signal was
      blocked/ignored or we have another pending !SIG_KERNEL_COREDUMP_MASK signal
      which will be dequeued first.  This means the task could be stopped but not
      killed.
      
      Remove this code from __group_complete_signal().  Note also this patch
      removes the bogus signal_wake_up(t, 1).  This thread can't be
      STOPPED/TRACED, note the corresponding check in wants_signal().
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: Davide Libenzi <davidel@xmailserver.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Robin Holt <holt@sgi.com>
      Cc: Roland McGrath <roland@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      198466b4
    • A
      clone: prepare to recycle CLONE_STOPPED · bdff746a
      Andrew Morton 提交于
      Ulrich says that we never used this clone flags and that nothing should be
      using it.
      
      As we're down to only a single bit left in clone's flags argument, let's add a
      warning to check that no userspace is actually using it.  Hopefully we will
      be able to recycle it.
      
      Roland said:
      
        CLONE_STOPPED was previously used by some NTPL versions when under
        thread_db (i.e.  only when being actively debugged by gdb), but not for a
        long time now, and it never worked reliably when it was used.  Removing it
        seems fine to me.
      
      [akpm@linux-foundation.org: it looks like CLONE_DETACHED is being used]
      Cc: Ulrich Drepper <drepper@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Roland McGrath <roland@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bdff746a
    • A
      get_task_comm(): return the result · 59714d65
      Andrew Morton 提交于
      It was dumb to make get_task_comm() return void.  Change it to return a
      pointer to the resulting output for caller convenience.
      
      Cc: Ulrich Drepper <drepper@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Roland McGrath <roland@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      59714d65
    • P
      lockdep: annotate epoll · 0ccf831c
      Peter Zijlstra 提交于
      On Sat, 2008-01-05 at 13:35 -0800, Davide Libenzi wrote:
      
      > I remember I talked with Arjan about this time ago. Basically, since 1)
      > you can drop an epoll fd inside another epoll fd 2) callback-based wakeups
      > are used, you can see a wake_up() from inside another wake_up(), but they
      > will never refer to the same lock instance.
      > Think about:
      >
      > 	dfd = socket(...);
      > 	efd1 = epoll_create();
      > 	efd2 = epoll_create();
      > 	epoll_ctl(efd1, EPOLL_CTL_ADD, dfd, ...);
      > 	epoll_ctl(efd2, EPOLL_CTL_ADD, efd1, ...);
      >
      > When a packet arrives to the device underneath "dfd", the net code will
      > issue a wake_up() on its poll wake list. Epoll (efd1) has installed a
      > callback wakeup entry on that queue, and the wake_up() performed by the
      > "dfd" net code will end up in ep_poll_callback(). At this point epoll
      > (efd1) notices that it may have some event ready, so it needs to wake up
      > the waiters on its poll wait list (efd2). So it calls ep_poll_safewake()
      > that ends up in another wake_up(), after having checked about the
      > recursion constraints. That are, no more than EP_MAX_POLLWAKE_NESTS, to
      > avoid stack blasting. Never hit the same queue, to avoid loops like:
      >
      > 	epoll_ctl(efd2, EPOLL_CTL_ADD, efd1, ...);
      > 	epoll_ctl(efd3, EPOLL_CTL_ADD, efd2, ...);
      > 	epoll_ctl(efd4, EPOLL_CTL_ADD, efd3, ...);
      > 	epoll_ctl(efd1, EPOLL_CTL_ADD, efd4, ...);
      >
      > The code "if (tncur->wq == wq || ..." prevents re-entering the same
      > queue/lock.
      
      Since the epoll code is very careful to not nest same instance locks
      allow the recursion.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Tested-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Acked-by: NDavide Libenzi <davidel@xmailserver.org>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0ccf831c
    • A
      drivers/net/wireless/b43/main.c needs io.h · 96cf49a2
      Andrew Morton 提交于
      m68k:
      
      drivers/net/wireless/b43/main.c:251: error: implicit declaration of function 'mmiowb'
      
      Cc: "John W. Linville" <linville@tuxdriver.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      96cf49a2
    • O
      sys_remap_file_pages: fix ->vm_file accounting · 8a459e44
      Oleg Nesterov 提交于
      Fix ->vm_file accounting, mmap_region() may do do_munmap().
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8a459e44
    • A
      kvm: i386 fix · c0b49b0d
      Andrew Morton 提交于
      arch/x86/kvm/x86.c: In function 'emulator_cmpxchg_emulated':
      arch/x86/kvm/x86.c:1746: warning: passing argument 2 of 'vcpu->arch.mmu.gva_to_gpa' makes integer from pointer without a cast
      arch/x86/kvm/x86.c:1746: warning: 'addr' is used uninitialized in this function
      
      Is true.  Local variable `addr' shadows incoming arg `addr'.  Avi is on
      vacation for a while, so...
      
      Cc: Avi Kivity <avi@qumranet.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c0b49b0d
  2. 05 2月, 2008 25 次提交
  3. 04 2月, 2008 7 次提交
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial · f5bb3a5e
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (79 commits)
        Jesper Juhl is the new trivial patches maintainer
        Documentation: mention email-clients.txt in SubmittingPatches
        fs/binfmt_elf.c: spello fix
        do_invalidatepage() comment typo fix
        Documentation/filesystems/porting fixes
        typo fixes in net/core/net_namespace.c
        typo fix in net/rfkill/rfkill.c
        typo fixes in net/sctp/sm_statefuns.c
        lib/: Spelling fixes
        kernel/: Spelling fixes
        include/scsi/: Spelling fixes
        include/linux/: Spelling fixes
        include/asm-m68knommu/: Spelling fixes
        include/asm-frv/: Spelling fixes
        fs/: Spelling fixes
        drivers/watchdog/: Spelling fixes
        drivers/video/: Spelling fixes
        drivers/ssb/: Spelling fixes
        drivers/serial/: Spelling fixes
        drivers/scsi/: Spelling fixes
        ...
      f5bb3a5e
    • L
      Merge branch 'locks' of git://linux-nfs.org/~bfields/linux · 9853832c
      Linus Torvalds 提交于
      * 'locks' of git://linux-nfs.org/~bfields/linux:
        pid-namespaces-vs-locks-interaction
        file locks: Use wait_event_interruptible_timeout()
        locks: clarify posix_locks_deadlock
      9853832c
    • H
      kbuild: Fix instrumentation removal breakage on avr32 · b21761ff
      Haavard Skinnemoen 提交于
      AVR32 still includes Kconfig.instrumentation, so it won't build after
      this...
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      Acked-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b21761ff
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild · 519cb688
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
        scsi: fix dependency bug in aic7 Makefile
        kbuild: add svn revision information to setlocalversion
        kbuild: do not warn about __*init/__*exit symbols being exported
        Move Kconfig.instrumentation to arch/Kconfig and init/Kconfig
        Add HAVE_KPROBES
        Add HAVE_OPROFILE
        Create arch/Kconfig
        Fix ARM to play nicely with generic Instrumentation menu
        kconfig: ignore select of unknown symbol
        kconfig: mark config as changed when loading an alternate config
        kbuild: Spelling/grammar fixes for config DEBUG_SECTION_MISMATCH
        Remove __INIT_REFOK and __INITDATA_REFOK
        kbuild: print only total number of section mismatces found
      519cb688
    • N
      vm audit: add VM_DONTEXPAND to mmap for drivers that need it · 2f98735c
      Nick Piggin 提交于
      Drivers that register a ->fault handler, but do not range-check the
      offset argument, must set VM_DONTEXPAND in the vm_flags in order to
      prevent an expanding mremap from overflowing the resource.
      
      I've audited the tree and attempted to fix these problems (usually by
      adding VM_DONTEXPAND where it is not obvious).
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2f98735c
    • G
      ADB: Add missing #include <linux/platform_device.h> · fe2528b9
      Geert Uytterhoeven 提交于
      Commit c9f6d3d5 ("[POWERPC] adb: Replace
      sleep notifier with platform driver suspend/resume hooks") introduced
      compile errors on m68k because <linux/platform_device.h> is not
      explicitly included.  On powerpc, it's pulled in through <asm/prom.h>.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fe2528b9
    • A
      x86: fix RTC lockdep warning: potential hardirq recursion · 795d45b2
      Andrew Morton 提交于
      After disabling both CONFIG_DEBUG_LOCKING_API_SELFTESTS and netconsole
      (using current mainline) I get a login prompt, and also...
      
      [    5.181668] SELinux: policy loaded with handle_unknown=deny
      [    5.183315] type=1403 audit(1202100038.157:3): policy loaded auid=4294967295 ses=4294967295
      [    5.822073] SELinux: initialized (dev usbfs, type usbfs), uses genfs_contexts
      [    7.819146] ------------[ cut here ]------------
      [    7.819146] WARNING: at kernel/lockdep.c:2033 trace_hardirqs_on+0x9b/0x10d()
      [    7.819146] Modules linked in: generic ext3 jbd ide_disk ide_core
      [    7.819146] Pid: 399, comm: hwclock Not tainted 2.6.24 #4
      [    7.819146]  [<c011d140>] warn_on_slowpath+0x41/0x51
      [    7.819146]  [<c01364a9>] ? lock_release_holdtime+0x50/0x56
      [    7.819146]  [<c013770c>] ? check_usage_forwards+0x19/0x3b
      [    7.819146]  [<c01390c4>] ? __lock_acquire+0xac3/0xb0b
      [    7.819146]  [<c0108c98>] ? native_sched_clock+0x8b/0x9f
      [    7.819146]  [<c01364a9>] ? lock_release_holdtime+0x50/0x56
      [    7.819146]  [<c030ca6c>] ? _spin_unlock_irq+0x22/0x42
      [    7.819146]  [<c013848b>] trace_hardirqs_on+0x9b/0x10d
      [    7.819146]  [<c030ca6c>] _spin_unlock_irq+0x22/0x42
      [    7.819146]  [<c011481e>] hpet_rtc_interrupt+0xdf/0x290
      [    7.819146]  [<c014ea90>] handle_IRQ_event+0x1a/0x46
      [    7.819146]  [<c014f8ea>] handle_edge_irq+0xbe/0xff
      [    7.819146]  [<c0106e08>] do_IRQ+0x6d/0x84
      [    7.819146]  [<c0105596>] common_interrupt+0x2e/0x34
      [    7.819146]  [<c013007b>] ? ktime_get_ts+0x8/0x3f
      [    7.819146]  [<c0139420>] ? lock_release+0x167/0x16f
      [    7.819146]  [<c017974a>] ? core_sys_select+0x2c/0x327
      [    7.819146]  [<c0179792>] core_sys_select+0x74/0x327
      [    7.819146]  [<c0108c98>] ? native_sched_clock+0x8b/0x9f
      [    7.819146]  [<c01364a9>] ? lock_release_holdtime+0x50/0x56
      [    7.819146]  [<c030ca6c>] ? _spin_unlock_irq+0x22/0x42
      [    7.819146]  [<c01384d6>] ? trace_hardirqs_on+0xe6/0x10d
      [    7.819146]  [<c030ca77>] ? _spin_unlock_irq+0x2d/0x42
      [    7.819146]  [<c023b437>] ? rtc_do_ioctl+0x11b/0x677
      [    7.819146]  [<c01c487e>] ? inode_has_perm+0x5e/0x68
      [    7.819146]  [<c01364a9>] ? lock_release_holdtime+0x50/0x56
      [    7.819146]  [<c0108c98>] ? native_sched_clock+0x8b/0x9f
      [    7.819146]  [<c01c490b>] ? file_has_perm+0x83/0x8c
      [    7.819146]  [<c023ba08>] ? rtc_ioctl+0xf/0x11
      [    7.819146]  [<c017898d>] ? do_ioctl+0x55/0x67
      [    7.819146]  [<c0179d15>] sys_select+0x93/0x163
      [    7.819146]  [<c0104b39>] ? sysenter_past_esp+0x9a/0xa5
      [    7.819146]  [<c0104afe>] sysenter_past_esp+0x5f/0xa5
      [    7.819146]  =======================
      [    7.819146] ---[ end trace 96540ca301ffb84c ]---
      [    7.819210] rtc: lost 6 interrupts
      [    7.870668] type=1400 audit(1202128840.794:4): avc:  denied  { audit_write } for  pid=399 comm="hwclock" capability=29 scontext=system_u:system_r:hwclock_t:s0 tcontext=system_u:system_r:hwclock_t:s0 tclass=capability
      [    9.538866] input: PC Speaker as /class/input/input5
      
      Because hpet_rtc_interrupt()'s call to get_rtc_time() ends up
      resolving to include/asm-generic/rtc.h's (hilariously inlined)
      get_rtc_time(), which does spin_unlock_irq() from hard IRQ context.
      
      The obvious patch fixes it.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      795d45b2