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

Master save mem wd #6920

Closed
wants to merge 14 commits into from

Conversation

Projects
None yet
6 participants
@davids5
Copy link
Member

davids5 commented Mar 28, 2017

@bkueng has found us more free memory!

I retested and we needed to have the interrupt reserve 4+1 to not allocate more at runtime.

@PX4TestFlights - please bench test first for safety!

David Sidrane added some commits Mar 28, 2017

David Sidrane
aerofc-v1 nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that is never
  used.
David Sidrane
aerocore nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that is never
  used.
David Sidrane
crazyflie nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that is never
  used.
David Sidrane
auav-x21 nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that is never
  used.
David Sidrane
mindpx-v2 nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that is never
  used.
David Sidrane
px4-stm32f4discovery nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that is never
  used.
David Sidrane
px4fmu-v1 nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that is never
  used.
David Sidrane
px4fmu-v3 nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that is never
  used.
David Sidrane
px4fmu-v2 nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that is never
  used.
David Sidrane
px4fmu-v4 nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that is never
  used.
David Sidrane
px4fmu-v4pro nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that is never
  used.
David Sidrane
px4fmu-v5 nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce

  used.
David Sidrane
px4nucleoF767ZI-v1 nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that
  used.
David Sidrane
tap-v1 nsh Reduce statically allocated NuttX watchdog
  Reducing this value to 25 will free 600 bytes of
  statically reserved memory for NuttX watchdog
  timers. We Typically run needing 20 + 4. Choosing
  25 will preclude any runtime overhead and reduce
  the waste of over allocating memory that i
  used.
@NaterGator

This comment has been minimized.

Copy link
Contributor

NaterGator commented Mar 29, 2017

@davids5 if we're looking for free memory / flash it would be a good time to update matrix to at least PX4/Matrix@66e1b40

@LorenzMeier

This comment has been minimized.

Copy link
Member

LorenzMeier commented Apr 2, 2017

We've been bitten by this before. We had to pre-allocate more than we ever use at runtime. Are we confident that issue in NuttX has been resolved?

@davids5

This comment has been minimized.

Copy link
Member Author

davids5 commented Apr 4, 2017

@LorenzMeier

By bitten are you referring to another example of a silent resource failure?

There are several of this type of silent resource fail. Upstream assumes less of a dynamic runtime environment and that the DEBUGASSERT are adequate and has rejected any more debug instrumentations.

We can add a set of patches to keep track of the min free resources and display them in top.

We can also look at the soak test setup again and run a patch to change selective DEBUGASSERT to ASSERT on that test build.

In the case of this set of this settings. The code has 2 configuration parameters. One represents the total fixed allocation and the other the number of those allocations reserved for calls off of ISR.

If on an interrupt handler thread OR if the number of pre-allocated timer structures exceeds the reserve, then take the the next timer from the head of the free list. If the above is false the an allocation will occur in the non ISR case.

So if allocation = total used + total reserved for IRQ + 1 we should never allocate any timers off the heap.

We maxed out at peek of 18-20 used, we have 4 reserved for ISR so I set the value at 25.

@LorenzMeier

This comment has been minimized.

Copy link
Member

LorenzMeier commented Apr 10, 2017

Too high risk for v1.6

@LorenzMeier LorenzMeier added this to the Release v2.1.0 milestone Apr 10, 2017

@davids5

This comment has been minimized.

Copy link
Member Author

davids5 commented Apr 10, 2017

As discussed we need the HW soak testing and test build to validate. I will coordinate with @darioxz

@TSC21

This comment has been minimized.

Copy link
Member

TSC21 commented Aug 20, 2017

@davids5 what's the test status on this PR?

@davids5

This comment has been minimized.

Copy link
Member Author

davids5 commented Aug 22, 2017

@darioxz - How is the HW testing coming? Per our discussion we still need a way to detect resource exhaustion under flight conditions. Thinks like here
need to be testable. There are a lot of these type conditions in the priority inversion code as well.

@LorenzMeier

This comment has been minimized.

Copy link
Member

LorenzMeier commented Oct 5, 2017

Closing - its great but with unknown risk.

@LorenzMeier LorenzMeier closed this Oct 5, 2017

@LorenzMeier LorenzMeier deleted the master_save_mem_WD branch Oct 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.