From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/1] lib: Multiply slow config only for a real tests
Date: Fri, 17 Jan 2025 10:16:03 +0100 [thread overview]
Message-ID: <20250117091603.GA742253@pevik> (raw)
In-Reply-To: <CAEemH2c82HAwMdWJ7a5WPLzHTJWA-dhunXuJQdt4WK4zWdpPYg@mail.gmail.com>
> On Fri, Jan 17, 2025 at 4:41 PM Petr Vorel <pvorel@suse.cz> wrote:
TL;DR: wrong patch, please ignore it.
...
> > +static inline int foo(unsigned int timeout)
> What is the foo() used for?
I'm sorry, I noticed this after sending as well. But got slow down due
TST_NO_DEFAULT_MAIN in tst_test.c as well.
> > +static inline int tst_multiply_on_slow_config(unsigned int timeout)
> > +{
> > +#ifndef TST_NO_DEFAULT_MAIN
> > + if (tst_has_slow_kconfig())
> > + timeout *= 4;
> > +#endif /* TST_NO_DEFAULT_MAIN */
> > + return timeout;
> > +}
> But the tst_test.c has defined the TST_NO_DEFAULT_MAIN macro
> so it will go complie with the second branch always.
> IOW, the tst_has_slow_kconfig() will never be performed.
Yes, you're right this would not work (it took me a while to find it as well).
I hoped we would have some smart evaluation which would allow not having to add
anything to files in testcases/lib/, but this will not work.
We can either combine your approach with this (have a new definition + static
function in tst_test.h) or use struct tst_test flag as Andrea suggested. I'm not
sure what is better, I slightly preferred the definition, because one day we
might want to get rid of struct tst_test workarounds in testcases/lib therefore
I would prefer not to add yet another.
FYI tst_test struct use is forced by code in safe_clone() lib/tst_test.c:
pid_t safe_clone(const char *file, const int lineno,
const struct tst_clone_args *args)
{
pid_t pid;
if (!tst_test->forks_child)
tst_brk(TBROK, "test.forks_child must be set!");
This could be also guarded by new definition. Then it should have probably a
different name than TST_NO_SLOW_KCONFIG_CHECK. Sure, we postpone this cleanup
after the release.
BTW we have TCONF on starvation.c. This test would work if we don't prolong it
even longer with tst_has_slow_kconfig(), thus might want to remove TCONF and
disable tst_has_slow_kconfig() there as well. We can do it with both ways.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-01-17 9:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-17 8:41 [LTP] [PATCH v2 1/1] lib: Multiply slow config only for a real tests Petr Vorel
2025-01-17 8:55 ` Li Wang
2025-01-17 9:16 ` Petr Vorel [this message]
2025-01-17 9:26 ` Li Wang
2025-01-17 9:34 ` Li Wang
2025-01-17 9:40 ` Cyril Hrubis
2025-01-17 9:57 ` Petr Vorel
2025-01-17 10:14 ` Cyril Hrubis
2025-01-17 10:28 ` Petr Vorel
2025-01-17 10:31 ` Cyril Hrubis
2025-01-17 10:51 ` Petr Vorel
2025-01-17 10:55 ` Petr Vorel
2025-01-17 10:18 ` Petr Vorel
2025-01-17 10:30 ` Cyril Hrubis
2025-01-17 11:47 ` Petr Vorel
2025-01-17 12:07 ` Cyril Hrubis
2025-01-17 12:21 ` Li Wang
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=20250117091603.GA742253@pevik \
--to=pvorel@suse.cz \
--cc=liwang@redhat.com \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.