Back in April I wrote smemstat in to dump out the per process shared memory usage based on the memory mapping data from /proc/$pid/smaps. I tried to make smemstat as compact as possible with minimised changes in heap size to reduce the impact on the total system shared memory statistics.
smemstat reports the memory utilised per process taking in consideration pages that are shared with other processes. So, if two processes share 64K of memory, each process will report that memory as 32K each.
smemstat has to modes of operation: "dump all current memory stats" and a "dump periodic change in memory stats". The former is useful for a single snapshot view of memory utilisation, where as the latter is useful to observe memory size changes over time. Exiting or new processes that share memory with other processes will cause a change the reported amounted of memory used by the processes because this memory is shared amongst a changed number of processes.
There are various options to smemstat, so consult the man page for more details. One useful option is -o that collects the smemstat statistics into a JSON formatted output file. This can be useful for memory based tests as the structured JSON data can be easily parsed and analysed.
smemstat has landed in Ubuntu Utopic 14.10 and is also available in Debian. Examples of smemstat can be found here. I hope it proves to be a useful utility.
Sunday, 18 May 2014
Friday, 28 March 2014
Firmware Test Suite new features for the Ubuntu 14.04 LTS release
In the last 6 months the Firmware Test Suite (fwts) has seen a lot of development and bug fixing activity in preparation for the Ubuntu 14.04 LTS Trusty release. It is timely to give a brief overview of new features and improvements that have landed in this busy development cycle:
UEFI uefidump, additional support for:
Contributors to fwts in the current release cycle are (in alphabetical order): Alex Hung, Colin King, Ivan Hu, Jeffrey Bastian, Keng-Yu Lin, Matt Fleming. Also, thanks to Naresh Bhat for testing and feedback for the aarch64 port and to Robert Moore for the on-going work with ACPICA.
As ever, all contributions are welcome, including bug reports and feature requests. Visit the fwts wiki page for more details.
UEFI uefidump, additional support for:
- KEK, KEKDefault, PK, PKDefault global variables scan
- db, dbx, dbt variables scan
- messaging device path: add Fibre Channel Ex subtype-21, ATA subtype-18, Fibre Channel Ex subtype-21, USB WWID subtype-16, VLAN subtype-20, Device Logical Unit subtype-17, SAS Ex subtype-22, iSCSI subtype-19, NVM Express namespace subtype-23, Media Protocol subtype-5, PIWG Firmware File subtype-6, PIWG Firmware Volume subtype-7 and extend the Messaging Device Path type Vendor subtype-10.
- Update to ACPICA version 20140325
- Add S3 hybrid suspend / resume support with new --s3-hybrid option
- Improved reporting of errors on ACPI evaluation errors
- New _PLD, _CRS and _PRS dump utilities
- New General Purpose Events (GPE) dump utility
- --disassemble-aml option accepts an output directory argument
- Add DBG2, DBGP, SPCR and MCHI tables to acpidump utility
- Add -R, --rsdp option to specify the RSDP address
- _IFT, _SRV, _PIC, _UDP, _UPP, _PMM, _MSG, _GAI, _CID, _CDM and _CBA checks added to method test
- dmicheck: add more checks for invalid DMI fields
- Support for i386 amd64 armel armhf aarch64 ppc64 ppc64e. fwts support for aarch64 was a notable achievement
- Sync klog scanning with 3.13 kernel error messages
- Remove unused LaunchPad bug tagging
- Add Ivybridge and Haswell MSRs to msr test
- Check CPU maximum frequencies
Contributors to fwts in the current release cycle are (in alphabetical order): Alex Hung, Colin King, Ivan Hu, Jeffrey Bastian, Keng-Yu Lin, Matt Fleming. Also, thanks to Naresh Bhat for testing and feedback for the aarch64 port and to Robert Moore for the on-going work with ACPICA.
As ever, all contributions are welcome, including bug reports and feature requests. Visit the fwts wiki page for more details.
Friday, 21 March 2014
forkstat: a new tool to trace process activity
One of my on-going projects is to try to reduce system activity where possible to try to shave off wasted power consumption. One of the more interesting problems is when very short lived processes are spawned off and die and traditional tools such as ps and top sometimes don't catch that activity. Over last weekend I wrote the bulk of the forkstat tool to track down these processes.
Forkstat uses the kernel proc connector interface to detect process activity. Proc connector allows forkstat to receive notifications of process events such as fork, exec, exit, core dump and changing the process name in the comm field over a socket connection.
By default, forkstat will just log fork, exec and exit events, but the -e option allows one to specify one or more of the fork, exec, exit, core dump or comm events. When a fork event occurs, forkstat will log the PID and process name of the parent and child, allowing one to easily identify where processes are originating. Where possible, forkstat attempts to track the life time of a process and will log the duration of a processes when it exits (note: this is not an estimate of the CPU used).
The -S option to forkstat will dump out a statistical summary of activity. This is useful to identify the frequency of processes activity and hence identifying the top offenders.
Forkstat is now available in Ubuntu 14.04 Trusty Tahr LTS. To install forkstat use:
For more information on the tool and examples of the forkstat output, visit the forkstat quick start page.
Forkstat uses the kernel proc connector interface to detect process activity. Proc connector allows forkstat to receive notifications of process events such as fork, exec, exit, core dump and changing the process name in the comm field over a socket connection.
By default, forkstat will just log fork, exec and exit events, but the -e option allows one to specify one or more of the fork, exec, exit, core dump or comm events. When a fork event occurs, forkstat will log the PID and process name of the parent and child, allowing one to easily identify where processes are originating. Where possible, forkstat attempts to track the life time of a process and will log the duration of a processes when it exits (note: this is not an estimate of the CPU used).
The -S option to forkstat will dump out a statistical summary of activity. This is useful to identify the frequency of processes activity and hence identifying the top offenders.
Forkstat is now available in Ubuntu 14.04 Trusty Tahr LTS. To install forkstat use:
sudo apt-get install forkstat
For more information on the tool and examples of the forkstat output, visit the forkstat quick start page.
Tuesday, 18 March 2014
Keeping cool with thermald
The push for higher performance desktops and laptops has inevitably lead to higher power dissipation. Laptops have also shrunk in size leading to increasing problems with removing excess heat and thermal overrun on heavily loaded high end machines.
Intel's thermald prevents machines from overheating and has been recently introduced in the Ubuntu Trusty 14.04 LTS release. Thermald actively monitors thermal sensors and will attempt to keep the hardware cool by modifying a variety of cooling controls:
Thermald has been found to be especially useful when using the Intel P-state CPU frequency scaling driver since this can push the CPU harder than other CPU frequency scaling drivers.
Over the past several weeks I've been working with Intel to shake out some final bugs and get thermald included into Ubuntu 14.04 LTS, so kudos to Srinivas Pandruvada for handling my patches and also providing a lot of timely fixes too.
By default, thermald works without any need for configuration, however, if one has incorrect thermal trip settings or other firmware related thermal zone bugs one can write one's own thermald configuration.
For further details, consult the Ubuntu thermald wiki page.
Intel's thermald prevents machines from overheating and has been recently introduced in the Ubuntu Trusty 14.04 LTS release. Thermald actively monitors thermal sensors and will attempt to keep the hardware cool by modifying a variety of cooling controls:
* Active or passive cooling devices as presented in sysfs
* The Running Average Power Limit (RAPL) driver (Sandybridge upwards)
* The Intel P-state CPU frequency driver (Sandybridge upwards)
* The CPU freq driver
* The Intel PowerClamp driverThermald has been found to be especially useful when using the Intel P-state CPU frequency scaling driver since this can push the CPU harder than other CPU frequency scaling drivers.
Over the past several weeks I've been working with Intel to shake out some final bugs and get thermald included into Ubuntu 14.04 LTS, so kudos to Srinivas Pandruvada for handling my patches and also providing a lot of timely fixes too.
By default, thermald works without any need for configuration, however, if one has incorrect thermal trip settings or other firmware related thermal zone bugs one can write one's own thermald configuration.
For further details, consult the Ubuntu thermald wiki page.
Subscribe to:
Posts (Atom)