aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compaction.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-01 15:30:01 -0400
committerTejun Heo <tj@kernel.org>2012-04-01 15:55:00 -0400
commit959d851caa48829eb85cb85aa949fd6b4c5d5bc6 (patch)
tree3ba9c94ec346275fb44c4f0d1cd2537cdff8d811 /include/linux/compaction.h
parenta5567932fc926739e29e98487128080f40c61710 (diff)
parent48ddbe194623ae089cc0576e60363f2d2e85662a (diff)
Merge branch 'for-3.5' of ../cgroup into block/for-3.5/core-merged
cgroup/for-3.5 contains the following changes which blk-cgroup needs to proceed with the on-going cleanup. * Dynamic addition and removal of cftypes to make config/stat file handling modular for policies. * cgroup removal update to not wait for css references to drain to fix blkcg removal hang caused by cfq caching cfqgs. Pull in cgroup/for-3.5 into block/for-3.5/core. This causes the following conflicts in block/blk-cgroup.c. * 761b3ef50e "cgroup: remove cgroup_subsys argument from callbacks" conflicts with blkiocg_pre_destroy() addition and blkiocg_attach() removal. Resolved by removing @subsys from all subsys methods. * 676f7c8f84 "cgroup: relocate cftype and cgroup_subsys definitions in controllers" conflicts with ->pre_destroy() and ->attach() updates and removal of modular config. Resolved by dropping forward declarations of the methods and applying updates to the relocated blkio_subsys. * 4baf6e3325 "cgroup: convert all non-memcg controllers to the new cftype interface" builds upon the previous item. Resolved by adding ->base_cftypes to the relocated blkio_subsys. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/compaction.h')
-rw-r--r--include/linux/compaction.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index bb2bbdbe546..51a90b7f2d6 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -23,6 +23,7 @@ extern int fragmentation_index(struct zone *zone, unsigned int order);
23extern unsigned long try_to_compact_pages(struct zonelist *zonelist, 23extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
24 int order, gfp_t gfp_mask, nodemask_t *mask, 24 int order, gfp_t gfp_mask, nodemask_t *mask,
25 bool sync); 25 bool sync);
26extern int compact_pgdat(pg_data_t *pgdat, int order);
26extern unsigned long compaction_suitable(struct zone *zone, int order); 27extern unsigned long compaction_suitable(struct zone *zone, int order);
27 28
28/* Do not skip compaction more than 64 times */ 29/* Do not skip compaction more than 64 times */
@@ -33,20 +34,26 @@ extern unsigned long compaction_suitable(struct zone *zone, int order);
33 * allocation success. 1 << compact_defer_limit compactions are skipped up 34 * allocation success. 1 << compact_defer_limit compactions are skipped up
34 * to a limit of 1 << COMPACT_MAX_DEFER_SHIFT 35 * to a limit of 1 << COMPACT_MAX_DEFER_SHIFT
35 */ 36 */
36static inline void defer_compaction(struct zone *zone) 37static inline void defer_compaction(struct zone *zone, int order)
37{ 38{
38 zone->compact_considered = 0; 39 zone->compact_considered = 0;
39 zone->compact_defer_shift++; 40 zone->compact_defer_shift++;
40 41
42 if (order < zone->compact_order_failed)
43 zone->compact_order_failed = order;
44
41 if (zone->compact_defer_shift > COMPACT_MAX_DEFER_SHIFT) 45 if (zone->compact_defer_shift > COMPACT_MAX_DEFER_SHIFT)
42 zone->compact_defer_shift = COMPACT_MAX_DEFER_SHIFT; 46 zone->compact_defer_shift = COMPACT_MAX_DEFER_SHIFT;
43} 47}
44 48
45/* Returns true if compaction should be skipped this time */ 49/* Returns true if compaction should be skipped this time */
46static inline bool compaction_deferred(struct zone *zone) 50static inline bool compaction_deferred(struct zone *zone, int order)
47{ 51{
48 unsigned long defer_limit = 1UL << zone->compact_defer_shift; 52 unsigned long defer_limit = 1UL << zone->compact_defer_shift;
49 53
54 if (order < zone->compact_order_failed)
55 return false;
56
50 /* Avoid possible overflow */ 57 /* Avoid possible overflow */
51 if (++zone->compact_considered > defer_limit) 58 if (++zone->compact_considered > defer_limit)
52 zone->compact_considered = defer_limit; 59 zone->compact_considered = defer_limit;
@@ -62,16 +69,21 @@ static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
62 return COMPACT_CONTINUE; 69 return COMPACT_CONTINUE;
63} 70}
64 71
72static inline int compact_pgdat(pg_data_t *pgdat, int order)
73{
74 return COMPACT_CONTINUE;
75}
76
65static inline unsigned long compaction_suitable(struct zone *zone, int order) 77static inline unsigned long compaction_suitable(struct zone *zone, int order)
66{ 78{
67 return COMPACT_SKIPPED; 79 return COMPACT_SKIPPED;
68} 80}
69 81
70static inline void defer_compaction(struct zone *zone) 82static inline void defer_compaction(struct zone *zone, int order)
71{ 83{
72} 84}
73 85
74static inline bool compaction_deferred(struct zone *zone) 86static inline bool compaction_deferred(struct zone *zone, int order)
75{ 87{
76 return 1; 88 return 1;
77} 89}