commit | 0d087f17f868587ca01259632ba0bd584b66aae4 | [log] [tgz] |
---|---|---|
author | Andrew Jeffery <andrew@aj.id.au> | Fri Mar 23 11:40:35 2018 +1030 |
committer | Andrew Jeffery <andrew@aj.id.au> | Wed Apr 04 07:56:23 2018 +0000 |
tree | c71ac35940f16ed5d2d52d0abe14abcb19ba3035 | |
parent | 912c9bdf938893e41c675f6cd97b7b00bcc83940 [diff] |
mboxd_windows: Reset evicted windows After copying a portion of the backing store to a window, create_map_window() "resizes" the window to the aligned-up size reported by copy_flash(). This allows use of the window size as the content size elsewhere in the codebase. However, if we needed to evict a window to satisfy a request, the window properties were not reset. This lead to inefficient use of the reserved memory by limiting the effective window size to the minimum size of all requests that were previously allocated the window in question. Inefficient use of reserved memory isn't the only side effect; the host takes an eye-watering hit to throughput that gets exponentionally worse over time: From the petitboot shell without the patch applied: / # time cat /dev/mtd0 > /dev/null real 0m 49.77s user 0m 0.00s sys 0m 49.76s / # time cat /dev/mtd0 > /dev/null real 1m 33.57s user 0m 0.00s sys 1m 33.55s / # time cat /dev/mtd0 > /dev/null real 4m 45.37s user 0m 0.00s sys 4m 45.35s / # time cat /dev/mtd0 > /dev/null real 9m 17.77s user 0m 0.00s sys 9m 17.76s / # And with the patch applied: / # time cat /dev/mtd0 > /dev/null real 0m 43.00s user 0m 0.00s sys 0m 42.99s / # time cat /dev/mtd0 > /dev/null real 0m 42.40s user 0m 0.00s sys 0m 42.39s / # time cat /dev/mtd0 > /dev/null real 0m 42.41s user 0m 0.00s sys 0m 42.39s / # Reset the properties to allow use of the entire reserved memory region allocated to the window, improving memory efficiency, throughput, and minimising throughput variance. Change-Id: I7be78ec5e0a9ee0caf31133b0861e333844b8975 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Copyright 2017 IBM
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This repo contains the protocol definition for the host to BMC mailbox communication specification which can be found in Documentation/mbox_procotol.md.
There is also a reference implementation of a BMC mailbox daemon, the details of which can be found in Documentation/mboxd.md.
Finally there is also an implementation of a mailbox daemon control program, the details of which can be found in Documentation/mboxctl.md.
This codebase is a mix of C (due to its heritage) and C++. This is an ugly split: message logging and error handling can be vastly different inside the same codebase. The aim is to remove the split one way or the other over time and have consistent approaches to solving problems.
phosphor-mboxd is developed as part of the OpenBMC project, which also leads to integration of frameworks such as phosphor-logging. Specifically on phosphor-logging, it's noted that without care we can achieve absurd duplication or irritating splits in where errors are reported, as the C code is not capable of making use of the interfaces provided.
Message logging MUST be done to stdout or stderr, and MUST NOT be done directly via journal APIs or wrappers of the journal APIs.
Rationale:
We have two scenarios where we care about output, with the important restriction that the method must be consistent between C and C++:
In the first case it is desirable that the messages appear in the system journal. To this end, systemd will by default capture stdout and stderr of the launched binary and redirect it to the journal.
In the second case it is desirable that messages be captured by the test runner (make check
) for test failure analysis, and it is undesirable for messages to appear in the system journal (as these are tests, not issues affecting the health of the system they are being executed on).
Therefore direct calls to the journal MUST be avoided for the purpose of message logging.
Note: This section specifically targets the use of phosphor-logging's log<T>()
. It does not prevent the use of elog<T>()
.