From: Matthew Wilcox <willy@infradead.org>
To: linux-mm@kvack.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: [PATCH v2 15/15] mm: Pass order to node_reclaim() in GFP flags
Date: Fri, 10 May 2019 06:50:38 -0700 [thread overview]
Message-ID: <20190510135038.17129-16-willy@infradead.org> (raw)
In-Reply-To: <20190510135038.17129-1-willy@infradead.org>
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
include/trace/events/vmscan.h | 8 +++-----
mm/internal.h | 5 ++---
mm/page_alloc.c | 2 +-
mm/vmscan.c | 13 ++++++-------
4 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index a6b1b20333b4..2714d9ef54e6 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -460,25 +460,23 @@ TRACE_EVENT(mm_vmscan_inactive_list_is_low,
TRACE_EVENT(mm_vmscan_node_reclaim_begin,
- TP_PROTO(int nid, int order, gfp_t gfp_flags),
+ TP_PROTO(int nid, gfp_t gfp_flags),
- TP_ARGS(nid, order, gfp_flags),
+ TP_ARGS(nid, gfp_flags),
TP_STRUCT__entry(
__field(int, nid)
- __field(int, order)
__field(gfp_t, gfp_flags)
),
TP_fast_assign(
__entry->nid = nid;
- __entry->order = order;
__entry->gfp_flags = gfp_flags;
),
TP_printk("nid=%d order=%d gfp_flags=%s",
__entry->nid,
- __entry->order,
+ gfp_order(__entry->gfp_flags),
show_gfp_flags(__entry->gfp_flags))
);
diff --git a/mm/internal.h b/mm/internal.h
index 9eeaf2b95166..353cefdc3f34 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -457,10 +457,9 @@ static inline void mminit_validate_memmodel_limits(unsigned long *start_pfn,
#define NODE_RECLAIM_SUCCESS 1
#ifdef CONFIG_NUMA
-extern int node_reclaim(struct pglist_data *, gfp_t, unsigned int);
+extern int node_reclaim(struct pglist_data *, gfp_t);
#else
-static inline int node_reclaim(struct pglist_data *pgdat, gfp_t mask,
- unsigned int order)
+static inline int node_reclaim(struct pglist_data *pgdat, gfp_t mask)
{
return NODE_RECLAIM_NOSCAN;
}
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 29daaf4ae4fb..5365ee2e8c0b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3595,7 +3595,7 @@ get_page_from_freelist(gfp_t gfp_mask, int alloc_flags,
!zone_allows_reclaim(ac->preferred_zoneref->zone, zone))
continue;
- ret = node_reclaim(zone->zone_pgdat, gfp_mask, order);
+ ret = node_reclaim(zone->zone_pgdat, gfp_mask);
switch (ret) {
case NODE_RECLAIM_NOSCAN:
/* did not scan */
diff --git a/mm/vmscan.c b/mm/vmscan.c
index e4d4d9c1d7a9..b7f141de9814 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4124,17 +4124,17 @@ static unsigned long node_pagecache_reclaimable(struct pglist_data *pgdat)
/*
* Try to free up some pages from this node through reclaim.
*/
-static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order)
+static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask)
{
/* Minimum pages needed in order to stay on node */
- const unsigned long nr_pages = 1 << order;
+ const unsigned long nr_pages = 1UL << gfp_order(gfp_mask);
struct task_struct *p = current;
struct reclaim_state reclaim_state;
unsigned int noreclaim_flag;
struct scan_control sc = {
.nr_to_reclaim = max(nr_pages, SWAP_CLUSTER_MAX),
.gfp_mask = current_gfp_context(gfp_mask),
- .order = order,
+ .order = gfp_order(gfp_mask),
.priority = NODE_RECLAIM_PRIORITY,
.may_writepage = !!(node_reclaim_mode & RECLAIM_WRITE),
.may_unmap = !!(node_reclaim_mode & RECLAIM_UNMAP),
@@ -4142,8 +4142,7 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in
.reclaim_idx = gfp_zone(gfp_mask),
};
- trace_mm_vmscan_node_reclaim_begin(pgdat->node_id, order,
- sc.gfp_mask);
+ trace_mm_vmscan_node_reclaim_begin(pgdat->node_id, sc.gfp_mask);
cond_resched();
fs_reclaim_acquire(sc.gfp_mask);
@@ -4177,7 +4176,7 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in
return sc.nr_reclaimed >= nr_pages;
}
-int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order)
+int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask)
{
int ret;
@@ -4213,7 +4212,7 @@ int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order)
if (test_and_set_bit(PGDAT_RECLAIM_LOCKED, &pgdat->flags))
return NODE_RECLAIM_NOSCAN;
- ret = __node_reclaim(pgdat, gfp_mask, order);
+ ret = __node_reclaim(pgdat, gfp_mask);
clear_bit(PGDAT_RECLAIM_LOCKED, &pgdat->flags);
if (!ret)
--
2.20.1
next prev parent reply other threads:[~2019-05-10 13:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-10 13:50 [PATCH v2 00/15] Remove 'order' argument from many mm functions Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 01/15] mm: Remove gfp_flags argument from rmqueue_pcplist Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 02/15] mm: Pass order to __alloc_pages_nodemask in GFP flags Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 03/15] mm: Pass order to __alloc_pages " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 04/15] mm: Pass order to alloc_page_interleave " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 05/15] mm: Pass order to alloc_pages_current " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 06/15] mm: Pass order to alloc_pages_vma " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 07/15] mm: Pass order to __alloc_pages_node " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 08/15] mm: Pass order to __get_free_page " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 09/15] mm: Pass order to prep_new_page " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 10/15] mm: Pass order to rmqueue " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 11/15] mm: Pass order to get_page_from_freelist " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 12/15] mm: Pass order to __alloc_pages_cpuset_fallback " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 13/15] mm: Pass order to prepare_alloc_pages " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 14/15] mm: Pass order to try_to_free_pages " Matthew Wilcox
2019-05-10 23:26 ` Ira Weiny
2019-05-10 13:50 ` Matthew Wilcox [this message]
2019-05-10 23:30 ` [PATCH v2 00/15] Remove 'order' argument from many mm functions Ira Weiny
2019-05-13 10:51 ` Michal Hocko
2019-05-13 11:21 ` Matthew Wilcox
2019-05-13 11:42 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190510135038.17129-16-willy@infradead.org \
--to=willy@infradead.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).