All of lore.kernel.org
 help / color / mirror / Atom feed
* [cpusensor] pingTimer and creationTimer are conflict??
@ 2019-04-02  6:14 John Wang
  2019-04-02 16:17 ` Jae Hyun Yoo
  0 siblings, 1 reply; 3+ messages in thread
From: John Wang @ 2019-04-02  6:14 UTC (permalink / raw)
  To: jae.hyun.yoo; +Cc: OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 704 bytes --]

Hi Jae,

When two cpus are configured in the entity-manager and there is only one
cpu on the motherboard, the cpusensor service cannot expose cpu sensor
information to dbus.
Before [this change](
https://gerrit.openbmc-project.xyz/c/openbmc/dbus-sensors/+/18963), cpu
sensor information can be exposed to dbus.

By checking the code,I found that pingTimer causes detectCpu to be executed
every 1s, and the detectCpu function calls
creationTimer.expires_from_now(3s/5s), which causes the callback of
creationTimer to only enter the cancel
state(boost::asio::error::operation_aborted).

Only when all the cpu configured in the entity-mangaer are detected will
stop pinging.

Is this a bug ?

Regards

John

[-- Attachment #2: Type: text/html, Size: 1071 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [cpusensor] pingTimer and creationTimer are conflict??
  2019-04-02  6:14 [cpusensor] pingTimer and creationTimer are conflict?? John Wang
@ 2019-04-02 16:17 ` Jae Hyun Yoo
  2019-04-02 19:22   ` Jae Hyun Yoo
  0 siblings, 1 reply; 3+ messages in thread
From: Jae Hyun Yoo @ 2019-04-02 16:17 UTC (permalink / raw)
  To: John Wang; +Cc: OpenBMC Maillist

On 4/1/2019 11:14 PM, John Wang wrote:
> Hi Jae,
> 
> When two cpus are configured in the entity-manager and there is only one 
> cpu on the motherboard, the cpusensor service cannot expose cpu sensor 
> information to dbus.
> Before [this 
> change](https://gerrit.openbmc-project.xyz/c/openbmc/dbus-sensors/+/18963), 
> cpu sensor information can be exposed to dbus.
> 
> By checking the code,I found that pingTimer causes detectCpu to be 
> executed every 1s, and the detectCpu function calls 
> creationTimer.expires_from_now(3s/5s), which causes the callback of 
> creationTimer to only enter the cancel 
> state(boost::asio::error::operation_aborted).
> 
> Only when all the cpu configured in the entity-mangaer are detected will 
> stop pinging.
> 
> Is this a bug ?

Hi John,

Ah, yeah, there is. That's a bug. In that case, detectCpu() will be
repeatedly called every second and resets the 3s creationTimer so
createSensors() will never be called.

Thanks for reporting the issue. I'll submit a patch soon.

Regards,

Jae

> Regards
> 
> John
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [cpusensor] pingTimer and creationTimer are conflict??
  2019-04-02 16:17 ` Jae Hyun Yoo
@ 2019-04-02 19:22   ` Jae Hyun Yoo
  0 siblings, 0 replies; 3+ messages in thread
From: Jae Hyun Yoo @ 2019-04-02 19:22 UTC (permalink / raw)
  To: John Wang; +Cc: OpenBMC Maillist

On 4/2/2019 9:17 AM, Jae Hyun Yoo wrote:
> On 4/1/2019 11:14 PM, John Wang wrote:
>> Hi Jae,
>>
>> When two cpus are configured in the entity-manager and there is only 
>> one cpu on the motherboard, the cpusensor service cannot expose cpu 
>> sensor information to dbus.
>> Before [this 
>> change](https://gerrit.openbmc-project.xyz/c/openbmc/dbus-sensors/+/18963), 
>> cpu sensor information can be exposed to dbus.
>>
>> By checking the code,I found that pingTimer causes detectCpu to be 
>> executed every 1s, and the detectCpu function calls 
>> creationTimer.expires_from_now(3s/5s), which causes the callback of 
>> creationTimer to only enter the cancel 
>> state(boost::asio::error::operation_aborted).
>>
>> Only when all the cpu configured in the entity-mangaer are detected 
>> will stop pinging.
>>
>> Is this a bug ?
> 
> Hi John,
> 
> Ah, yeah, there is. That's a bug. In that case, detectCpu() will be
> repeatedly called every second and resets the 3s creationTimer so
> createSensors() will never be called.
> 
> Thanks for reporting the issue. I'll submit a patch soon.

I made a patch. Please try this patch:
https://gerrit.openbmc-project.xyz/c/openbmc/dbus-sensors/+/20056

Thanks,

Jae

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-02 19:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-02  6:14 [cpusensor] pingTimer and creationTimer are conflict?? John Wang
2019-04-02 16:17 ` Jae Hyun Yoo
2019-04-02 19:22   ` Jae Hyun Yoo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.