aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h54
1 files changed, 0 insertions, 54 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4b1753f7e48e..cbeafa49a53b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -396,60 +396,6 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
396static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} 396static inline void arch_pick_mmap_layout(struct mm_struct *mm) {}
397#endif 397#endif
398 398
399#if USE_SPLIT_PTLOCKS
400/*
401 * The mm counters are not protected by its page_table_lock,
402 * so must be incremented atomically.
403 */
404#define set_mm_counter(mm, member, value) atomic_long_set(&(mm)->_##member, value)
405#define get_mm_counter(mm, member) ((unsigned long)atomic_long_read(&(mm)->_##member))
406#define add_mm_counter(mm, member, value) atomic_long_add(value, &(mm)->_##member)
407#define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member)
408#define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member)
409
410#else /* !USE_SPLIT_PTLOCKS */
411/*
412 * The mm counters are protected by its page_table_lock,
413 * so can be incremented directly.
414 */
415#define set_mm_counter(mm, member, value) (mm)->_##member = (value)
416#define get_mm_counter(mm, member) ((mm)->_##member)
417#define add_mm_counter(mm, member, value) (mm)->_##member += (value)
418#define inc_mm_counter(mm, member) (mm)->_##member++
419#define dec_mm_counter(mm, member) (mm)->_##member--
420
421#endif /* !USE_SPLIT_PTLOCKS */
422
423#define get_mm_rss(mm) \
424 (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss))
425#define update_hiwater_rss(mm) do { \
426 unsigned long _rss = get_mm_rss(mm); \
427 if ((mm)->hiwater_rss < _rss) \
428 (mm)->hiwater_rss = _rss; \
429} while (0)
430#define update_hiwater_vm(mm) do { \
431 if ((mm)->hiwater_vm < (mm)->total_vm) \
432 (mm)->hiwater_vm = (mm)->total_vm; \
433} while (0)
434
435static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
436{
437 return max(mm->hiwater_rss, get_mm_rss(mm));
438}
439
440static inline void setmax_mm_hiwater_rss(unsigned long *maxrss,
441 struct mm_struct *mm)
442{
443 unsigned long hiwater_rss = get_mm_hiwater_rss(mm);
444
445 if (*maxrss < hiwater_rss)
446 *maxrss = hiwater_rss;
447}
448
449static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
450{
451 return max(mm->hiwater_vm, mm->total_vm);
452}
453 399
454extern void set_dumpable(struct mm_struct *mm, int value); 400extern void set_dumpable(struct mm_struct *mm, int value);
455extern int get_dumpable(struct mm_struct *mm); 401extern int get_dumpable(struct mm_struct *mm);