示例#1
0
/** Initialisation of the DSM module.
 *  @author Renaud Lottiaux
 *
 *  Start object server, object manager and kddm set manager threads.
 *  Register kermm services in the /proc/kerrighed/services.
 */
int init_kermm(void)
{
    printk("KerMM initialisation : start\n");

    krgsyms_register (KRGSYMS_VM_OPS_NULL, &null_vm_ops);
    krgsyms_register (KRGSYMS_VM_OPS_FILE_GENERIC, &generic_file_vm_ops);
    special_mapping_vm_ops_krgsyms_register ();
    krgsyms_register (KRGSYMS_VM_OPS_MEMORY_KDDM_VMOPS,
                      &anon_memory_kddm_vmops);

    krgsyms_register (KRGSYMS_ARCH_UNMAP_AREA, arch_unmap_area);
    krgsyms_register (KRGSYMS_ARCH_UNMAP_AREA_TOPDOWN,
                      arch_unmap_area_topdown);
    krgsyms_register (KRGSYMS_ARCH_GET_UNMAP_AREA, arch_get_unmapped_area);
    krgsyms_register (KRGSYMS_ARCH_GET_UNMAP_AREA_TOPDOWN,
                      arch_get_unmapped_area_topdown);
    krgsyms_register (KRGSYMS_KDDM_PT_OPS, &kddm_pt_set_ops);

    register_io_linker (MEMORY_LINKER, &memory_linker);
    register_io_linker (MM_STRUCT_LINKER, &mm_struct_io_linker);

    mm_struct_init ();
    mm_server_init();
    mm_injection_init();

    register_hotplug_notifier(mm_notification, HOTPLUG_PRIO_MM);

    printk ("KerMM initialisation done\n");

    return 0;
}
void shm_handler_init(void)
{
	shmid_object_cachep = kmem_cache_create("shmid_object",
						sizeof(shmid_object_t),
						0, SLAB_PANIC, NULL);

	register_io_linker(SHM_MEMORY_LINKER, &shm_memory_linker);
	register_io_linker(SHMID_LINKER, &shmid_linker);
	register_io_linker(SHMKEY_LINKER, &shmkey_linker);

	krgsyms_register(KRGSYMS_VM_OPS_SHM, &shm_vm_ops);

	printk("Shm Server configured\n");
}
示例#3
0
int static_node_info_init()
{
	krg_static_node_info_t *static_node_info;

	register_io_linker(STATIC_NODE_INFO_LINKER,
			   &static_node_info_io_linker);

	/* Create the static node info kddm set */

	static_node_info_kddm_set =
		create_new_kddm_set(kddm_def_ns,
				    STATIC_NODE_INFO_KDDM_ID,
				    STATIC_NODE_INFO_LINKER,
				    KDDM_CUSTOM_DEF_OWNER,
				    sizeof(krg_static_node_info_t),
				    0);
	if (IS_ERR(static_node_info_kddm_set))
		OOM;

	static_node_info = _kddm_grab_object(static_node_info_kddm_set,
					     kerrighed_node_id);

	static_node_info->nr_cpu = num_online_cpus();
	static_node_info->totalram = totalram_pages;
	static_node_info->totalhigh = totalhigh_pages;

	_kddm_put_object(static_node_info_kddm_set, kerrighed_node_id);

	return 0;
}
示例#4
0
void epm_pid_start(void)
{
	unsigned long cache_flags = SLAB_PANIC;

#ifdef CONFIG_DEBUG_SLAB
	cache_flags |= SLAB_POISON;
#endif
	pid_kddm_obj_cachep = KMEM_CACHE(pid_kddm_object, cache_flags);

	INIT_WORK(&put_pid_work, put_pid_worker);

	register_io_linker(PID_LINKER, &pid_io_linker);
	pid_kddm_set = create_new_kddm_set(kddm_def_ns,
					   PID_KDDM_ID,
					   PID_LINKER,
					   KDDM_CUSTOM_DEF_OWNER,
					   0, 0);
	if (IS_ERR(pid_kddm_set))
		OOM;

	rpc_register_int(PROC_RESERVE_PID, handle_reserve_pid, 0);
	rpc_register_int(PROC_PID_LINK_TASK, handle_pid_link_task, 0);
	rpc_register_int(PROC_END_PID_RESERVATION,
			 handle_end_pid_reservation, 0);
}
示例#5
0
/**
 * @author David Margery
 * @author Pascal Gallard (update to kddm architecture)
 * @author Louis Rilling (split files)
 */
void proc_task_start(void)
{
	unsigned long cache_flags = SLAB_PANIC;

#ifdef CONFIG_DEBUG_SLAB
	cache_flags |= SLAB_POISON;
#endif
	task_kddm_obj_cachep = KMEM_CACHE(task_kddm_object, cache_flags);

	register_io_linker(TASK_LINKER, &task_io_linker);

	task_kddm_set = create_new_kddm_set(kddm_def_ns, TASK_KDDM_ID,
					    TASK_LINKER,
					    KDDM_CUSTOM_DEF_OWNER,
					    0, 0);
	if (IS_ERR(task_kddm_set))
		OOM;

}
示例#6
0
/** Initialisation of the DVFS module.
 *  @author Renaud Lottiaux
 *
 *  Start DVFS server.
 */
int init_dvfs (void)
{
	printk ("DVFS initialisation : start\n");

	dvfs_file_cachep = kmem_cache_create("dvfs_file",
					     sizeof(struct dvfs_file_struct),
					     0, SLAB_PANIC, NULL);

	register_io_linker (DVFS_FILE_STRUCT_LINKER,
			    &dvfs_file_struct_io_linker);

#ifdef CONFIG_KRG_EPM
	dvfs_mobility_init();
#endif
#ifdef CONFIG_KRG_FAF
	faf_init();
#endif
	dvfs_file_init();

	printk ("DVFS initialisation done\n");

	return 0;
}
示例#7
0
int static_cpu_info_init(void)
{
	krg_static_cpu_info_t *static_cpu_info;
	int cpu_id, i;

	register_io_linker(STATIC_CPU_INFO_LINKER, &static_cpu_info_io_linker);

	/* Create the CPU info kddm set */

	static_cpu_info_kddm_set =
		create_new_kddm_set(kddm_def_ns,
				    STATIC_CPU_INFO_KDDM_ID,
				    STATIC_CPU_INFO_LINKER,
				    KDDM_CUSTOM_DEF_OWNER,
				    sizeof(krg_static_cpu_info_t),
				    0);
	if (IS_ERR(static_cpu_info_kddm_set))
		OOM;

	for_each_online_cpu (i) {
		cpu_id = krg_cpu_id(i);
		cpu_data(i).krg_cpu_id = cpu_id;

		static_cpu_info =
			_kddm_grab_object(static_cpu_info_kddm_set, cpu_id);

		static_cpu_info->info = cpu_data(i);
#ifndef CONFIG_USERMODE
		static_cpu_info->info.cpu_khz = cpu_khz;
#endif

		_kddm_put_object(static_cpu_info_kddm_set, cpu_id);
	}

	return 0;
}