diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpuset.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index e9917d71628a..0d0dbbd6560a 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -1871,14 +1871,14 @@ void cpuset_exit(struct task_struct *tsk) | |||
1871 | * tasks cpuset. | 1871 | * tasks cpuset. |
1872 | **/ | 1872 | **/ |
1873 | 1873 | ||
1874 | cpumask_t cpuset_cpus_allowed(const struct task_struct *tsk) | 1874 | cpumask_t cpuset_cpus_allowed(struct task_struct *tsk) |
1875 | { | 1875 | { |
1876 | cpumask_t mask; | 1876 | cpumask_t mask; |
1877 | 1877 | ||
1878 | down(&callback_sem); | 1878 | down(&callback_sem); |
1879 | task_lock((struct task_struct *)tsk); | 1879 | task_lock(tsk); |
1880 | guarantee_online_cpus(tsk->cpuset, &mask); | 1880 | guarantee_online_cpus(tsk->cpuset, &mask); |
1881 | task_unlock((struct task_struct *)tsk); | 1881 | task_unlock(tsk); |
1882 | up(&callback_sem); | 1882 | up(&callback_sem); |
1883 | 1883 | ||
1884 | return mask; | 1884 | return mask; |
@@ -1890,6 +1890,29 @@ void cpuset_init_current_mems_allowed(void) | |||
1890 | } | 1890 | } |
1891 | 1891 | ||
1892 | /** | 1892 | /** |
1893 | * cpuset_mems_allowed - return mems_allowed mask from a tasks cpuset. | ||
1894 | * @tsk: pointer to task_struct from which to obtain cpuset->mems_allowed. | ||
1895 | * | ||
1896 | * Description: Returns the nodemask_t mems_allowed of the cpuset | ||
1897 | * attached to the specified @tsk. Guaranteed to return some non-empty | ||
1898 | * subset of node_online_map, even if this means going outside the | ||
1899 | * tasks cpuset. | ||
1900 | **/ | ||
1901 | |||
1902 | nodemask_t cpuset_mems_allowed(struct task_struct *tsk) | ||
1903 | { | ||
1904 | nodemask_t mask; | ||
1905 | |||
1906 | down(&callback_sem); | ||
1907 | task_lock(tsk); | ||
1908 | guarantee_online_mems(tsk->cpuset, &mask); | ||
1909 | task_unlock(tsk); | ||
1910 | up(&callback_sem); | ||
1911 | |||
1912 | return mask; | ||
1913 | } | ||
1914 | |||
1915 | /** | ||
1893 | * cpuset_zonelist_valid_mems_allowed - check zonelist vs. curremt mems_allowed | 1916 | * cpuset_zonelist_valid_mems_allowed - check zonelist vs. curremt mems_allowed |
1894 | * @zl: the zonelist to be checked | 1917 | * @zl: the zonelist to be checked |
1895 | * | 1918 | * |