[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240626094415.7ae5afe8@kernel.org>
Date: Wed, 26 Jun 2024 09:44:15 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Petr Machata <petrm@...dia.com>
Cc: Przemek Kitszel <przemyslaw.kitszel@...el.com>,
<netdev@...r.kernel.org>, <edumazet@...gle.com>, <pabeni@...hat.com>,
<willemdebruijn.kernel@...il.com>, <leitao@...ian.org>,
<davem@...emloft.net>
Subject: Re: [RFC net-next 1/2] selftests: drv-net: add ability to schedule
cleanup with defer()
On Wed, 26 Jun 2024 11:19:08 +0200 Petr Machata wrote:
> >> There is a global action queue, flushed by ksft_run(). We could support
> >> function level defers too, I guess, but there's no immediate need..
> >
> > That would be a must have for general solution, would it require some
> > boilerplate code at function level?
>
> Presumably you'd need a per-function defer pool.
>
> Which would be naturally modeled as a context manager, but I promised
> myself I'd shut up about that.
No preference on the internal mechanism :)
The part I was unsure about was whether in this case test writer will
want to mix the contexts:
fq = FuncDeferQueue()
fq.defer(...) # this one is called when function exits
defer(...) # this one is global
or not:
defer_func_context()
# any defer after this is assumed to be func-level
defer(...)
so probably best to wait until we have some real examples.
Powered by blists - more mailing lists