[SRU]Network Manager sets powersave off by default in xenial

Bug #1557026 reported by Pilot6 on 2016-03-14
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
High
Aron Xu
Xenial
High
Unassigned
Yakkety
High
Aron Xu

Bug Description

[Impact]
NetworkManager consumes more power than previous releases because powersave support is not updated.

[Test Case]
With the patch applied, network device power management should be on when supported, for example:

$ sudo iwconfig wlan0 | grep "Power Management"
          Power Management:on

[Regression Potential]
Regression may happen when the power management feature of certain device isn't implemented properly in kernel, but since we are quite conservative on enabling power management in kernel development such case should be rare.

Pilot6 (hanipouspilot) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager (Ubuntu):
status: New → Confirmed
Tony Espy (awe) wrote :
Download full text (3.7 KiB)

So NM 1.1.93-0ubuntu1 includes the patch default_powersave_on.patch, which is pretty simple, it just modifies the NMSettingWireless code to default powersave to 1:

===================================================================
--- a/libnm-util/nm-setting-wireless.c
+++ b/libnm-util/nm-setting-wireless.c
@@ -675,7 +675,7 @@ nm_setting_wireless_get_hidden (NMSettin
 guint32
 nm_setting_wireless_get_powersave (NMSettingWireless *setting)
 {
- g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0);
+ g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 1);

  return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->powersave;
 }
@@ -885,6 +885,9 @@ verify (NMSetting *setting, GSList *all_
 static void
 nm_setting_wireless_init (NMSettingWireless *setting)
 {
+ NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
+
+ priv->powersave = 1;
 }

 static void
@@ -1283,7 +1286,7 @@ nm_setting_wireless_class_init (NMSettin
  g_object_class_install_property
   (object_class, PROP_POWERSAVE,
    g_param_spec_uint (NM_SETTING_WIRELESS_POWERSAVE, "", "",
- 0, G_MAXUINT32, 0,
+ 0, G_MAXUINT32, 1,
                       G_PARAM_READWRITE |
                       G_PARAM_STATIC_STRINGS));
 }

...unfortunately, the NM1.2 treats powersave=1 as IGNORE:

/**
 * NMSettingWirelessPowersave:
 * @NM_SETTING_WIRELESS_POWERSAVE_DEFAULT: use the default value
 * @NM_SETTING_WIRELESS_POWERSAVE_IGNORE: don't touch existing setting
 * @NM_SETTING_WIRELESS_POWERSAVE_DISABLE: disable powersave
 * @NM_SETTING_WIRELESS_POWERSAVE_ENABLE: enable powersave
 *
 * These flags indicate whether wireless powersave must be enabled.
 **/
typedef enum {
    NM_SETTING_WIRELESS_POWERSAVE_DEFAULT = 0,
    NM_SETTING_WIRELESS_POWERSAVE_IGNORE = 1,
    NM_SETTING_WIRELESS_POWERSAVE_DISABLE = 2,
    NM_SETTING_WIRELESS_POWERSAVE_ENABLE ...

Read more...

Changed in network-manager (Ubuntu):
importance: Undecided → High
Tony Espy (awe) wrote :

Note, it looks like the problem is that the original patch fixes up the libnm-util version of nm-settings-wireless.c which has been deprecated. Instead the libnm-core version of nm-settings-wireless.c needs to be updated. I'm testing this now for a touch build and will report back here if it works.

Amr Ibrahim (amribrahim1987) wrote :

A fix was released for Ubuntu touch. Please SRU for desktop Xenial.

Sebastien Bacher (seb128) wrote :

Tony, is that right that it was fixed in the overlay version? If so why is Ubuntu left behind?

Changed in network-manager (Ubuntu):
assignee: nobody → Tony Espy (awe)
Amr Ibrahim (amribrahim1987) wrote :

Bug #1579915 is for ubuntu touch.

Sebastien Bacher (seb128) wrote :

seems like the fix was merged in the packaging vcs
https://git.launchpad.net/~network-manager/network-manager/+git/ubuntu/commit/?id=9f40397c

Aron, can you include that in the coming SRU maybe?

Changed in network-manager (Ubuntu):
assignee: Tony Espy (awe) → Aron Xu (happyaron)
tags: added: desktop-trello-import
tags: removed: desktop-trello-import
Aron Xu (happyaron) on 2016-07-04
Changed in network-manager (Ubuntu):
status: Confirmed → Triaged
Aron Xu (happyaron) on 2016-07-05
summary: - Network Manager sets powersave off by default in xenial
+ [SRU]Network Manager sets powersave off by default in xenial
Aron Xu (happyaron) on 2016-07-05
description: updated
Aron Xu (happyaron) on 2016-07-05
Changed in network-manager (Ubuntu):
status: Triaged → In Progress
Martin Pitt (pitti) on 2016-07-07
Changed in network-manager (Ubuntu Yakkety):
status: In Progress → Fix Released
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager (Ubuntu Xenial):
status: New → Confirmed

Hello Pilot6, or anyone else affected,

Accepted network-manager into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/network-manager/1.2.0-0ubuntu0.16.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in network-manager (Ubuntu Xenial):
status: Confirmed → Fix Committed
tags: added: verification-needed
Jose Gómez (adler-dreamcoder) wrote :

In Ubuntu Xenial, with the proposed packages (1.2.0-0ubuntu0.16.04.3), running with the laptop plugged I get:

$ sudo iwconfig wlan0 | grep "Power Management"
          Power Management:off

And with the laptop unplugged:

$ sudo iwconfig wlan0 | grep "Power Management"
          Power Management:on

Pilot6 (hanipouspilot) on 2016-07-13
tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package network-manager - 1.2.0-0ubuntu0.16.04.3

---------------
network-manager (1.2.0-0ubuntu0.16.04.3) xenial; urgency=medium

  * cli-initialize-connection-list-in-do_device_connect.patch:
    Make sure connection list available for nmc_secrets_requested().
    (LP: #1595707).
  * Removing default_powersave_on.patch, and instead install config
    file that accomplishes the same (LP: #1557026)
  * Fix invalid nmcli option in bug report script
    debian/source_network-manager.py (LP: #1582803)

 -- Aron Xu <email address hidden> Tue, 05 Jul 2016 16:01:03 +0800

Changed in network-manager (Ubuntu Xenial):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for network-manager has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Mathew Hodson (mhodson) on 2016-08-22
Changed in network-manager (Ubuntu Xenial):
importance: Undecided → High

For those of us who have a regression in wireless performance due to this, but would rather WORKAROUND this issue instead of file a bug report to spin dev cycles, could someone advise where permanently disabling powersave_on is documented at wiki/help.ubuntu.com?

Pilot6 (hanipouspilot) wrote :

Christopher,

The problem is that there is no global setting for that. You can enable or disable PM in NM per connection. Global settings are possible if you are not using NM.

A perfect solution is to make that setting in NM config. It is very easy yo do.

Pilot6, thanks for the quick response. It is greatly appreciated.

To clarify, what would one do precisely in this case?

Pilot6 (hanipouspilot) wrote :

If a user have a reasonable number of connections, they can edit settings per connection manually.

Each connection has a config file in /etc/NetworkManager/system-connections/

They can add

powersave=0

to the [wifi] section of each file.

I did the reverse and had to add "powersave=1" before the fix of this bug.

As I said before there is no global setting in /etc/NetworkManager/networkManager.conf

Jeremy (wa113y3s) wrote :

From results on the forums I visit, this creates more issues than it solves

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers