login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
28
Re: [PATCH 6/8] PM: Add suspend blocking work.
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Rafael J. Wysocki
Subject:
Re: [PATCH 6/8] PM: Add suspend blocking work.
Date: Wednesday, April 28, 2010 - 3:19 pm
On Thursday 29 April 2010, Arve Hjønnevåg wrote:
quoted text
> 2010/4/28 Rafael J. Wysocki <rjw@sisk.pl>: > > On Wednesday 28 April 2010, Oleg Nesterov wrote: > >> On 04/27, Arve Hjønnevåg wrote: > >> > > >> > Allow work to be queued that will block suspend while it is pending > >> > or executing. To get the same functionality in the calling code often > >> > requires a separate suspend_blocker for pending and executing work, or > >> > additional state and locking. This implementation does add additional > >> > state and locking, but this can be removed later if we add support for > >> > suspend blocking work to the core workqueue code. > >> > >> I think this patch is fine. > >> > >> Just one silly question, > >> > >> > +int queue_suspend_blocking_work(struct workqueue_struct *wq, > >> > + struct suspend_blocking_work *work) > >> > +{ > >> > + int ret; > >> > + unsigned long flags; > >> > + > >> > + spin_lock_irqsave(&work->lock, flags); > >> > + suspend_block(&work->suspend_blocker); > >> > + ret = queue_work(wq, &work->work); > >> > + if (ret) > >> > + work->active++; > >> > >> why not > >> > >> ret = queue_work(wq, &work->work); > >> if (ret) { > >> suspend_block(&work->suspend_blocker); > >> work->active++; > >> } > >> > >> ? > >> > >> Afaics, we can't race with work->func() doing unblock, we hold work-lock. > >> And this way the code looks more clear. > > > > Agreed. Arve, any objections to doing that? > > > > I need to fix the race, but I can easily fix it in > cancel_suspend_blocking_work_sync instead. If the suspend blocker is > active for a long time, and DEBUG_SUSPEND_BLOCKER is enabled, we can > tell if the work is constantly re-queued or if the workqueue is stuck.
Well, perhaps that's worth adding a comment to the code. The debug part is not immediately visible from the code itself. Rafael --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 0/9] Suspend block api (version 5)
, =?UTF-8?q?Arve=20Hj= ...
, (Tue Apr 27, 9:31 pm)
[PATCH 1/8] PM: Add suspend block api.
, =?UTF-8?q?Arve=20Hj= ...
, (Tue Apr 27, 9:31 pm)
[PATCH 2/8] PM: suspend_block: Add driver to access suspen ...
, =?UTF-8?q?Arve=20Hj= ...
, (Tue Apr 27, 9:31 pm)
[PATCH 3/8] PM: suspend_block: Abort task freezing if a su ...
, =?UTF-8?q?Arve=20Hj= ...
, (Tue Apr 27, 9:31 pm)
[PATCH 4/8] PM: suspend_block: Add debugfs file
, =?UTF-8?q?Arve=20Hj= ...
, (Tue Apr 27, 9:31 pm)
[PATCH 5/8] PM: suspend_block: Add suspend_blocker stats
, =?UTF-8?q?Arve=20Hj= ...
, (Tue Apr 27, 9:31 pm)
[PATCH 6/8] PM: Add suspend blocking work.
, =?UTF-8?q?Arve=20Hj= ...
, (Tue Apr 27, 9:31 pm)
[PATCH 7/8] Input: Block suspend while event queue is not ...
, =?UTF-8?q?Arve=20Hj= ...
, (Tue Apr 27, 9:31 pm)
[PATCH 8/8] power_supply: Block suspend while power supply ...
, =?UTF-8?q?Arve=20Hj= ...
, (Tue Apr 27, 9:31 pm)
Re: [PATCH 3/8] PM: suspend_block: Abort task freezing if ...
, Pavel Machek
, (Tue Apr 27, 10:07 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Pavel Machek
, (Tue Apr 27, 11:06 pm)
Re: [PATCH 1/8] PM: Add suspend block api.
, Pavel Machek
, (Tue Apr 27, 11:07 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Tejun Heo
, (Tue Apr 27, 11:44 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Arve Hjønnevåg
, (Wed Apr 28, 12:02 am)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Tejun Heo
, (Wed Apr 28, 12:18 am)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Oleg Nesterov
, (Wed Apr 28, 12:40 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Tejun Heo
, (Wed Apr 28, 1:22 pm)
Re: [PATCH 1/8] PM: Add suspend block api.
, Rafael J. Wysocki
, (Wed Apr 28, 1:50 pm)
Re: [PATCH 2/8] PM: suspend_block: Add driver to access su ...
, Rafael J. Wysocki
, (Wed Apr 28, 1:58 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Rafael J. Wysocki
, (Wed Apr 28, 2:08 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Rafael J. Wysocki
, (Wed Apr 28, 2:09 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Arve Hjønnevåg
, (Wed Apr 28, 3:09 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Rafael J. Wysocki
, (Wed Apr 28, 3:19 pm)
Re: [PATCH 2/8] PM: suspend_block: Add driver to access su ...
, Arve Hjønnevåg
, (Wed Apr 28, 3:31 pm)
Re: [PATCH 2/8] PM: suspend_block: Add driver to access su ...
, Rafael J. Wysocki
, (Wed Apr 28, 4:05 pm)
Re: [PATCH 2/8] PM: suspend_block: Add driver to access su ...
, Arve Hjønnevåg
, (Wed Apr 28, 4:38 pm)
Re: [PATCH 1/8] PM: Add suspend block api.
, Arve Hjønnevåg
, (Wed Apr 28, 8:37 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Arve Hjønnevåg
, (Wed Apr 28, 8:47 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Oleg Nesterov
, (Thu Apr 29, 11:58 am)
[PATCH 0/2] workqueue fixlets (Was: PM: Add suspend blocki ...
, Oleg Nesterov
, (Thu Apr 29, 12:44 pm)
[PATCH 1/2] workqueues: flush_delayed_work: keep the origi ...
, Oleg Nesterov
, (Thu Apr 29, 12:45 pm)
[PATCH 2/2] workqueues: export keventd_wq
, Oleg Nesterov
, (Thu Apr 29, 12:45 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Rafael J. Wysocki
, (Thu Apr 29, 2:08 pm)
Re: [PATCH 6/8] PM: Add suspend blocking work.
, Rafael J. Wysocki
, (Thu Apr 29, 2:09 pm)
Re: [PATCH 2/8] PM: suspend_block: Add driver to access su ...
, Rafael J. Wysocki
, (Thu Apr 29, 2:11 pm)
Re: [PATCH 1/8] PM: Add suspend block api.
, Rafael J. Wysocki
, (Thu Apr 29, 2:16 pm)
Re: [PATCH 2/8] PM: suspend_block: Add driver to access su ...
, Arve Hjønnevåg
, (Thu Apr 29, 4:41 pm)
Re: [PATCH 1/8] PM: Add suspend block api.
, Tejun Heo
, (Thu Apr 29, 9:24 pm)
Re: [PATCH 1/2] workqueues: flush_delayed_work: keep the o ...
, Tejun Heo
, (Thu Apr 29, 10:15 pm)
Re: [PATCH 2/2] workqueues: export keventd_wq
, Tejun Heo
, (Thu Apr 29, 10:16 pm)
Re: [PATCH 2/2] workqueues: export keventd_wq
, Arve Hjønnevåg
, (Thu Apr 29, 10:39 pm)
Re: [PATCH 2/2] workqueues: export keventd_wq
, Tejun Heo
, (Thu Apr 29, 10:52 pm)
Re: [PATCH 1/8] PM: Add suspend block api.
, Oleg Nesterov
, (Fri Apr 30, 10:26 am)
Re: [PATCH 2/2] workqueues: export keventd_wq
, Oleg Nesterov
, (Fri Apr 30, 11:05 am)
Re: [PATCH 2/2] workqueues: export keventd_wq
, Tejun Heo
, (Fri Apr 30, 11:11 am)
Re: [PATCH 1/8] PM: Add suspend block api.
, Tejun Heo
, (Thu May 20, 1:30 am)
Re: [PATCH 1/8] PM: Add suspend block api.
, Rafael J. Wysocki
, (Thu May 20, 3:27 pm)
Re: [PATCH 1/8] PM: Add suspend block api.
, Tejun Heo
, (Thu May 20, 11:35 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Matthew Garrett
Re: [PATCH] Enable speedstep for sonoma processors.
Mauro Carvalho Chehab
Re: [PATCH 1/2] media: Add timberdale video-in driver
Peter Zijlstra
[PATCH 23/30] netvm: skb processing
Greg Kroah-Hartman
[PATCH 21/28] cgroupfs: create /sys/fs/cgroup to mount cgroupfs on
git
:
Jan Hudec
Re: GIT push to sftp (feature request)
Steffen Prohaska
[PATCH 0/4] core.ignorecase
Johannes Schindelin
Re: Git checkout preserve timestamp?
Linus Torvalds
[PATCH 1/7] Make unpack_trees_options bit flags actual bitfields
Johan Herland
Re: What's cooking in git.git (Oct 2010, #01; Wed, 13)
linux-netdev
:
David Miller
Re: [PATCH 1/3] f_phonet: dev_kfree_skb instead of dev_kfree_skb_any in TX callback
Richard Cochran
Re: [PATCH v3 3/3] ptp: Added a clock that uses the eTSEC found on the MPC85xx.
Jan Engelhardt
Re: [PATCH] Fix netfilter xt_time's time_mt()'s use of do_div()
Herbert Xu
Re: [RFC PATCH 00/17] virtual-bus
Jeff Kirsher
Re: [net-next-2.6 PATCH] e1000e: don't inadvertently re-set INTX_DISABLE
git-commits-head
:
Linux Kernel Mailing List
ALSA: hda - Enable beep on Realtek codecs with PCI SSID override
Linux Kernel Mailing List
Use path_put() in a few places instead of {mnt,d}put()
Linux Kernel Mailing List
mv643xx_eth: use sw csum for big packets
Linux Kernel Mailing List
arm: fix HAVE_CLK merge goof
Linux Kernel Mailing List
arm: convert pcm037 platform to use smsc911x
freebsd-current
:
David Wolfskill
"interrupt storm..."; seems associated with an0 NIC
Andriy Gapon
Re: letting glabel recognise a media change
Garrett Cooper
Re: Only display ACPI bootmenu key if ACPI is present
Pyun YongHyeon
CFT: msk(4) Rx checksum offloading support
FreeBSD Tinderbox
[head tinderbox] failure on sparc64/sparc64
Colocation donated by:
Syndicate