Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log: postpone log scrub to respond to write earlier #387

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xvuko
Copy link
Contributor

@xvuko xvuko commented Apr 12, 2023

This can improve relatively slow klog write times. It is still important to know that logging from threads with higher priority than usrv can result in priority inversion.

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

JIRA: RTOS-430
Change-Id: Idec0ff30a8430c9b8899293664b361e7f32f938b
Copy link
Member

@agkaminski agkaminski left a comment

Choose a reason for hiding this comment

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

How is it blocked here? log_scrub only does proc_respond, it doesn't block in any way (except on a potential lock acquisition, but we need to get it anyway)

@xvuko
Copy link
Contributor Author

xvuko commented Apr 12, 2023

How is it blocked here? log_scrub only does proc_respond, it doesn't block in any way (except on a potential lock acquisition, but we need to get it anyway)

It locks this lock second time and wakes up reader threads. If readers threads have same or higher priority than message handler than they could be scheduled before response is sent.

@agkaminski
Copy link
Member

If read has higher priority it should be scheduled instead. I agree on the lock though, it should could be taken once for both operations instead.

How about moving scrub after common proc_respond instead? I don't like ad hoc look of the current version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants