aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mm.h8
-rw-r--r--include/linux/mm_types.h6
-rw-r--r--include/linux/sched.h4
3 files changed, 12 insertions, 6 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 2124cdb2d1d0..8e580c07d171 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -873,7 +873,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
873/* 873/*
874 * per-process(per-mm_struct) statistics. 874 * per-process(per-mm_struct) statistics.
875 */ 875 */
876#if USE_SPLIT_PTLOCKS 876#if defined(SPLIT_RSS_COUNTING)
877/* 877/*
878 * The mm counters are not protected by its page_table_lock, 878 * The mm counters are not protected by its page_table_lock,
879 * so must be incremented atomically. 879 * so must be incremented atomically.
@@ -883,10 +883,7 @@ static inline void set_mm_counter(struct mm_struct *mm, int member, long value)
883 atomic_long_set(&mm->rss_stat.count[member], value); 883 atomic_long_set(&mm->rss_stat.count[member], value);
884} 884}
885 885
886static inline unsigned long get_mm_counter(struct mm_struct *mm, int member) 886unsigned long get_mm_counter(struct mm_struct *mm, int member);
887{
888 return (unsigned long)atomic_long_read(&mm->rss_stat.count[member]);
889}
890 887
891static inline void add_mm_counter(struct mm_struct *mm, int member, long value) 888static inline void add_mm_counter(struct mm_struct *mm, int member, long value)
892{ 889{
@@ -974,6 +971,7 @@ static inline void setmax_mm_hiwater_rss(unsigned long *maxrss,
974 *maxrss = hiwater_rss; 971 *maxrss = hiwater_rss;
975} 972}
976 973
974void sync_mm_rss(struct task_struct *task, struct mm_struct *mm);
977 975
978/* 976/*
979 * A callback you can register to apply pressure to ageable caches. 977 * A callback you can register to apply pressure to ageable caches.
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index e1ca64be6678..21861239ab0c 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -202,9 +202,15 @@ enum {
202}; 202};
203 203
204#if USE_SPLIT_PTLOCKS 204#if USE_SPLIT_PTLOCKS
205#define SPLIT_RSS_COUNTING
205struct mm_rss_stat { 206struct mm_rss_stat {
206 atomic_long_t count[NR_MM_COUNTERS]; 207 atomic_long_t count[NR_MM_COUNTERS];
207}; 208};
209/* per-thread cached information, */
210struct task_rss_stat {
211 int events; /* for synchronization threshold */
212 int count[NR_MM_COUNTERS];
213};
208#else /* !USE_SPLIT_PTLOCKS */ 214#else /* !USE_SPLIT_PTLOCKS */
209struct mm_rss_stat { 215struct mm_rss_stat {
210 unsigned long count[NR_MM_COUNTERS]; 216 unsigned long count[NR_MM_COUNTERS];
diff --git a/include/linux/sched.h b/include/linux/sched.h
index cbeafa49a53b..46c6f8d5dc06 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1220,7 +1220,9 @@ struct task_struct {
1220 struct plist_node pushable_tasks; 1220 struct plist_node pushable_tasks;
1221 1221
1222 struct mm_struct *mm, *active_mm; 1222 struct mm_struct *mm, *active_mm;
1223 1223#if defined(SPLIT_RSS_COUNTING)
1224 struct task_rss_stat rss_stat;
1225#endif
1224/* task state */ 1226/* task state */
1225 int exit_state; 1227 int exit_state;
1226 int exit_code, exit_signal; 1228 int exit_code, exit_signal;