Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2:PowerPC
xen
23404-xentrace_reduce_trace_buffer_size_to_some...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 23404-xentrace_reduce_trace_buffer_size_to_something_mfn_offset_can_reach.patch of Package xen
changeset: 23404:dd0eb070ee44 user: Olaf Hering <olaf@aepfle.de> date: Thu May 26 12:34:44 2011 +0100 files: xen/common/trace.c description: xentrace: reduce trace buffer size to something mfn_offset can reach The start of the array which holds the list of mfns for each cpus tracebuffer is stored in an unsigned short. This limits the total amount of pages for each cpu as the number of active cpus increases. Update the math in calculate_tbuf_size() to apply also this rule to the max number of trace pages. Without this change the index can overflow. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> --- xen/common/trace.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) Index: xen-4.1.2-testing/xen/common/trace.c =================================================================== --- xen-4.1.2-testing.orig/xen/common/trace.c +++ xen-4.1.2-testing/xen/common/trace.c @@ -112,11 +112,14 @@ static int calculate_tbuf_size(unsigned typeof(dummy_size.prod) max_size; struct t_info dummy_pages; typeof(dummy_pages.tbuf_size) max_pages; + typeof(dummy_pages.mfn_offset[0]) max_mfn_offset; + unsigned int max_cpus = num_online_cpus(); unsigned int t_info_words; /* force maximum value for an unsigned type */ max_size = -1; max_pages = -1; + max_mfn_offset = -1; /* max size holds up to n pages */ max_size /= PAGE_SIZE; @@ -124,6 +127,18 @@ static int calculate_tbuf_size(unsigned if ( max_size < max_pages ) max_pages = max_size; + /* + * max mfn_offset holds up to n pages per cpu + * The array of mfns for the highest cpu can start at the maximum value + * mfn_offset can hold. So reduce the number of cpus and also the mfn_offset. + */ + max_mfn_offset -= t_info_first_offset - 1; + max_cpus--; + if ( max_cpus ) + max_mfn_offset /= max_cpus; + if ( max_mfn_offset < max_pages ) + max_pages = max_mfn_offset; + if ( pages > max_pages ) { printk(XENLOG_INFO "xentrace: requested number of %u pages "
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor