Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1461638 > unrolled thread

[PATCH 0/8] Remove deprecated workqueue interface users

Started byBhaktipriya Shridhar <bhaktipriya96@gmail.com>
First post2016-08-13 18:20 +0200
Last post2016-08-16 01:00 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/8] Remove deprecated workqueue interface users Bhaktipriya Shridhar <bhaktipriya96@gmail.com> - 2016-08-13 18:20 +0200
    [PATCH 1/8] power: abx500_chargalg: Remove deprecated  create_singlethread_workqueue Bhaktipriya Shridhar <bhaktipriya96@gmail.com> - 2016-08-13 18:20 +0200
    Re: [PATCH 0/8] Remove deprecated workqueue interface users Tejun Heo <tj@kernel.org> - 2016-08-16 01:00 +0200
      Re: [PATCH 0/8] Remove deprecated workqueue interface users Sebastian Reichel <sre@kernel.org> - 2016-08-16 02:30 +0200
        Re: [PATCH 0/8] Remove deprecated workqueue interface users Tejun Heo <tj@kernel.org> - 2016-08-16 17:00 +0200
    Re: [PATCH 0/8] Remove deprecated workqueue interface users Sebastian Reichel <sre@kernel.org> - 2016-08-16 01:00 +0200

#1461638 — [PATCH 0/8] Remove deprecated workqueue interface users

FromBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Date2016-08-13 18:20 +0200
Subject[PATCH 0/8] Remove deprecated workqueue interface users
Message-ID<s5JPb-3AR-15@gated-at.bofh.it>
This patch set removes the instances of deprecated
create_singlethread_workqueues in drivers/power by making the appropriate
conversions.

Bhaktipriya Shridhar (8):
  power: abx500_chargalg: Remove deprecated create_singlethread_workqueue
  power: ab8500_btemp: Remove deprecated create_singlethread_workqueue
  power: pm2301_charger: Remove deprecated create_singlethread_workqueue
  power: intel_mid_battery: Remove deprecated create_singlethread_workqueue
  power: ab8500_charger: Remove deprecated create_singlethread_workqueue
  power: ipaq_micro_battery: Remove deprecated create_singlethread_workqueue
  power: ab8500_fg: Remove deprecated create_singlethread_workqueue
  power: ds2760_battery: Remove deprecated create_singlethread_workqueue

 drivers/power/ab8500_btemp.c       | 2 +-
 drivers/power/ab8500_charger.c     | 4 ++--
 drivers/power/ab8500_fg.c          | 2 +-
 drivers/power/abx500_chargalg.c    | 4 ++--
 drivers/power/ds2760_battery.c     | 3 ++-
 drivers/power/intel_mid_battery.c  | 3 +--
 drivers/power/ipaq_micro_battery.c | 2 +-
 drivers/power/pm2301_charger.c     | 3 ++-
 8 files changed, 12 insertions(+), 11 deletions(-)

--
2.1.4

[toc] | [next] | [standalone]


#1461639 — [PATCH 1/8] power: abx500_chargalg: Remove deprecated create_singlethread_workqueue

FromBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Date2016-08-13 18:20 +0200
Subject[PATCH 1/8] power: abx500_chargalg: Remove deprecated create_singlethread_workqueue
Message-ID<s5JPb-3AR-17@gated-at.bofh.it>
In reply to#1461638
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces
deprecated create_singlethread_workqueue(). This is the identity
conversion.

The workqueue "chargalg_wq" is used for running the charging algorithm.
It has multiple workitems viz &di->chargalg_periodic_work,
&di->chargalg_wd_work, &di->chargalg_work per abx500_chargalg, which
require ordering. It has been identity converted.

Also, WQ_MEM_RECLAIM has been set to ensure forward progress under
memory pressure.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
 drivers/power/abx500_chargalg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c
index d9104b1..a4411d6 100644
--- a/drivers/power/abx500_chargalg.c
+++ b/drivers/power/abx500_chargalg.c
@@ -2091,8 +2091,8 @@ static int abx500_chargalg_probe(struct platform_device *pdev)
 		abx500_chargalg_maintenance_timer_expired;

 	/* Create a work queue for the chargalg */
-	di->chargalg_wq =
-		create_singlethread_workqueue("abx500_chargalg_wq");
+	di->chargalg_wq = alloc_ordered_workqueue("abx500_chargalg_wq",
+						   WQ_MEM_RECLAIM);
 	if (di->chargalg_wq == NULL) {
 		dev_err(di->dev, "failed to create work queue\n");
 		return -ENOMEM;
--
2.1.4

[toc] | [prev] | [next] | [standalone]


#1463247

FromTejun Heo <tj@kernel.org>
Date2016-08-16 01:00 +0200
Message-ID<s6z1n-3il-13@gated-at.bofh.it>
In reply to#1461638
On Sat, Aug 13, 2016 at 09:41:21PM +0530, Bhaktipriya Shridhar wrote:
> This patch set removes the instances of deprecated
> create_singlethread_workqueues in drivers/power by making the appropriate
> conversions.
> 
> Bhaktipriya Shridhar (8):
>   power: abx500_chargalg: Remove deprecated create_singlethread_workqueue
>   power: ab8500_btemp: Remove deprecated create_singlethread_workqueue
>   power: pm2301_charger: Remove deprecated create_singlethread_workqueue
>   power: intel_mid_battery: Remove deprecated create_singlethread_workqueue
>   power: ab8500_charger: Remove deprecated create_singlethread_workqueue
>   power: ipaq_micro_battery: Remove deprecated create_singlethread_workqueue
>   power: ab8500_fg: Remove deprecated create_singlethread_workqueue
>   power: ds2760_battery: Remove deprecated create_singlethread_workqueue

Patches look good to me.  I'm a bit curious about WQ_MEM_RECLAIM part
tho.  I suppose the reasoning is that as the hardware in question is
involved in battery management which may be time critical,
WQ_MEM_RECLAIM is added to ensure (timely) forward progress under
memory pressure, right?  It'd be great if someone who's more familiar
with these hardware can confirm whether this is actually necessary.

Oh, it'd also be nice to put the target subsystem in the subject of
the patchset - e.g. "[PATCH 0/8] power: Remove..."

Thanks.

-- 
tejun

[toc] | [prev] | [next] | [standalone]


#1463302

FromSebastian Reichel <sre@kernel.org>
Date2016-08-16 02:30 +0200
Message-ID<s6Aqu-4jk-13@gated-at.bofh.it>
In reply to#1463247

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Mon, Aug 15, 2016 at 06:59:48PM -0400, Tejun Heo wrote:
> On Sat, Aug 13, 2016 at 09:41:21PM +0530, Bhaktipriya Shridhar wrote:
> > This patch set removes the instances of deprecated
> > create_singlethread_workqueues in drivers/power by making the appropriate
> > conversions.
> > 
> > Bhaktipriya Shridhar (8):
> >   power: abx500_chargalg: Remove deprecated create_singlethread_workqueue
> >   power: ab8500_btemp: Remove deprecated create_singlethread_workqueue
> >   power: pm2301_charger: Remove deprecated create_singlethread_workqueue
> >   power: intel_mid_battery: Remove deprecated create_singlethread_workqueue
> >   power: ab8500_charger: Remove deprecated create_singlethread_workqueue
> >   power: ipaq_micro_battery: Remove deprecated create_singlethread_workqueue
> >   power: ab8500_fg: Remove deprecated create_singlethread_workqueue
> >   power: ds2760_battery: Remove deprecated create_singlethread_workqueue
>
> Patches look good to me.  I'm a bit curious about WQ_MEM_RECLAIM
> part tho. I suppose the reasoning is that as the hardware in
> question is involved in battery management which may be time
> critical, WQ_MEM_RECLAIM is added to ensure (timely) forward
> progress under memory pressure, right? It'd be great if someone
> who's more familiar with these hardware can confirm whether this
> is actually necessary.

At least the charger monitoring is timing critical: Many charger
chips must be monitored (e.g. for over-temp. events). I think
all of them have a self-protection, or a watchdog, so they would
actually stop charging instead of overheating, but that may result
in system failure due to power loss. Battery monitors also include
some temperture safety checks. So without careful case-by-case
checking the WQ_MEM_RECLAIM should not be removed IMHO.

Anyways, I queued this patchset, since create_singlethread_workqueue()
did use WQ_MEM_RECLAIM, so removing that bit should be in another patch.

> Oh, it'd also be nice to put the target subsystem in the subject of
> the patchset - e.g. "[PATCH 0/8] power: Remove..."

Yes please. Also it seems like PATCH2-8 have wrong reference to
PATCH0/8 mail.

-- Sebastian

[toc] | [prev] | [next] | [standalone]


#1463870

FromTejun Heo <tj@kernel.org>
Date2016-08-16 17:00 +0200
Message-ID<s6O0p-4mE-7@gated-at.bofh.it>
In reply to#1463302
Hello, Sebastian.

On Tue, Aug 16, 2016 at 02:23:21AM +0200, Sebastian Reichel wrote:
> At least the charger monitoring is timing critical: Many charger
> chips must be monitored (e.g. for over-temp. events). I think
> all of them have a self-protection, or a watchdog, so they would
> actually stop charging instead of overheating, but that may result
> in system failure due to power loss. Battery monitors also include
> some temperture safety checks. So without careful case-by-case
> checking the WQ_MEM_RECLAIM should not be removed IMHO.

Thanks for the clarification.  Yeah, WQ_MEM_RECLAIM seems like the
right call.

Thanks.

-- 
tejun

[toc] | [prev] | [next] | [standalone]


#1463251

FromSebastian Reichel <sre@kernel.org>
Date2016-08-16 01:00 +0200
Message-ID<s6z1o-3il-27@gated-at.bofh.it>
In reply to#1461638

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Sat, Aug 13, 2016 at 09:41:21PM +0530, Bhaktipriya Shridhar wrote:
> This patch set removes the instances of deprecated
> create_singlethread_workqueues in drivers/power by making the appropriate
> conversions.

Thanks, all queued into power-supply's for-next branch.

-- Sebastian

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web