trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: March 2014

Re: [trinity-devel] BUG - tdepowersave Grabbing 97% of CPU - overheating laptop

From: "David C. Rankin" <drankinatty@...>
Date: Fri, 07 Mar 2014 00:17:47 -0600
On 03/06/2014 11:53 PM, David C. Rankin wrote:
> On 03/06/2014 11:49 PM, David C. Rankin wrote:
>> On 03/06/2014 10:29 PM, David C. Rankin wrote:
>>> On 03/06/2014 09:57 PM, David C. Rankin wrote:
>>>> Slavek,
>>>>
>>>>   We need to check your and Francios setup. I think your are still using the
>>>> init-script to launch tdm which invokes systemd-sysvcompat (/usr/bin/init)
>>>> instead of pure-systemd. My goal is to have TDE function with pure-systemd.
>>>
>>>   Or at least in Francios case it is. With arch, you have tdm.service to user
>>> pure-systemd to manager tdm. The tdm.service file for Arch is:
>>>
>>> $ cat ~/tde/pbpkg/tde-tdebase/tdm.service
>>> [Unit]
>>> Description=TDE Display Manager
>>> After=systemd-user-sessions.service
>>>
>>> [Service]
>>> ExecStart=/opt/trinity/bin/tdm
>>>
>>> [Install]
>>> Alias=display-manager.service
>>>
>>>   This is pure-systed. There is no wrapper script that ultimately launches some
>>> wrapper with "exec something".
>>>
>>>   In Francios setup on Mageia, that is exactly what happens. The Mageia service
>>> file is:
>>>
>>> cat prefdm.service
>>> [Unit]
>>> Description=Display Manager
>>> After=livesys-late.service systemd-user-sessions.service
>>>
>>> # On Mageia gdm/X11 is on tty1. We explicitly cancel the getty here to
>>> # avoid any races around that.
>>> # Do not stop plymouth, it is done in prefdm if required (or left to the dm)
>>> Conflicts=getty@... plymouth-quit.service
>>> After=getty@... plymouth-quit.service
>>> OnFailure=display-manager-failure.service
>>>
>>> [Service]
>>> ExecStart=/etc/X11/prefdm -nodaemon
>>> Restart=always
>>> RestartSec=0
>>> IgnoreSIGPIPE=no
>>>
>>>   That service file does not launch a display manager, it calls the wrapper
>>> script prefdm which essentially calls /etc/X11/lookupdm to get the name of the
>>> display manager via (45TDE and 45TDE.conf) and then does:
>>>
>>> preferred=`/etc/X11/lookupdm "$dm"`
>>> [ -n "$preferred" ] && exec $preferred "$@" >/dev/null 2>&1 </dev/null
>>>
>>>   That isn't systemd -- that is systemd-sysvcompat. That setup just relies on
>>> getting "EXEC=/opt/trinity/bin/tdm" from 45TDE.conf and then launching it as an
>>> init script.
>>>
>>>   We need TDE to work with systemd.
>>>
>>
>> Attempting to launch tdm with an inti script in arch does not fix the user
>> session problem. After launching with the old init, I still get:
>>
>> cat XDG_SESSION_ID-init.txt
>> NAutoVTs=6
>> KillExcludeUsers=root
>> KillUserProcesses=no
>> IdleHint=no
>> IdleSinceHint=1394169840146533
>> IdleSinceHintMonotonic=610563642
>> BlockInhibited=handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
>> InhibitDelayMaxUSec=5s
>> HandlePowerKey=poweroff
>> HandleSuspendKey=suspend
>> HandleHibernateKey=hibernate
>> HandleLidSwitch=suspend
>> IdleAction=ignore
>> IdleActionUSec=30min
>> PreparingForShutdown=no
>> PreparingForSleep=no
>>
>>   ( I do get more shutdown/hibernate/suspend options though )
>>
> 
> Even though user tracking isn't configured in XDG_SESSION_ID when launched via
> init, it does solve the tdepowersave CPU @ 100% problem. It is behaving rather
> nicely. No logs filling up, CPU consumption between 2.2-3.3%.
> 

If I launch tdm with inits in Arch, it also breaks the tdeio_sftp fix (somehow):

00:15 valhalla:~> ps ax | grep tdeio
  818 ?        S      0:00 tdeio_file [tdeinit] file
/tmp/tdesocket-david/tdelauncherIwNs2T.s
  967 ?        S      0:00 tdeio_file [tdeinit] file
/tmp/tdesocket-david/tdelauncherIwNs2T.s
  968 ?        S      0:00 tdeio_sftp [tdeinit] sftp
/tmp/tdesocket-david/tdelauncherIwNs2T.s
  982 ?        S      0:00 tdeio_uiserver [tdeinit]
  983 ?        S      0:00 tdeio_file [tdeinit] file
/tmp/tdesocket-david/tdelauncherIwNs2T.s
  984 ?        S      0:00 tdeio_sftp [tdeinit] sftp
/tmp/tdesocket-david/tdelauncherIwNs2T.s
  991 pts/1    S+     0:00 grep tdeio


-- 
David C. Rankin, J.D.,P.E.