lkml.org 
[lkml]   [2020]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH for v5.8 3/3] mm/memory: fix IO cost for anonymous page
From
Date
On 6/16/20 8:16 AM, js1304@gmail.com wrote:
> From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>
> With synchronous IO swap device, swap-in is directly handled in fault
> code. Since IO cost notation isn't added there, with synchronous IO swap
> device, LRU balancing could be wrongly biased. Fix it to count it
> in fault code.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
> mm/memory.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index bc6a471..3359057 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -3143,6 +3143,14 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
> if (err)
> goto out_page;
>
> + /*
> + * XXX: Move to lru_cache_add() when it
> + * supports new vs putback
> + */
> + spin_lock_irq(&page_pgdat(page)->lru_lock);
> + lru_note_cost_page(page);
> + spin_unlock_irq(&page_pgdat(page)->lru_lock);
> +
> lru_cache_add(page);
> swap_readpage(page, true);
> }
>

\
 
 \ /
  Last update: 2020-06-29 23:30    [W:0.089 / U:3.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site