Regarding Chromium on Android Threads.

341 views
Skip to first unread message

soh...@chromium.org

unread,
Mar 12, 2018, 3:16:27 AM3/12/18
to Chromium-dev
Hi,

Came across this thread called "ileged_process0" (most likely priveleged_process0). It has the same TID as the GPU PID itself.
Any idea what tasks are done in this thread ? We know most imp tasks are done in CrGpuMain.

Just listing all the gpu process threads for reference on Android.

* 1    Thread 26994.26994 "ileged_process0" 0xe9aa8e04 in __epoll_pwait () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  2    Thread 26994.27001 "Jit thread pool" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  3    Thread 26994.27002 "Signal Catcher" 0xe9aa9170 in __rt_sigtimedwait () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  4    Thread 26994.27004 "ReferenceQueueD" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  5    Thread 26994.27005 "FinalizerDaemon" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  6    Thread 26994.27006 "FinalizerWatchd" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  7    Thread 26994.27007 "HeapTaskDaemon" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  8    Thread 26994.27008 "Binder:26994_1" 0xe9aa8f44 in __ioctl () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  9    Thread 26994.27009 "Binder:26994_2" 0xe9aa8f44 in __ioctl () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  10   Thread 26994.27012 "Profile Saver" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  11   Thread 26994.27013 "CrGpuMain" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  12   Thread 26994.27019 "mali-mem-purge" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  13   Thread 26994.27020 "mali-utility-wo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  14   Thread 26994.27021 "mali-utility-wo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  15   Thread 26994.27022 "mali-utility-wo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  16   Thread 26994.27023 "mali-utility-wo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  17   Thread 26994.27024 "mali-utility-wo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  18   Thread 26994.27025 "mali-utility-wo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  19   Thread 26994.27026 "mali-utility-wo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  20   Thread 26994.27027 "mali-utility-wo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  21   Thread 26994.27028 "mali-cmar-backe" 0xe9aa8fec in __ppoll () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  22   Thread 26994.27029 "mali-hist-dump" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  23   Thread 26994.27030 "TaskSchedulerSe" 0xe9aa8e04 in __epoll_pwait () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  24   Thread 26994.27031 "TaskSchedulerBa" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  25   Thread 26994.27032 "TaskSchedulerBa" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  26   Thread 26994.27033 "TaskSchedulerFo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  27   Thread 26994.27034 "TaskSchedulerFo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  28   Thread 26994.27035 "Chrome_ChildIOT" 0xe9aa8e04 in __epoll_pwait () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so


Note we create a similar thread (dboxed_process0) for renderer sandbox too,

* 1    Thread 26965.26965 "dboxed_process0" 0xe9aa8e04 in __epoll_pwait () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  2    Thread 26965.26970 "Jit thread pool" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  3    Thread 26965.26971 "Signal Catcher" 0xe9aa9170 in __rt_sigtimedwait () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  4    Thread 26965.26973 "ReferenceQueueD" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  5    Thread 26965.26974 "FinalizerDaemon" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  6    Thread 26965.26975 "FinalizerWatchd" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  7    Thread 26965.26976 "HeapTaskDaemon" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  8    Thread 26965.26977 "Binder:26965_1" 0xe9aa8f44 in __ioctl () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  9    Thread 26965.26978 "Binder:26965_2" 0xe9aa8f44 in __ioctl () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  10   Thread 26965.26979 "Thread-2" 0xe9aa9e28 in nanosleep () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  11   Thread 26965.26990 "CrRendererMain" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  12   Thread 26965.27076 "TaskSchedulerSe" 0xe9aa8e04 in __epoll_pwait () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  13   Thread 26965.27077 "TaskSchedulerBa" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  14   Thread 26965.27078 "TaskSchedulerBa" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  15   Thread 26965.27080 "TaskSchedulerFo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  16   Thread 26965.27081 "Chrome_ChildIOT" 0xe9aa8e04 in __epoll_pwait () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  17   Thread 26965.27082 "GpuMemoryThread" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  18   Thread 26965.27083 "File thread" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  19   Thread 26965.27084 "Compositor" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  20   Thread 26965.27085 "CompositorTileW" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  21   Thread 26965.27086 "CompositorTileW" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  22   Thread 26965.27322 "ScriptStreamer " 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so
  23   Thread 26965.32194 "TaskSchedulerFo" 0xe9a774b4 in syscall () from /tmp/sohan-adb-gdb-libs/system/lib/libc.so


Thanks,
Sohan

David Turner

unread,
Mar 12, 2018, 5:02:26 AM3/12/18
to soh...@chromium.org, Chromium-dev
As far as I understand, privileged_processN is the name of the main Android thread for our services-in-an-Android sandboxed process. I.e. this is the thread that starts the process (hence why it has the same TID as the PID), while sandboxed_processN is the same, but for services that also run in an "android:isolatedProcess" sandbox.

Not sure what these threads are used for, except servicing regular Android service requests (onBind(), etc).


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/18074992-421b-4187-ab7c-0ad1abab7801%40chromium.org.

soh...@chromium.org

unread,
Mar 12, 2018, 3:29:16 PM3/12/18
to Chromium-dev, soh...@chromium.org
I see. Thanks. So its a Java thread ? Any idea who forks it ? Is it somewhere in Chromium Java code ?

Thanks.

Torne (Richard Coles)

unread,
Mar 12, 2018, 3:50:40 PM3/12/18
to soh...@chromium.org, Chromium-dev
This is the actual main thread of the process, it's not created from another thread, and it's running the event loop defined by ActivityThread from android itself. It exists before any chromium code is loaded at all (it's this thread which loads chromium and starts any execution)

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.

soh...@chromium.org

unread,
Mar 12, 2018, 4:20:57 PM3/12/18
to Chromium-dev, soh...@chromium.org
Ah I see. Thanks. 

Not sure if its the best idea, but is there some merit in running the main thread which does the gpu work (CrGpuMain) or rendering work (CrRenderMain) to this process threads ? I guess for browser process we do something similar for the browser main thread ?

Thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

Bo Liu

unread,
Mar 12, 2018, 5:10:09 PM3/12/18
to soh...@chromium.org, Chromium-dev
CrGpuMain and CrRenderMain are not actually the main thread of those corresponding processes on android. They are just a new thread created from java: https://cs.chromium.org/chromium/src/base/android/java/src/org/chromium/base/process_launcher/ChildProcessService.java?rcl=d42648dd9f14c535b1e98a93e85d5a99bc9b0599&l=152

I'm not sure why it was written like that originally, but I assume it had something to do with performance, or maybe more easily share the desktop child process start up code. I've wondered recently as well whether CrFooMain should use the actual main thread of the child process just to reduce "surprising-ness" of this setup. Haven't done any work toward that though.

For browser process, BrowserThread::UI is the main thread of the process, same as desktop.

Reply all
Reply to author
Forward
0 new messages