[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: xentrace buffer size, maxcpus and online cpus
Tue, 30 May 2023 10:41:07 +0200 Jan Beulich <jbeulich@xxxxxxxx>: > Using this N would be correct afaict, but that N isn't num_online_cpus(). > CPUs may have been offlined by the time trace buffers are initialized, so > without looking too closely I think it would be num_present_cpus() that > you're after. In my testing num_online_cpus returns N, while num_present_cpus returns all available pcpus. There is also num_possible_cpus, but this appears to be an ARM thing. If Xen is booted with maxcpus=, is there a way to use the remaining cpus? In case this is possible, the code needs adjustment to reinitialize the trace buffers. This is not an easy change. But if the remaining cpus will remain offline, then something like this may work: +++ b/xen/common/trace.c @@ -110,7 +110,8 @@ static int calculate_tbuf_size(unsigned int pages, uint16_t t_info_first_offset) 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 = nr_cpu_ids; + unsigned int nr_cpus = num_online_cpus(); + unsigned int max_cpus = nr_cpus; unsigned int t_info_words; /* force maximum value for an unsigned type */ @@ -148,11 +149,11 @@ static int calculate_tbuf_size(unsigned int pages, uint16_t t_info_first_offset) * NB this calculation is correct, because t_info_first_offset is * in words, not bytes */ - t_info_words = nr_cpu_ids * pages + t_info_first_offset; + t_info_words = nr_cpus * pages + t_info_first_offset; t_info_pages = PFN_UP(t_info_words * sizeof(uint32_t)); printk(XENLOG_INFO "xentrace: requesting %u t_info pages " "for %u trace pages on %u cpus\n", - t_info_pages, pages, nr_cpu_ids); + t_info_pages, pages, nr_cpus); return pages; } Olaf Attachment:
pgpOGbpOBlBlT.pgp
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |