Re: [v2 PATCH 1/2] mm: swap: check if swap backing device is congested or not

2018-12-21 Thread Yang Shi
On 12/21/18 10:34 AM, Tim Chen wrote: On 12/20/18 4:21 PM, Yang Shi wrote: --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -538,11 +538,17 @@ struct page *swap_cluster_readahead(swp_entry_t entry, gfp_t gfp_mask, bool do_poll = true, page_allocated; struct vm_area_struct *vma

Re: [v2 PATCH 1/2] mm: swap: check if swap backing device is congested or not

2018-12-21 Thread Tim Chen
On 12/20/18 4:21 PM, Yang Shi wrote: > --- a/mm/swap_state.c > +++ b/mm/swap_state.c > @@ -538,11 +538,17 @@ struct page *swap_cluster_readahead(swp_entry_t entry, > gfp_t gfp_mask, > bool do_poll = true, page_allocated; > struct vm_area_struct *vma = vmf->vma; > unsigned long a

[v2 PATCH 1/2] mm: swap: check if swap backing device is congested or not

2018-12-20 Thread Yang Shi
Swap readahead would read in a few pages regardless if the underlying device is busy or not. It may incur long waiting time if the device is congested, and it may also exacerbate the congestion. Use inode_read_congested() to check if the underlying device is busy or not like what file page readah