aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 07:18:50 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 07:20:13 -0400
commit13e68a73175041c83713fd1905c65fe612f73862 (patch)
treebe3edeaac8b1b34714dd75d54d17f1ec88ecac35 /mm
parente82bc71470695e6a8a319962737b4abff85bf0c6 (diff)
Augment rt_task() with is_realtime()
Whenever the kernel checks for rt_task() to avoid delaying real-time tasks, we want it to also not delay LITMUS^RT tasks. Hence, most calls to rt_task() should be matched by an equivalent call to is_realtime(). Notably, this affects the implementations of select() and nanosleep(), which use timer_slack_ns when setting up timers for non-real-time tasks.
Diffstat (limited to 'mm')
-rw-r--r--mm/page-writeback.c6
-rw-r--r--mm/page_alloc.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index eb59f7eea508..7e39ffceb566 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -41,6 +41,8 @@
41 41
42#include "internal.h" 42#include "internal.h"
43 43
44#include <litmus/litmus.h> /* for is_realtime() */
45
44/* 46/*
45 * Sleep at most 200ms at a time in balance_dirty_pages(). 47 * Sleep at most 200ms at a time in balance_dirty_pages().
46 */ 48 */
@@ -279,7 +281,7 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty)
279 if (background >= dirty) 281 if (background >= dirty)
280 background = dirty / 2; 282 background = dirty / 2;
281 tsk = current; 283 tsk = current;
282 if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk)) { 284 if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk) || is_realtime(tsk)) {
283 background += background / 4; 285 background += background / 4;
284 dirty += dirty / 4; 286 dirty += dirty / 4;
285 } 287 }
@@ -307,7 +309,7 @@ static unsigned long zone_dirty_limit(struct zone *zone)
307 else 309 else
308 dirty = vm_dirty_ratio * zone_memory / 100; 310 dirty = vm_dirty_ratio * zone_memory / 100;
309 311
310 if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk)) 312 if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk) || is_realtime(tsk))
311 dirty += dirty / 4; 313 dirty += dirty / 4;
312 314
313 return dirty; 315 return dirty;
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ebffa0e4a9c0..950c002bbb45 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -63,6 +63,9 @@
63#include <linux/page_owner.h> 63#include <linux/page_owner.h>
64 64
65#include <asm/sections.h> 65#include <asm/sections.h>
66
67#include <litmus/litmus.h> /* for is_realtime() */
68
66#include <asm/tlbflush.h> 69#include <asm/tlbflush.h>
67#include <asm/div64.h> 70#include <asm/div64.h>
68#include "internal.h" 71#include "internal.h"
@@ -2617,7 +2620,8 @@ gfp_to_alloc_flags(gfp_t gfp_mask)
2617 * comment for __cpuset_node_allowed(). 2620 * comment for __cpuset_node_allowed().
2618 */ 2621 */
2619 alloc_flags &= ~ALLOC_CPUSET; 2622 alloc_flags &= ~ALLOC_CPUSET;
2620 } else if (unlikely(rt_task(current)) && !in_interrupt()) 2623 } else if (unlikely(rt_task(current) || is_realtime(current))
2624 && !in_interrupt())
2621 alloc_flags |= ALLOC_HARDER; 2625 alloc_flags |= ALLOC_HARDER;
2622 2626
2623 if (likely(!(gfp_mask & __GFP_NOMEMALLOC))) { 2627 if (likely(!(gfp_mask & __GFP_NOMEMALLOC))) {