[riot-notifications] [RIOT-OS/RIOT] murdock: enable esp32-wroom-32 for CI testing (#11449)

Gunar Schorcht notifications at github.com
Mon Apr 29 11:56:42 CEST 2019


gschorcht commented on this pull request.



> @@ -22,9 +22,9 @@
 )
 
 EXPECTED_PS = (
-    '\tpid | state    Q | pri',
-    '\t  1 | pending  Q |  15',
-    '\t  2 | running  Q |   7'
+    r'\s+pid | state    Q | pri',
+    r'\s+1 | pending  Q |\s+\d+',

Yes, number of priority levels is simply to small if `esp_wifi` is used. If `esp_wifi` is used there are 3 additional high-priority threads:

- WiFi hardware handler `wifi` with priority 1
- WiFi event loop `wifi-event-loop` with priority 4 which is defined by the ESP32 SDK.
- WiFi netdev `netdev-esp-wifi` with priority 10 which is simply the priority defined by `GNRC_NETIF_PRIO = (THREAD_PRIORITY_MAIN - 5)`.

```
> ps
	pid | name                 | state    Q | pri | stack  ( used) | base addr  | current     
	  - | isr_stack            | -        - |   - |   2048 (  400) | 0x3ffb0220 | 0x3ffb0a20
	  1 | wifi-event-loop      | bl rx    _ |   4 |   2100 ( 1020) | 0x3ffaee18 | 0x3ffaf430 
	  2 | idle                 | pending  Q |  31 |   2048 (  448) | 0x3ffb4b80 | 0x3ffb51e0 
	  3 | main                 | running  Q |  15 |   3072 ( 1616) | 0x3ffb5380 | 0x3ffb5d00 
	  4 | pktdump              | bl rx    _ |  14 |   3072 (  560) | 0x3ffb9da0 | 0x3ffba770 
	  5 | ipv6                 | bl rx    _ |  12 |   2048 (  752) | 0x3ffb7890 | 0x3ffb7e40 
	  6 | udp                  | bl rx    _ |  13 |   2048 (  576) | 0x3ffbb3f0 | 0x3ffbb9b0 
	  7 | wifi                 | bl rx    _ |   1 |   3636 ( 1848) | 0x3ffbe004 | 0x3ffbec10 
	  8 | netdev-esp-wifi      | bl rx    _ |  10 |   2048 (  848) | 0x3ffb6490 | 0x3ffb6a10 
	  9 | RPL                  | bl rx    _ |  13 |   2048 (  492) | 0x3ffbabec | 0x3ffbb200 
	    | SUM                  |            |     |  24168 ( 8560)
```
If you would use the default number of priority levels, `THREAD_PRIORITY_MAIN` would be 7 and `GNRC_NETIF_PRIO` would be 2. This could lead to a deadlock situations because upper layer  `netdev-esp-wifi` has higher priority than lower layer thread `wifi-event-loop` which is dealing with events from hardware driver thread `wifi`. At least, there will be instabilities if thread `wifi-event-loop` can't handle events from WiFi hardware just in time.

Following log shows the priorities with default number of priority levels.
```
> ps
	pid | name                 | state    Q | pri | stack  ( used) | base addr  | current     
	  - | isr_stack            | -        - |   - |   2048 (  400) | 0x3ffb0220 | 0x3ffb0a20
	  1 | wifi-event-loop      | bl rx    _ |   4 |   2100 ( 1020) | 0x3ffaee18 | 0x3ffaf430 
	  2 | idle                 | pending  Q |  15 |   2048 (  416) | 0x3ffb4b40 | 0x3ffb51a0 
	  3 | main                 | running  Q |   7 |   3072 ( 1616) | 0x3ffb5340 | 0x3ffb5cc0 
	  4 | pktdump              | bl rx    _ |   6 |   3072 (  560) | 0x3ffb9d60 | 0x3ffba730 
	  5 | ipv6                 | bl rx    _ |   4 |   2048 (  752) | 0x3ffb7850 | 0x3ffb7e00 
	  6 | udp                  | bl rx    _ |   5 |   2048 (  576) | 0x3ffbb3b0 | 0x3ffbb970 
	  7 | wifi                 | bl rx    _ |   1 |   3636 ( 1864) | 0x3ffbdfc4 | 0x3ffbebd0 
	  8 | netdev-esp-wifi      | bl rx    _ |   2 |   2048 (  848) | 0x3ffb6450 | 0x3ffb69d0 
	  9 | RPL                  | bl rx    _ |   5 |   2048 (  492) | 0x3ffbabac | 0x3ffbb1c0 
	    | SUM                  |            |     |  24168 ( 8544)
```
It seems that there are too many threads with same priority. I don't know remember where, but I have read anywhere in Wiki or the online doc that each thread should have it's own priority since threads with same priority don't lead to a context switch as long as both are in state pending.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11449#discussion_r279300761
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190429/becf4b9f/attachment.html>


More information about the notifications mailing list