LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH RFC] mm: do not start node_reclaim for page order > MAX_ORDER
@ 2018-11-01 17:37 Konstantin Khlebnikov
  2018-11-02  8:55 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Khlebnikov @ 2018-11-01 17:37 UTC (permalink / raw)
  To: linux-mm, Andrew Morton, Michal Hocko, linux-kernel

Page allocator has check in __alloc_pages_slowpath() but nowdays
there is earlier entry point into reclimer without such check:
get_page_from_freelist() -> node_reclaim().

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
---
 mm/vmscan.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 62ac0c488624..52f672420f0b 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4117,6 +4117,12 @@ int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order)
 {
 	int ret;
 
+	/*
+	 * Do not scan if allocation will never succeed.
+	 */
+	if (order >= MAX_ORDER)
+		return NODE_RECLAIM_NOSCAN;
+
 	/*
 	 * Node reclaim reclaims unmapped file backed pages and
 	 * slab pages if we are over the defined limits.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH RFC] mm: do not start node_reclaim for page order > MAX_ORDER
  2018-11-01 17:37 [PATCH RFC] mm: do not start node_reclaim for page order > MAX_ORDER Konstantin Khlebnikov
@ 2018-11-02  8:55 ` Michal Hocko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2018-11-02  8:55 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: linux-mm, Andrew Morton, linux-kernel

On Thu 01-11-18 20:37:52, Konstantin Khlebnikov wrote:
> Page allocator has check in __alloc_pages_slowpath() but nowdays
> there is earlier entry point into reclimer without such check:
> get_page_from_freelist() -> node_reclaim().

Is the order check so expensive that it would be visible in the fast
path? Spreading these MAX_ORDER checks sounds quite fragile to me.

> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> ---
>  mm/vmscan.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 62ac0c488624..52f672420f0b 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -4117,6 +4117,12 @@ int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order)
>  {
>  	int ret;
>  
> +	/*
> +	 * Do not scan if allocation will never succeed.
> +	 */
> +	if (order >= MAX_ORDER)
> +		return NODE_RECLAIM_NOSCAN;
> +
>  	/*
>  	 * Node reclaim reclaims unmapped file backed pages and
>  	 * slab pages if we are over the defined limits.
> 

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-01 17:37 [PATCH RFC] mm: do not start node_reclaim for page order > MAX_ORDER Konstantin Khlebnikov
2018-11-02  8:55 ` Michal Hocko

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git