Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-25 Thread Yang Shi
On Thu, Jun 25, 2020 at 4:42 AM Matthew Wilcox wrote: > > On Wed, Jun 24, 2020 at 08:14:17PM +0100, Chris Wilson wrote: > > A side effect of the LRU shrinker not being dma aware is that we will > > often attempt to perform direct reclaim on the persistent group of dma > > pages while continuing to

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-25 Thread Matthew Wilcox
On Thu, Jun 25, 2020 at 03:40:44PM +0200, Jan Kara wrote: > On Thu 25-06-20 12:42:09, Matthew Wilcox wrote: > > Why are DMA pinned pages still on the LRU list at all? I never got an > > answer to this that made sense to me. By definition, a page which is > > pinned for DMA is being accessed, and

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-25 Thread Michal Hocko
On Thu 25-06-20 12:00:47, Chris Wilson wrote: > Quoting Michal Hocko (2020-06-25 08:57:25) > > On Wed 24-06-20 20:14:17, Chris Wilson wrote: > > > A general rule of thumb is that shrinkers should be fast and effective. > > > They are called from direct reclaim at the most incovenient of times when

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-25 Thread Jan Kara
On Thu 25-06-20 12:42:09, Matthew Wilcox wrote: > On Wed, Jun 24, 2020 at 08:14:17PM +0100, Chris Wilson wrote: > > A side effect of the LRU shrinker not being dma aware is that we will > > often attempt to perform direct reclaim on the persistent group of dma > > pages while continuing to use the

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-25 Thread Matthew Wilcox
On Wed, Jun 24, 2020 at 08:14:17PM +0100, Chris Wilson wrote: > A side effect of the LRU shrinker not being dma aware is that we will > often attempt to perform direct reclaim on the persistent group of dma > pages while continuing to use the dma HW (an issue as the HW may already > be actively wai

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-25 Thread Jan Kara
On Wed 24-06-20 17:11:30, John Hubbard wrote: > On 2020-06-24 16:20, Jason Gunthorpe wrote: > > > I do like this code change, though. And I *think* it's actually safe to > > > do this, as it stays away from writeback or other filesystem activity. > > > But let me double check that, in case I'm forg

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-25 Thread Michal Hocko
On Wed 24-06-20 20:14:17, Chris Wilson wrote: > A general rule of thumb is that shrinkers should be fast and effective. > They are called from direct reclaim at the most incovenient of times when > the caller is waiting for a page. If we attempt to reclaim a page being > pinned for active dma [pin_

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-24 Thread John Hubbard
On 2020-06-24 16:20, Jason Gunthorpe wrote: ... I think Yang explained it - the page is removed from the mappings but freeing it does not happen because page_ref_freeze() does not succeed due to the pin. Presumably the mappings can reconnect to the same physical page if it is re-faulted to avoid

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-24 Thread Jason Gunthorpe
On Wed, Jun 24, 2020 at 01:47:23PM -0700, John Hubbard wrote: > On 2020-06-24 12:21, Jason Gunthorpe wrote: > > On Wed, Jun 24, 2020 at 08:14:17PM +0100, Chris Wilson wrote: > > > A general rule of thumb is that shrinkers should be fast and effective. > > > They are called from direct reclaim at th

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-24 Thread Yang Shi
On Wed, Jun 24, 2020 at 1:23 PM Yang Shi wrote: > > On Wed, Jun 24, 2020 at 12:21 PM Jason Gunthorpe wrote: > > > > On Wed, Jun 24, 2020 at 08:14:17PM +0100, Chris Wilson wrote: > > > A general rule of thumb is that shrinkers should be fast and effective. > > > They are called from direct reclaim

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-24 Thread John Hubbard
On 2020-06-24 12:21, Jason Gunthorpe wrote: On Wed, Jun 24, 2020 at 08:14:17PM +0100, Chris Wilson wrote: A general rule of thumb is that shrinkers should be fast and effective. They are called from direct reclaim at the most incovenient of times when the caller is waiting for a page. If we atte

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-24 Thread Yang Shi
On Wed, Jun 24, 2020 at 12:21 PM Jason Gunthorpe wrote: > > On Wed, Jun 24, 2020 at 08:14:17PM +0100, Chris Wilson wrote: > > A general rule of thumb is that shrinkers should be fast and effective. > > They are called from direct reclaim at the most incovenient of times when > > the caller is wait

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-24 Thread Jason Gunthorpe
On Wed, Jun 24, 2020 at 08:14:17PM +0100, Chris Wilson wrote: > A general rule of thumb is that shrinkers should be fast and effective. > They are called from direct reclaim at the most incovenient of times when > the caller is waiting for a page. If we attempt to reclaim a page being > pinned for

[PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-24 Thread Chris Wilson
A general rule of thumb is that shrinkers should be fast and effective. They are called from direct reclaim at the most incovenient of times when the caller is waiting for a page. If we attempt to reclaim a page being pinned for active dma [pin_user_pages()], we will incur far greater latency than