Skip to contentSkip to conversation

power: supply: Ratelimit no data debug output

PATCH In review Marek Vasut 3 participants 5 messages Mar 5, 2023 – May 11, 2023 Power supply

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: Ratelimit no data debug output

Reduce the amount of output this dev_dbg() statement emits into logs, otherwise if system software polls the sysfs entry for data and keeps getting -ENODATA, it could end up filling the logs up.

This does in fact make systemd journald choke, since during boot the sysfs power supply entries are polled and if journald starts at the same time, the journal is just being repeatedly filled up, and the system stops on trying to start journald without booting any further.

---
Cc: Hans de Goede <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: [email protected]

---
 drivers/power/supply/power_supply_sysfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/power/supply/power_supply_sysfs.c +2 -1
index c228205e09538..4bbb3053eef44 100644
@@ -285,7 +285,8 @@ static ssize_t power_supply_show_property(struct device *dev,
 
 		if (ret < 0) {
 			if (ret == -ENODATA)
-				dev_dbg(dev, "driver has no data for `%s' property\n",
+				dev_dbg_ratelimited(dev,
+					"driver has no data for `%s' property\n",
 					attr->attr.name);
 			else if (ret != -ENODEV && ret != -EAGAIN)
 				dev_err_ratelimited(dev,
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 9 lines · Marek Vasut

Reduce the amount of output this dev_dbg() statement emits into logs, otherwise if system software polls the sysfs entry for data and keeps getting -ENODATA, it could end up filling the logs up.

This does in fact make systemd journald choke, since during boot the sysfs power supply entries are polled and if journald starts at the same time, the journal is just being repeatedly filled up, and the system stops on trying to start journald without booting any further.

Quoted 5 lines

---
Cc: Hans de Goede <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: [email protected]

Thanks, patch looks good to me:

Regards,

Hans

Quoted 18 lines
---
 drivers/power/supply/power_supply_sysfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/power/supply/power_supply_sysfs.c +2 -1
index c228205e09538..4bbb3053eef44 100644
@@ -285,7 +285,8 @@ static ssize_t power_supply_show_property(struct device *dev,
 
 		if (ret < 0) {
 			if (ret == -ENODATA)
-				dev_dbg(dev, "driver has no data for `%s' property\n",
+				dev_dbg_ratelimited(dev,
+					"driver has no data for `%s' property\n",
 					attr->attr.name);
 			else if (ret != -ENODEV && ret != -EAGAIN)
 				dev_err_ratelimited(dev,
#2 lore raw
Quoted 1 line · Hans de Goede

Hi,

Hi,

Quoted 16 lines · Marek Vasut
Quoted 9 lines

Reduce the amount of output this dev_dbg() statement emits into logs, otherwise if system software polls the sysfs entry for data and keeps getting -ENODATA, it could end up filling the logs up.

This does in fact make systemd journald choke, since during boot the sysfs power supply entries are polled and if journald starts at the same time, the journal is just being repeatedly filled up, and the system stops on trying to start journald without booting any further.

Quoted 5 lines

---
Cc: Hans de Goede <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: [email protected]

Quoted 3 lines

Thanks, patch looks good to me:

Any news ? Maybe this could be applied now ?

#3 lore raw

Hi,

Quoted 17 lines · Marek Vasut
Quoted 16 lines · Hans de Goede
Quoted 14 lines · Marek Vasut

Reduce the amount of output this dev_dbg() statement emits into logs, otherwise if system software polls the sysfs entry for data and keeps getting -ENODATA, it could end up filling the logs up.

This does in fact make systemd journald choke, since during boot the sysfs power supply entries are polled and if journald starts at the same time, the journal is just being repeatedly filled up, and the system stops on trying to start journald without booting any further.

---
Cc: Hans de Goede <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: [email protected]

Quoted 5 lines
Quoted 3 lines

Thanks, patch looks good to me:

Any news ? Maybe this could be applied now ?

Sorry for the delay; I applied it to my fixes branch now.

-- Sebastian

#4 lore raw
Quoted 1 line · Sebastian Reichel

Hi,

Hi,

Quoted 18 lines · Marek Vasut
Quoted 17 lines · Hans de Goede
Quoted 16 lines · Marek Vasut
Quoted 14 lines

Reduce the amount of output this dev_dbg() statement emits into logs, otherwise if system software polls the sysfs entry for data and keeps getting -ENODATA, it could end up filling the logs up.

This does in fact make systemd journald choke, since during boot the sysfs power supply entries are polled and if journald starts at the same time, the journal is just being repeatedly filled up, and the system stops on trying to start journald without booting any further.

---
Cc: Hans de Goede <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: [email protected]

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Thanks, patch looks good to me:

Any news ? Maybe this could be applied now ?

Sorry for the delay; I applied it to my fixes branch now.

Thanks !