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

mm/iob: remove csection #14764

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

mm/iob: remove csection #14764

wants to merge 1 commit into from

Conversation

hujun260
Copy link
Contributor

Summary

reason:
We decouple semcount from business logic
by using an independent counting variable,
which allows us to remove critical sections in many cases.

Impact

mm/iob

Testing

test by apache/nuttx-apps#2849
Build Host:

OS: Ubuntu 20.04
CPU: x86_64
Compiler: GCC 9.4.0
Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic
-machine virt,virtualization=on,gic-version=3
-net none -chardev stdio,id=con,mux=on -serial chardev:con
-mon chardev=con,mode=readline -kernel ./nuttx

@github-actions github-actions bot added Area: Memory Management Memory Management issues Size: M The size of the change in this PR is medium labels Nov 13, 2024
@nuttxpr
Copy link

nuttxpr commented Nov 13, 2024

[Experimental Bot, please feedback here]

This PR appears to partially meet the NuttX requirements. While it provides a reasonable summary and identifies the impacted area, it lacks crucial details in the Impact and Testing sections.

Here's a breakdown of what's missing and how to improve it:

Missing Information:

  • Impact: The PR only mentions "mm/iob" as the impacted area. It needs to specifically address all the impact points listed in the requirements:

    • Is this a new feature or a change to an existing one?
    • User impact (will users need to change anything in their applications?)
    • Build impact (any changes to the build process or configuration?)
    • Hardware impact (does it affect specific architectures, boards, or drivers?)
    • Documentation impact (does this require documentation updates? Were they provided?)
    • Security impact (are there any potential security implications?)
    • Compatibility impact (backward/forward compatibility concerns?)
    • Anything else to consider?
  • Testing: The testing information is insufficient. While it mentions a related NuttX Apps PR, it doesn't provide the results of the testing. The logs before and after the change are empty. This section needs to include:

    • Specific target details (architecture, board, configuration). "qemu-armv8a:nsh_smp" is a start, but more details might be necessary.
    • Actual log output demonstrating the behavior before and after the change, highlighting the improvement or fix. This is crucial for verifying the change works as intended. Simply stating "test by ..." isn't enough.

How to Improve:

  • Impact: Fill in all the required impact categories with specific "YES/NO" answers and detailed explanations where applicable. Even if the answer is "NO," briefly explain why (e.g., "Impact on user: NO - This is an internal change and does not affect user APIs.").
  • Testing: Provide concrete test results. Include the actual log output before and after the change. Clearly demonstrate how the change addresses the issue or implements the new feature. Consider adding more test cases if necessary to cover different scenarios.

Example of Improved Testing Section:

Testing

I confirm that changes are verified on local setup and works as intended:
* Build Host(s): Ubuntu 20.04, x86_64, GCC 9.4.0
* Target(s): QEMU ARMv8-A (Cortex-A53), nsh_smp configuration

Testing logs before change:

<Insert relevant log output showing the problem before the change. For example, demonstrating contention or performance issues related to the semcount.>


Testing logs after change:

<Insert relevant log output showing the improved behavior after the change. For example, demonstrating improved performance or the absence of contention.>


This PR fixes the contention issues observed previously. The logs after the change show a significant improvement in throughput/responsiveness/etc. (Be specific about the improvement).

By providing more complete information in the Impact and Testing sections, the PR will be much easier to review and more likely to be accepted.

include/nuttx/mm/iob.h Outdated Show resolved Hide resolved
mm/iob/iob_alloc.c Outdated Show resolved Hide resolved
mm/iob/iob_alloc_qentry.c Outdated Show resolved Hide resolved
@yamt
Copy link
Contributor

yamt commented Nov 14, 2024

reason: We decouple semcount from business logic by using an independent counting variable, which allows us to remove critical sections in many cases.

if it's so common, i feel it's better to migrate to a simpler primitve like a condvar. how do you think?

@hujun260
Copy link
Contributor Author

reason: We decouple semcount from business logic by using an independent counting variable, which allows us to remove critical sections in many cases.

if it's so common, i feel it's better to migrate to a simpler primitve like a condvar. how do you think?

The implementation of sched/event/* has similar semantics but has more powerful and complex functionalities, making it unsuitable for some scenarios.

reason:
We decouple semcount from business logic
by using an independent counting variable,
which allows us to remove critical sections in many cases.

Signed-off-by: hujun5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Memory Management Memory Management issues Size: M The size of the change in this PR is medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants