monitor_init: Use ihk_mc_cpu_info()
Its call site is moved before numa_init() as well because monitor_init() defines ihk_os_monitor that was used in rusage_total_memory_add() called from numa_init(). I didn't revert this modification because I don't want to touch the working code. Change-Id: I602467284581ce45989dd071cfe59d3fc4827e29 Fujitsu: POSTK_DEBUG_TEMP_FIX_73
This commit is contained in:
committed by
Dominique Martinet
parent
8db2d3beec
commit
39b21e7ba9
@@ -207,15 +207,10 @@ static void time_init(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POSTK_DEBUG_TEMP_FIX_73 /* NULL access for *monitor fix */
|
|
||||||
void monitor_init(void)
|
void monitor_init(void)
|
||||||
#else /* POSTK_DEBUG_TEMP_FIX_73 */
|
|
||||||
static void monitor_init()
|
|
||||||
#endif /* POSTK_DEBUG_TEMP_FIX_73 */
|
|
||||||
{
|
{
|
||||||
int z;
|
int z;
|
||||||
unsigned long phys;
|
unsigned long phys;
|
||||||
#ifdef POSTK_DEBUG_TEMP_FIX_73 /* NULL access for *monitor fix */
|
|
||||||
const struct ihk_mc_cpu_info *cpu_info = ihk_mc_get_cpu_info();
|
const struct ihk_mc_cpu_info *cpu_info = ihk_mc_get_cpu_info();
|
||||||
|
|
||||||
if (!cpu_info) {
|
if (!cpu_info) {
|
||||||
@@ -233,18 +228,6 @@ static void monitor_init()
|
|||||||
ihk_set_monitor(phys, sizeof(struct ihk_os_monitor) +
|
ihk_set_monitor(phys, sizeof(struct ihk_os_monitor) +
|
||||||
sizeof(struct ihk_os_cpu_monitor) * cpu_info->ncpus);
|
sizeof(struct ihk_os_cpu_monitor) * cpu_info->ncpus);
|
||||||
return;
|
return;
|
||||||
#else /* POSTK_DEBUG_TEMP_FIX_73 */
|
|
||||||
|
|
||||||
z = sizeof(struct ihk_os_monitor) +
|
|
||||||
sizeof(struct ihk_os_cpu_monitor) * num_processors;
|
|
||||||
z = (z + PAGE_SIZE -1) >> PAGE_SHIFT;
|
|
||||||
monitor = ihk_mc_alloc_pages(z, IHK_MC_AP_CRITICAL);
|
|
||||||
memset(monitor, 0, z * PAGE_SIZE);
|
|
||||||
monitor->num_processors = num_processors;
|
|
||||||
phys = virt_to_phys(monitor);
|
|
||||||
ihk_set_monitor(phys, sizeof(struct ihk_os_monitor) +
|
|
||||||
sizeof(struct ihk_os_cpu_monitor) * num_processors);
|
|
||||||
#endif /* POSTK_DEBUG_TEMP_FIX_73 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int nmi_mode;
|
int nmi_mode;
|
||||||
@@ -272,9 +255,6 @@ static void rest_init(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
ap_init();
|
ap_init();
|
||||||
#ifndef POSTK_DEBUG_TEMP_FIX_73 /* NULL access for *monitor fix */
|
|
||||||
monitor_init();
|
|
||||||
#endif /* !POSTK_DEBUG_TEMP_FIX_73 */
|
|
||||||
cpu_local_var_init();
|
cpu_local_var_init();
|
||||||
nmi_init();
|
nmi_init();
|
||||||
uti_init();
|
uti_init();
|
||||||
|
|||||||
@@ -1755,14 +1755,10 @@ static void rusage_init()
|
|||||||
dkprintf("%s: rusage->total_memory=%ld\n", __FUNCTION__, rusage->total_memory);
|
dkprintf("%s: rusage->total_memory=%ld\n", __FUNCTION__, rusage->total_memory);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POSTK_DEBUG_TEMP_FIX_73 /* NULL access for *monitor fix */
|
|
||||||
extern void monitor_init(void);
|
extern void monitor_init(void);
|
||||||
#endif /* POSTK_DEBUG_TEMP_FIX_73 */
|
|
||||||
void mem_init(void)
|
void mem_init(void)
|
||||||
{
|
{
|
||||||
#ifdef POSTK_DEBUG_TEMP_FIX_73 /* NULL access for *monitor fix */
|
|
||||||
monitor_init();
|
monitor_init();
|
||||||
#endif /* !POSTK_DEBUG_TEMP_FIX_73 */
|
|
||||||
|
|
||||||
/* It must precedes numa_init() because rusage->total_memory is initialized in numa_init() */
|
/* It must precedes numa_init() because rusage->total_memory is initialized in numa_init() */
|
||||||
rusage_init();
|
rusage_init();
|
||||||
|
|||||||
Reference in New Issue
Block a user