19 Oct, 2010

1 commit

  • lru_add_drain_all() uses schedule_on_each_cpu() which is synchronous.
    There is no reason to call flush_scheduled_work() after
    lru_add_drain_all(). Drop the spurious calls.

    This is to prepare for the deprecation and removal of
    flush_scheduled_work().

    Signed-off-by: Tejun Heo
    Acked-by: KAMEZAWA Hiroyuki
    Reviewed-by: Minchan Kim
    Acked-by: Mel Gorman

    Tejun Heo
     

18 Oct, 2010

2 commits

  • * Rename shpchp_wq to shpchp_ordered_wq and add non-ordered shpchp_wq
    which is used instead of the system workqueue. This is to remove
    the use of flush_scheduled_work() which is deprecated and scheduled
    for removal.

    * With cmwq in place, there's no point in creating workqueues lazily.
    Create both shpchp_wq and shpchp_ordered_wq upfront.

    * Include workqueue.h from shpchp.h.

    Signed-off-by: Tejun Heo
    Acked-by: Jesse Barnes

    Tejun Heo
     
  • * Rename pciehp_wq to pciehp_ordered_wq and add non-ordered pciehp_wq
    which is used instead of the system workqueue. This is to remove
    the use of flush_scheduled_work() which is deprecated and scheduled
    for removal.

    * With cmwq in place, there's no point in creating workqueues lazily.
    Create both pciehp_wq and pciehp_ordered_wq upfront.

    * Include workqueue.h from pciehp.h.

    Signed-off-by: Tejun Heo
    Acked-by: Jesse Barnes

    Tejun Heo
     

17 Oct, 2010

1 commit


11 Oct, 2010

2 commits

  • Add WQ_MEM_RECLAIM flag which currently maps to WQ_RESCUER, mark
    WQ_RESCUER as internal and replace all external WQ_RESCUER usages to
    WQ_MEM_RECLAIM.

    This makes the API users express the intent of the workqueue instead
    of indicating the internal mechanism used to guarantee forward
    progress. This is also to make it cleaner to add more semantics to
    WQ_MEM_RECLAIM. For example, if deemed necessary, memory reclaim
    workqueues can be made highpri.

    This patch doesn't introduce any functional change.

    Signed-off-by: Tejun Heo
    Cc: Jeff Garzik
    Cc: Dave Chinner
    Cc: Steven Whitehouse

    Tejun Heo
     
  • The policy function keep_working() didn't check GCWQ_HIGHPRI_PENDING
    and could return %false with highpri work pending. This could lead to
    late execution of a highpri work which was delayed due to @max_active
    throttling if other works are actively consuming CPU cycles.

    For example, the following could happen.

    1. Work W0 which burns CPU cycles.

    2. Two works W1 and W2 are queued to a highpri wq w/ @max_active of 1.

    3. W1 starts executing and W2 is put to delayed queue. W0 and W1 are
    both runnable.

    4. W1 finishes which puts W2 to pending queue but keep_working()
    incorrectly returns %false and the worker goes to sleep.

    5. W0 finishes and W2 starts execution.

    With this patch applied, W2 starts execution as soon as W1 finishes.

    Signed-off-by: Tejun Heo

    Tejun Heo
     

05 Oct, 2010

2 commits


19 Sep, 2010

4 commits

  • Implement flush[_delayed]_work_sync(). These are flush functions
    which also make sure no CPU is still executing the target work from
    earlier queueing instances. These are similar to
    cancel[_delayed]_work_sync() except that the target work item is
    flushed instead of cancelled.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Factor out start_flush_work() from flush_work(). start_flush_work()
    has @wait_executing argument which controls whether the barrier is
    queued only if the work is pending or also if executing. As
    flush_work() needs to wait for execution too, it uses %true.

    This commit doesn't cause any behavior difference. start_flush_work()
    will be used to implement flush_work_sync().

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Make the following cleanup changes.

    * Relocate flush/cancel function prototypes and definitions.

    * Relocate wait_on_cpu_work() and wait_on_work() before
    try_to_grab_pending(). These will be used to implement
    flush_work_sync().

    * Make all flush/cancel functions return bool instead of int.

    * Update wait_on_cpu_work() and wait_on_work() to return %true if they
    actually waited.

    * Add / update comments.

    This patch doesn't cause any functional changes.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • alloc_ordered_workqueue() creates a workqueue which processes each
    work itemp one by one in the queued order. This will be used to
    replace create_freezeable_workqueue() and
    create_singlethread_workqueue().

    Signed-off-by: Tejun Heo

    Tejun Heo
     

18 Sep, 2010

6 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
    ALSA: pcm - Fix race with proc files
    ALSA: pcm - Fix unbalanced pm_qos_request
    ALSA: HDA: Enable internal speaker on Dell M101z
    ALSA: patch_nvhdmi.c: Fix supported sample rate list.
    sound: Remove pr_ uses of KERN_
    ALSA: hda - Add quirk for Toshiba C650D using a Conexant CX20585
    ALSA: hda_intel: ALSA HD Audio patch for Intel Patsburg DeviceIDs

    Linus Torvalds
     
  • * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
    hwmon: (lm95241) Replace rate sysfs attribute with update_interval
    hwmon: (adm1031) Replace update_rate sysfs attribute with update_interval
    hwmon: (w83627ehf) Use proper exit sequence
    hwmon: (emc1403) Remove unnecessary hwmon_device_unregister
    hwmon: (f75375s) Do not overwrite values read from registers
    hwmon: (f75375s) Shift control mode to the correct bit position
    hwmon: New subsystem maintainers
    hwmon: (lis3lv02d) Prevent NULL pointer dereference

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes:
    GFS2: gfs2_logd should be using interruptible waits

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
    firewire: nosy: fix build when CONFIG_FIREWIRE=N
    firewire: ohci: activate cycle timer register quirk on Ricoh chips

    Linus Torvalds
     
  • * 'for-linus' of git://neil.brown.name/md:
    md: fix v1.x metadata update when a disk is missing.
    md: call md_update_sb even for 'external' metadata arrays.

    Linus Torvalds
     
  • If a signal hits us outside of a syscall and another gets delivered
    when we are in sigreturn (e.g. because it had been in sa_mask for
    the first one and got sent to us while we'd been in the first handler),
    we have a chance of returning from the second handler to location one
    insn prior to where we ought to return. If r0 happens to contain -513
    (-ERESTARTNOINTR), sigreturn will get confused into doing restart
    syscall song and dance.

    Incredible joy to debug, since it manifests as random, infrequent and
    very hard to reproduce double execution of instructions in userland
    code...

    The fix is simple - mark it "don't bother with restarts" in wrapper,
    i.e. set r8 to 0 in sys_sigreturn and sys_rt_sigreturn wrappers,
    suppressing the syscall restart handling on return from these guys.
    They can't legitimately return a restart-worthy error anyway.

    Testcase:
    #include
    #include
    #include
    #include
    #include

    void f(int n)
    {
    __asm__ __volatile__(
    "ldr r0, [%0]\n"
    "b 1f\n"
    "b 2f\n"
    "1:b .\n"
    "2:\n" : : "r"(&n));
    }

    void handler1(int sig) { }
    void handler2(int sig) { raise(1); }
    void handler3(int sig) { exit(0); }

    main()
    {
    struct sigaction s = {.sa_handler = handler2};
    struct itimerval t1 = { .it_value = {1} };
    struct itimerval t2 = { .it_value = {2} };

    signal(1, handler1);

    sigemptyset(&s.sa_mask);
    sigaddset(&s.sa_mask, 1);
    sigaction(SIGALRM, &s, NULL);

    signal(SIGVTALRM, handler3);

    setitimer(ITIMER_REAL, &t1, NULL);
    setitimer(ITIMER_VIRTUAL, &t2, NULL);

    f(-513); /* -ERESTARTNOINTR */

    write(1, "buggered\n", 9);
    return 1;
    }

    Signed-off-by: Al Viro
    Acked-by: Russell King
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Al Viro
     

17 Sep, 2010

22 commits