From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, "Daniel P. Berrangé" <berrange@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH] tests/functional: Use more fine-grained locking when looking for free ports
Date: Mon, 25 Aug 2025 11:51:44 +0300 [thread overview]
Message-ID: <CAAjaMXY1fcTZ517dmrd+nAt4WUEcR3U2bbmM3ZytDkXREEX6TA@mail.gmail.com> (raw)
In-Reply-To: <b60a9e7e-6f79-442d-8a4c-2acfbbf0688b@redhat.com>
On Mon, Aug 25, 2025 at 11:47 AM Thomas Huth <thuth@redhat.com> wrote:
>
> On 25/08/2025 09.30, Manos Pitsidianakis wrote:
> > On Thu, Aug 21, 2025 at 12:49 PM Thomas Huth <thuth@redhat.com> wrote:
> >>
> >> From: Thomas Huth <thuth@redhat.com>
> >>
> >> Currently, we have one lock that is held while a test is looking for
> >> free ports. However, we are also using different ranges for looking
> >> for free ports nowadays (PORTS_START is based on the PID of the process),
> >> so instead of using only one lock, we should rather use a lock per
> >> range instead. This should help to allow running more tests in parallel.
> >>
> >> While we're at it, also create the lock files without executable bit
> >> (mode is 0o777 by default).
> >>
> >
> > (Unrelated to this patch but the file itself)
> >
> > Hm. AF_INET supports binding to port 0 to connect to any available
> > port (see man 7 ip). Is this not portable?
>
> No clue ... but in that case, we'd need to go back to only use one lock for
> all tests that are running in parallel, so it might cause some more contention?
IIUC there would be no need for locking, since the kernel would return
a free port for each process.
I can submit a patch btw, but thought I could ask first.
--
Manos Pitsidianakis
Emulation and Virtualization Engineer at Linaro Ltd
next prev parent reply other threads:[~2025-08-25 8:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 9:47 [PATCH] tests/functional: Use more fine-grained locking when looking for free ports Thomas Huth
2025-08-21 10:00 ` Daniel P. Berrangé
2025-08-25 7:30 ` Manos Pitsidianakis
2025-08-25 8:47 ` Thomas Huth
2025-08-25 8:51 ` Manos Pitsidianakis [this message]
2025-08-25 9:04 ` Thomas Huth
2025-08-25 9:10 ` Manos Pitsidianakis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAjaMXY1fcTZ517dmrd+nAt4WUEcR3U2bbmM3ZytDkXREEX6TA@mail.gmail.com \
--to=manos.pitsidianakis@linaro.org \
--cc=berrange@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).