diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-12-12 14:45:17 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-12-12 14:46:15 -0500 |
commit | 9207c7f874e7754391fdf184187fc763455466c5 (patch) | |
tree | 6294bb80fa85c37d780266cadb624d9054e5e915 /litmus/sched_cedf.c | |
parent | c8483ef0959672310bf4ebb72e1a308b00543f74 (diff) |
Cluster assignment of nv klmirqd threads.
Diffstat (limited to 'litmus/sched_cedf.c')
-rw-r--r-- | litmus/sched_cedf.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c index 84aafca78cde..35ea1544ce69 100644 --- a/litmus/sched_cedf.c +++ b/litmus/sched_cedf.c | |||
@@ -1652,6 +1652,25 @@ static void cleanup_cedf(void) | |||
1652 | } | 1652 | } |
1653 | } | 1653 | } |
1654 | 1654 | ||
1655 | #if defined(CONFIG_LITMUS_NVIDIA) && defined(CONFIG_LITMUS_SOFTIRQD) | ||
1656 | static int cedf_map_gpu_to_cpu(int gpu, int num_gpus) | ||
1657 | { | ||
1658 | /* TODO: Some sort of smart clustering on the PCIe bus topology */ | ||
1659 | int num_gpu_clusters = num_clusters; | ||
1660 | unsigned int gpu_cluster_size = num_gpus / num_gpu_clusters; | ||
1661 | int cpu_cluster = gpu / gpu_cluster_size; | ||
1662 | int default_cpu = cedf[cpu_cluster].cpus[0]->cpu; // first CPU in given cluster | ||
1663 | |||
1664 | if(num_gpus % num_gpu_clusters != 0) { | ||
1665 | TRACE("GPU clusters are of non-uniform size!\n"); | ||
1666 | } | ||
1667 | |||
1668 | TRACE("CPU %d is default for GPU %d interrupt threads.\n", default_cpu, gpu); | ||
1669 | |||
1670 | return default_cpu; | ||
1671 | } | ||
1672 | #endif | ||
1673 | |||
1655 | static long cedf_activate_plugin(void) | 1674 | static long cedf_activate_plugin(void) |
1656 | { | 1675 | { |
1657 | int i, j, cpu, ccpu, cpu_count; | 1676 | int i, j, cpu, ccpu, cpu_count; |
@@ -1826,6 +1845,9 @@ static struct sched_plugin cedf_plugin __cacheline_aligned_in_smp = { | |||
1826 | .change_prio_pai_tasklet = cedf_change_prio_pai_tasklet, | 1845 | .change_prio_pai_tasklet = cedf_change_prio_pai_tasklet, |
1827 | .run_tasklets = cedf_run_tasklets, | 1846 | .run_tasklets = cedf_run_tasklets, |
1828 | #endif | 1847 | #endif |
1848 | #if defined(CONFIG_LITMUS_NVIDIA) && defined(CONFIG_LITMUS_SOFTIRQD) | ||
1849 | .map_gpu_to_cpu = cedf_map_gpu_to_cpu, | ||
1850 | #endif | ||
1829 | }; | 1851 | }; |
1830 | 1852 | ||
1831 | static struct proc_dir_entry *cluster_file = NULL, *cedf_dir = NULL; | 1853 | static struct proc_dir_entry *cluster_file = NULL, *cedf_dir = NULL; |