[dpdk-dev] [EXT] Re: [PATCH v2] test: fix process dup fd close
Krzysztof Kanas
kkanas at marvell.com
Mon Nov 4 08:52:22 CET 2019
On 19-10-30 10:06, David Marchand wrote:
> External Email
>
> ----------------------------------------------------------------------
> On Mon, Sep 2, 2019 at 11:50 AM <kkanas at marvell.com> wrote:
> >
> > From: Krzysztof Kanas <kkanas at marvell.com>
> >
> > process_dup was intending to close it's own fd's but failed to do so
>
> A bit hard to digest, what is the problem that you want to fix?
>
> Thanks.
I don't recall the exact test name but I think it was test_eal_flags
that is included in the meson test suite for fast tests.
This test was timing out on ARM64.
Using strace (-f -c IIRC) showed that the process is spending most of
the time in access syscall trying to close not existing fd's.
- for (fd = getdtablesize(); fd > 2; fd-- ) {
- snprintf(path, sizeof(path), "/proc/" exe "/fd/%d", fd);
- if (access(path, F_OK) == 0)
- close(fd);
So the simplest way to do so is to close only the opened fd's not
blindly try every possible one.
Also I think the code was wrong in another way as it tried to iterate
over /proc/ *exe* /fd/%d/ when it should iterate over /proc/ *self*
/fd/, so either the comment bove the for loop was wrong or the code was
incorrect.
>
>
> --
> David Marchand
>
--
-
Regards,
Krzysztof(Chris) Kanas
More information about the dev
mailing list