On 24 November 2016 at 21:07, Maxim Uvarov <maxim.uva...@linaro.org> wrote:
> Christophe,
>
> with this patch series and without it I see odp_pktio_perf hangs in
> background.
> And it looks like accept() never pass. Interesting is that Cunit reported
> this test as
> passed and actually it's in background. Other apps looks like ok.
>
> 81    ../sysdeps/unix/syscall-template.S: No such file or directory.
> (gdb) bt
> #0  0x00002b030bcd46c0 in __accept_nocancel () at
> ../sysdeps/unix/syscall-template.S:81
> #1  0x00002b030ba1bfe5 in wait_requests (sock=<optimized out>) at
> _fdserver.c:551
> #2  _odp_fdserver_init_global () at _fdserver.c:633
> #3  0x00002b030ba23c82 in odp_init_global
> (instance=instance@entry=0x7ffdf2199138, params=params@entry=0x0,
>     platform_params=platform_params@entry=0x0) at odp_init.c:114
> #4  0x0000000000401ead in main (argc=1, argv=0x7ffdf2199298) at
> odp_pktio_perf.c:1030
> (gdb) up
> #1  0x00002b030ba1bfe5 in wait_requests (sock=<optimized out>) at
> _fdserver.c:551
> 551            c_socket = accept(sock, (struct sockaddr *)&remote,
> &addr_sz);
> (gdb) c
> Continuing.
> ^C^C^C^C
>
>
> $sudo strace -p 31410 -ff
> Process 31410 attached
> accept(3,
>
> Can you reproduce that? it's not root user.
>
> Maxim.
>
>

Hi Maxim,

I don't see any obvious hanging when running,  but I am not sure
either what you did run and what problem you tried to solve when
calling gdb.

>From your debug printout it looks normal:
My assumption is that you have
"set follow-fork-mode child" set for dbg, and therefore your debug
session followed the first forked child, which is the _fdserver.

_fdserver is waiting for file descricriptor convertion requests, which
only happens when shm_lookup() is performed between ODP-thread being
implemented as different process. So it is a rare event when running
in process mode, and it never occurs when running pthreads only.
At global_term() _fdserver also receives a msg to shutdown.
If ODP is killed, I guess the _fdserver should be killed too, as it is
a child process og the ODP instantiation process.

So nothing in your mail seems strange to me.
Not really sure what the original problem is, though.

Here is a log of a odp/test/common_plat/performance/odp_pktio_perf run
for me, if that can help...


erachmi@erachmi-ericsson:~/linaro/ODP/odp$
/home/erachmi/linaro/ODP/odp/test/common_plat/performance/odp_pktio_perf
odp_system_info.c:97:default_huge_page_size():defaut hp size is 2048 kB
odp_system_info.c:97:default_huge_page_size():defaut hp size is 2048 kB
_ishm.c:1361:_odp_ishm_init_global():Huge pages mount point is: /dev/hugepages
_ishmphy.c:63:_odp_ishmphy_book_va():VA Reserved: 0x7f65365a2000, len=0x20200000
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=0, fd=3
_fdserver.c:459:handle_request():storing {ctx=1, key=0}->fd=5
_ishm.c:444:create_file():open failed for
/dev/hugepages/odp-7625-ishm-_odp_pool_table: Permission denied.
_ishm.c:848:_odp_ishm_reserve():No huge pages, fall back to normal
pages. check: /proc/sys/vm/nr_hugepages.
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=1, fd=4
_fdserver.c:459:handle_request():storing {ctx=1, key=1}->fd=6
odp_pool.c:88:odp_pool_init_global():
Pool init global
odp_pool.c:89:odp_pool_init_global():  odp_buffer_hdr_t size 328
odp_pool.c:90:odp_pool_init_global():  odp_packet_hdr_t size 480
odp_pool.c:91:odp_pool_init_global():
odp_queue.c:105:odp_queue_init_global():Queue init ...
_ishm.c:444:create_file():open failed for
/dev/hugepages/odp-7625-ishm-odp_queues: Permission denied.
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=2, fd=5
_fdserver.c:459:handle_request():storing {ctx=1, key=2}->fd=7
odp_queue.c:130:odp_queue_init_global():done
odp_queue.c:131:odp_queue_init_global():Queue init global
odp_queue.c:133:odp_queue_init_global():  struct queue_entry_s size 320
odp_queue.c:135:odp_queue_init_global():  queue_entry_t size        320
odp_queue.c:136:odp_queue_init_global():
odp_schedule.c:201:schedule_init_global():Schedule init ...
_ishm.c:444:create_file():open failed for
/dev/hugepages/odp-7625-ishm-odp_scheduler: Permission denied.
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=3, fd=6
_fdserver.c:459:handle_request():storing {ctx=1, key=3}->fd=8
odp_schedule.c:251:schedule_init_global():done
_ishm.c:444:create_file():open failed for
/dev/hugepages/odp-7625-ishm-odp_pktio_entries: Permission denied.
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=4, fd=7
_fdserver.c:459:handle_request():storing {ctx=1, key=4}->fd=9
 PKTIO: initialized loop interface.
 PKTIO: initialized pcap interface.
 PKTIO: initialized socket mmap, use export
ODP_PKTIO_DISABLE_SOCKET_MMAP=1 to disable.
 PKTIO: initialized socket mmsg,use export
ODP_PKTIO_DISABLE_SOCKET_MMSG=1 to disable.
odp_timer.c:1002:odp_timer_init_global():Using lock-less timer implementation
_ishm.c:444:create_file():open failed for
/dev/hugepages/odp-7625-ishm-crypto_pool: Permission denied.
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=5, fd=8
_fdserver.c:459:handle_request():storing {ctx=1, key=5}->fd=10
_ishm.c:444:create_file():open failed for
/dev/hugepages/odp-7625-ishm-shm_odp_cos_tbl: Permission denied.
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=6, fd=9
_fdserver.c:459:handle_request():storing {ctx=1, key=6}->fd=11
_ishm.c:444:create_file():open failed for
/dev/hugepages/odp-7625-ishm-shm_odp_pmr_tbl: Permission denied.
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=7, fd=10
_fdserver.c:459:handle_request():storing {ctx=1, key=7}->fd=12
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=8, fd=11
_fdserver.c:459:handle_request():storing {ctx=1, key=8}->fd=13
_ishm.c:444:create_file():open failed for
/dev/hugepages/odp-7625-ishm-test_globals.rx_stats: Permission denied.
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=9, fd=12
_fdserver.c:459:handle_request():storing {ctx=1, key=9}->fd=14
_ishm.c:444:create_file():open failed for
/dev/hugepages/odp-7625-ishm-test_globals.tx_stats: Permission denied.
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=10, fd=13
_fdserver.c:459:handle_request():storing {ctx=1, key=10}->fd=15
_ishm.c:444:create_file():open failed for
/dev/hugepages/odp-7625-ishm-pkt_pool_transmit: Permission denied.
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=11, fd=14
_fdserver.c:459:handle_request():storing {ctx=1, key=11}->fd=16
_ishm.c:444:create_file():open failed for
/dev/hugepages/odp-7625-ishm-pkt_pool_loop: Permission denied.
_fdserver.c:275:_odp_fdserver_register_fd():FD client register:
pid=7625 key=12, fd=15
_fdserver.c:459:handle_request():storing {ctx=1, key=12}->fd=17
odp_packet_io.c:216:setup_pktio_entry():loop uses loop
Starting test with params:
Transmit workers:     2
Receive workers:       2
Duration (seconds):   1
Transmit batch length: 32
Receive batch length: 32
Packet receive method: schedule
Interface(s):         loop
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
PPS: 1000000  Succeeded: Yes  TxPkts: 1000000  RxPkts: 1000000
DropPkts: 0
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
PPS: 2000000  Succeeded: Yes  TxPkts: 2000000  RxPkts: 2000000
DropPkts: 0
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
PPS: 4000000  Succeeded: No   TxPkts: 3514112  RxPkts: 3514112
DropPkts: 0
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
PPS: 3000000  Succeeded: Yes  TxPkts: 3000064  RxPkts: 3000064
DropPkts: 0
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
PPS: 3500000  Succeeded: Yes  TxPkts: 3489216  RxPkts: 3489216
DropPkts: 0
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
PPS: 3750000  Succeeded: No   TxPkts: 3518112  RxPkts: 3518112
DropPkts: 0
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
PPS: 3625000  Succeeded: No   TxPkts: 3513664  RxPkts: 3513664
DropPkts: 0
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
linux.c:273:odpthread_run_start_routine():helper: ODP worker thread
started as linux pthread. (pid=7625)
PPS: 3562500  Succeeded: No   TxPkts: 3521728  RxPkts: 3521728
DropPkts: 0
Maximum packet rate: 3500000 PPS (1228 Mbps)
_fdserver.c:321:_odp_fdserver_deregister_fd():FD client deregister:
pid=7625 key=12
_fdserver.c:513:handle_request():drop {ctx=1, key=12}->fd=17
_fdserver.c:321:_odp_fdserver_deregister_fd():FD client deregister:
pid=7625 key=11
_fdserver.c:513:handle_request():drop {ctx=1, key=11}->fd=16
_fdserver.c:321:_odp_fdserver_deregister_fd():FD client deregister:
pid=7625 key=8
_fdserver.c:513:handle_request():drop {ctx=1, key=8}->fd=13
erachmi@erachmi-ericsson:~/linaro/ODP/odp$

>
> On 11/24/16 19:22, Christophe Milard wrote:
>>
>> since v8:
>>      - commit msg typo fix (Maxim)
>>      - use snprintf() instead of sprintf() (Maxim)
>>      - better handling of error cases (Maxim)
>>
>> since v7:
>>      - Fix not to use single-va memory when the requirement alignment
>> exactely
>>         matches the page size (Maxim)
>>      - patch to clean-up all odp-<PID>-* files in /tmp and in the huge
>>         page mount point at startup (in case some previous killed /
>> crashed
>>         ODP instance did not clean properly.) (Maxim)
>>
>> since v6:
>>      - All points according to Petri's request i.e.:
>>         Odp_shm_find_external() changed again: now odp_shm_import().
>>         Function description updated.
>>
>> since v5:
>>      -fixed doxygen issue (Bill)
>>
>> since v4:
>>      - All points of v3 according to Petri's request i.e.:
>>         -All API patches merges as one single patch.
>>         -lock flag removed: memory is now always locked.
>>         -alignement and flag inherited from remote ODP instance when
>> sharing
>>          memory.
>>         -function name changed to: odp_shm_find_external().
>>
>> since v3:
>> -Comments from Petri addressed, with exceptions for:
>>      -Patches related to the API not merged as they are part of different
>>       functions.
>>      -Lock flag not removed: Why wouldn't any ODP application being
>> allowed
>>       to reserve memory for slower (control or other things) businnes.
>>       Should really ALL shared memory bee locked?
>>      -Alignment and flag parameter of odp_shm_reserve_external() kept:
>>       The alignment (and some flags) affect virtual memory, which is
>> different
>>       between for each ODP instance.
>>      -function name odp_shm_reserve_external() kept, as this function does
>>       return a new handle (which requires free() as any handle would)
>>         These 4 items are sheduled for arch call today
>>
>> since v2:
>> -some minor changes on the doc (Bill)
>> -doc for the ODP_SHM_EXPORT flag (Christophe)
>> -reduction of memory reguirement for shm tests (Mattias)
>>
>> since v1:
>> -flag _ODP_SHM_PROC_NOCREAT and _ODP_SHM_O_EXCL get new values
>> (but remain useless: Should be removed when IPC is updated)  (Maxim)
>>
>> -In get_ishm_flags(), odp_shm_capability() local variable flgs renamed
>> (for be better distinction from other "flags" variable. (Maxim)
>>
>> -Added doc updates with shm api extensions.
>>
>> This Patch series aims at using _ishm as north API memory allocator.
>> odp_shared_memory.c just becomes a wrapper around _ishm.
>> _ishm supports "process mode", i.e. memory allocated  with _ishm
>> is sharable by all ODP threads of a given ODP instance, regardless of
>> thread type (e.g. process) or thread creation time (for time).
>>
>> NOTE: This patch series will break IPC: This is due to the fact that
>> IPC relied on a "special case" in the former memory allocator that broke
>> ODP instance scoping. I don't think this should be kept.
>> I have included in this patch series a function to share memory between
>> designated ODP instances. If we want to have IPC, it should use that.
>>
>> Christophe Milard (15):
>>    linux-gen: _ishm: fix for alignment request matching page size
>>    linux-gen: init: removing possible obsolete ODP files at startup
>>    linux-gen: _ishm: create description file for external memory sharing
>>    linux-gen: _ishm: allow memory alloc/free at global init/term
>>    linux-gen: use ishm as north API mem allocator
>>    linux-gen: push internal flag definition
>>    api: shm: add flags to shm_reserve and function to find external mem
>>    linux-gen: shm: new ODP_SHM_SINGLE_VA flag implementation
>>    test: api: shmem: new proper tests for shm API
>>    linux-gen: _ishm: adding function to map memory from other ODP
>>    linux-gen: shm: add flag and function to share memory between ODP
>>      instances
>>    test: linux-gen: api: shmem: test sharing memory between ODP instances
>>    linux-gen: _ishm: cleaning remaining block at odp_term_global
>>    linux_gen: _ishm: decreasing the number of error messages when no huge
>>      pages
>>    doc: updating docs for the shm interface extension
>>
>>   doc/users-guide/users-guide.adoc                   |  68 +-
>>   include/odp/api/spec/shared_memory.h               |  46 +-
>>   platform/linux-generic/_ishm.c                     | 460 ++++++++++----
>>   platform/linux-generic/include/_ishm_internal.h    |   6 +
>>   platform/linux-generic/include/odp_internal.h      |   5 -
>>   platform/linux-generic/include/odp_shm_internal.h  |   4 +-
>>   platform/linux-generic/odp_init.c                  |  79 ++-
>>   platform/linux-generic/odp_shared_memory.c         | 412 ++----------
>>   test/common_plat/validation/api/shmem/shmem.c      | 687
>> ++++++++++++++++++++-
>>   test/common_plat/validation/api/shmem/shmem.h      |   5 +-
>>   test/linux-generic/validation/api/shmem/.gitignore |   3 +-
>>   .../linux-generic/validation/api/shmem/Makefile.am |  22 +-
>>   .../validation/api/shmem/shmem_linux.c             | 220 +++++--
>>   .../api/shmem/{shmem_odp.c => shmem_odp1.c}        |  10 +-
>>   .../api/shmem/{shmem_odp.h => shmem_odp1.h}        |   0
>>   .../validation/api/shmem/shmem_odp2.c              |  95 +++
>>   .../validation/api/shmem/shmem_odp2.h              |   7 +
>>   17 files changed, 1526 insertions(+), 603 deletions(-)
>>   rename test/linux-generic/validation/api/shmem/{shmem_odp.c =>
>> shmem_odp1.c} (81%)
>>   rename test/linux-generic/validation/api/shmem/{shmem_odp.h =>
>> shmem_odp1.h} (100%)
>>   create mode 100644 test/linux-generic/validation/api/shmem/shmem_odp2.c
>>   create mode 100644 test/linux-generic/validation/api/shmem/shmem_odp2.h
>>
>

Reply via email to