From: Michal Simek <michal.simek@amd.com>
To: Jerome Forissier <jerome.forissier@linaro.org>, u-boot@lists.denx.de
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
Bin Meng <bmeng.cn@gmail.com>,
Patrick Rudolph <patrick.rudolph@9elements.com>,
Sughosh Ganu <sughosh.ganu@linaro.org>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Raymond Mao <raymond.mao@linaro.org>
Subject: Re: [RFC PATCH 1/2] Introduce coroutines framework
Date: Tue, 21 Jan 2025 12:44:32 +0100 [thread overview]
Message-ID: <24dc7f4c-62bb-46e4-b7d7-6c3aa472c36f@amd.com> (raw)
In-Reply-To: <e17799b6938d4afe08b80fc20b70f4d3a81db848.1737380886.git.jerome.forissier@linaro.org>
On 1/20/25 14:50, Jerome Forissier wrote:
> Adds the COROUTINES Kconfig symbol which introduces a new internal API
> for coroutines support. As explained in the Kconfig file, this is meant
> to provide some kind of cooperative multi-tasking with the goal to
> improve performance by overlapping lengthy operations.
>
> The API as well as the implementation is very much inspired from libaco
> [1]. The reference implementation is simplified to remove all things
> not needed in U-Boot, the coding style is updated, and the aco_ prefix
> is replaced by co_.
>
> I believe the stack handling could be simplified: the stack of the main
> coroutine could probably probably be used by the secondary coroutines
> instead of allocating a new stack dynamically.
>
> Only i386, x86_64 and aarch64 are supported at the moment. Other
> architectures need to provide a _co_switch() function in assembly.
>
> Only aarch64 has been tested.
I can't see the reason why to keep x86 around if it is not tested.
Licenses should be cleared for all files.
Also I think this mostly should target full u-boot and not really TPL/SPL as of
today.
I have applied this patch to measure time difference on kv260 and kd240 and
pretty much the time is the same.
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index 94160f4bd86c..18d2260b8c11 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -258,6 +258,7 @@ extern int udelay_yield;
efi_status_t efi_init_obj_list(void)
{
efi_status_t ret = EFI_SUCCESS;
+ ulong t0, t1;
#if CONFIG_IS_ENABLED(COROUTINES)
struct co_stack *stk = NULL;
struct co *main_co = NULL;
@@ -272,6 +273,7 @@ efi_status_t efi_init_obj_list(void)
/* Set up console modes */
efi_setup_console_size();
+ t0 = timer_get_us();
#if CONFIG_IS_ENABLED(COROUTINES)
main_co = co_create(NULL, NULL, 0, NULL, NULL);
if (!main_co) {
@@ -333,6 +335,9 @@ efi_status_t efi_init_obj_list(void)
efi_obj_list_initialized = ret;
}
#endif
+ t1 = timer_get_us();
+
+ printf("time counted %ld\n", t1 - t0);
/* Initialize variable services */
ret = efi_init_variables();
Please correct me if you have measured it differently.
Thanks,
Michal
next prev parent reply other threads:[~2025-01-21 11:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-20 13:50 [RFC PATCH 0/2] Coroutines Jerome Forissier
2025-01-20 13:50 ` [RFC PATCH 1/2] Introduce coroutines framework Jerome Forissier
2025-01-21 11:44 ` Michal Simek [this message]
2025-01-21 13:15 ` Jerome Forissier
2025-01-21 13:52 ` Michal Simek
2025-01-20 13:50 ` [RFC PATCH 2/2] efi_loader: optimize efi_init_obj_list() with coroutines Jerome Forissier
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=24dc7f4c-62bb-46e4-b7d7-6c3aa472c36f@amd.com \
--to=michal.simek@amd.com \
--cc=bmeng.cn@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jerome.forissier@linaro.org \
--cc=patrick.rudolph@9elements.com \
--cc=raymond.mao@linaro.org \
--cc=sjg@chromium.org \
--cc=sughosh.ganu@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/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