]> git.alsa-project.org Git - alsa-utils.git/commit
axfer: test: use memfd_create() for container-test
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 11 Mar 2021 05:21:40 +0000 (14:21 +0900)
committerJaroslav Kysela <perex@perex.cz>
Thu, 11 Mar 2021 08:30:02 +0000 (09:30 +0100)
commit2314d746b9009838523ba24c377253ae656c9f36
tree03c0299a0d64175cc1d02f14f207e71a90a121ef
parentc45d994867cbfeaf5b8f0ef80511da06c80d4c90
axfer: test: use memfd_create() for container-test

The container test program writes audio data frame to file, and read
them from the file, then validate them. For the operations, usage of
any in-memory file is good to shorten time of overall operations.

This commit uses shm via memfd_create(). As a result, overall time to
run is shorten one half of before, depending on machine environment.

I note that we can achieve the same result by using O_TMPFILE flag in
open(2) system call, however the implementation of O_TMPFILE is to add
i-node without name on underling file system, thus it has overhead
depending on implementation in each file system. On the other hand,
memfd_create() is directly relevant to shm and expected to be less
overhead.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
axfer/test/container-test.c