Skip to content

Conversation

@cfriedt
Copy link
Member

@cfriedt cfriedt commented Feb 26, 2023

Pull in changes from several related backports
#52867
#53183
#52832

Fixes #41111

Related #53605
To address the issue above, we have dropped commit 662f37d (consistent with main).

@github-actions github-actions bot added area: API Changes to public APIs area: Kernel area: POSIX POSIX API Library area: Test Framework Issues related not to a particular test, but to the framework instead area: Tests Issues related to a particular existing or missing test labels Feb 26, 2023
@cfriedt cfriedt force-pushed the v2.7-branch-timing-related-fixes branch from d16e310 to 6392b2e Compare April 4, 2023 14:33
@cfriedt cfriedt marked this pull request as ready for review April 4, 2023 14:36
@cfriedt
Copy link
Member Author

cfriedt commented Apr 4, 2023

I'm unable to reproduce this locally in v2.7-branch or the pull request. Will retry a couple of times in case it's a transient issue.

twister -i -p qemu_x86_nopae            -s tests/kernel/mem_protect/userspace/kernel.memory_protection.userspace

@cfriedt cfriedt added the priority: high High impact/importance bug label Apr 4, 2023
@cfriedt
Copy link
Member Author

cfriedt commented Apr 4, 2023

Also, it looks as though the Backport Issue Check is a false negative - if you click through to the actual check, it seems to have passed, but the status was not updated in the PR.

CC @stephanosio

Copy link
Contributor

@dkalowsk dkalowsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled and test booted locally, seems to work correctly on our products

@cfriedt cfriedt removed the priority: high High impact/importance bug label Apr 5, 2023
gmarull and others added 5 commits April 7, 2023 05:49
The header can't be fully used in standalone mode: toolchain.h has to be
included first, otherwise the ALWAYS_INLINE attribute is not defined.
Headers that can be directly included and are not self-contained should
be considered a bad practice.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
Algorithm was converting uptime to nanoseconds which can easily
lead to overflows. Changed algorithm to use milliseconds and
nanoseconds for remainder only.

Signed-off-by: Krzysztof Chruscinski <[email protected]>
Prior to zephyrproject-rtos#41602, due to the ordering of operations (first mul,
then div), an intermediate value would overflow, resulting in
a time non-linearity.

This test ensures that time rolls-over properly.

Signed-off-by: Chris Friedt <[email protected]>
(cherry picked from commit 74c9c0e)
Add maximum timeout used for conversion to Kconfig. Option is used
to determine which conversion algorithm to use: faster but overflowing
earlier or slower without early overflow.

Signed-off-by: Krzysztof Chruscinski <[email protected]>
(cherry picked from commit 50c7c7b)
The previous method used to calculate seconds in `clock_gettime()`
seemed to have an inaccuracy that grew with time causing the
seconds to be off by an order of magnitude when ticks would roll
over.

This change fixes the method used to calculate seconds.

Signed-off-by: Chris Friedt <[email protected]>
@cfriedt cfriedt force-pushed the v2.7-branch-timing-related-fixes branch from 6392b2e to b952a07 Compare April 7, 2023 09:52
@cfriedt
Copy link
Member Author

cfriedt commented Apr 7, 2023

It looks like there was an update by Stephanos to fix some CI issues, which mitigated the qemu_x86_nopae and backport issue check false-negatives.

Minor adjustments were required to get tests/unit/time_units/ to build & pass.

  • removed <zephyr/.. prefix on includes
  • touched-up tests/unit/time_units/CMakeLists.txt to make it work with older unit testing builds
  • added trailing , NULL); to zassert_equal( calls
  • pulled in commit that added missing includes to <sys/time_units.h>
  • switched include order in tests/unit/time_units/overflow.c, because include order issues :(
#include <sys/time_units.h>
#include <ztest.h>

to

#include <ztest.h>
#include <sys/time_units.h>

@cfriedt cfriedt merged commit 0388a90 into zephyrproject-rtos:v2.7-branch Apr 7, 2023
@cfriedt cfriedt deleted the v2.7-branch-timing-related-fixes branch April 7, 2023 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: API Changes to public APIs area: Kernel area: POSIX POSIX API Library area: Test Framework Issues related not to a particular test, but to the framework instead area: Tests Issues related to a particular existing or missing test

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants