mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-04 21:31:51 +00:00
thp: use compaction in kswapd for GFP_ATOMIC order > 0
This takes advantage of memory compaction to properly generate pages of order > 0 if regular page reclaim fails and priority level becomes more severe and we don't reach the proper watermarks. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
878aee7d6b
commit
5a03b051ed
3 changed files with 54 additions and 18 deletions
|
@ -11,6 +11,9 @@
|
|||
/* The full zone was compacted */
|
||||
#define COMPACT_COMPLETE 3
|
||||
|
||||
#define COMPACT_MODE_DIRECT_RECLAIM 0
|
||||
#define COMPACT_MODE_KSWAPD 1
|
||||
|
||||
#ifdef CONFIG_COMPACTION
|
||||
extern int sysctl_compact_memory;
|
||||
extern int sysctl_compaction_handler(struct ctl_table *table, int write,
|
||||
|
@ -25,7 +28,8 @@ extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
|
|||
bool sync);
|
||||
extern unsigned long compaction_suitable(struct zone *zone, int order);
|
||||
extern unsigned long compact_zone_order(struct zone *zone, int order,
|
||||
gfp_t gfp_mask, bool sync);
|
||||
gfp_t gfp_mask, bool sync,
|
||||
int compact_mode);
|
||||
|
||||
/* Do not skip compaction more than 64 times */
|
||||
#define COMPACT_MAX_DEFER_SHIFT 6
|
||||
|
@ -70,9 +74,10 @@ static inline unsigned long compaction_suitable(struct zone *zone, int order)
|
|||
}
|
||||
|
||||
static inline unsigned long compact_zone_order(struct zone *zone, int order,
|
||||
gfp_t gfp_mask, bool sync)
|
||||
gfp_t gfp_mask, bool sync,
|
||||
int compact_mode)
|
||||
{
|
||||
return 0;
|
||||
return COMPACT_CONTINUE;
|
||||
}
|
||||
|
||||
static inline void defer_compaction(struct zone *zone)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue