Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp921446ybt; Wed, 24 Jun 2020 14:54:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHODwjhbuc//VIIcphPAsuSKDBasOVsGJ4r4ReI/f9K6qxcYqlS+VBZ360I6hIzrNenReU X-Received: by 2002:a17:907:94cf:: with SMTP id dn15mr25061072ejc.457.1593035676196; Wed, 24 Jun 2020 14:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593035676; cv=none; d=google.com; s=arc-20160816; b=J6NLwXEwXz+G8d8nnaiACtSa/7scXA1sUah6AVUcxH2XtQIQgjS3qMBC7urzwixdwD 5oPMRoXcU2sgyRMFjBUrkgNXWWCfxeMK58kQuoHYsMrxIwQIPEpcb96ZKG40HsdmxLGa G9UY92Ysebqiv1qILJsTkp70JDB0ADfL1bHly0EWX/984nF8Yxv2YMi6oKr6DAVGvcVD gE2i9dzA7vMgvohjRXrPJ9c+qHnuUEKNv816BgtPeRkTPnRv9j7wrZl5aVID0iGB2Ndi 7XfmpNVS5lg5WMDXYHZKCF30fDJrgFRl7qr+fLUPDidAM5UR0SCHaJYLBO1ZzuxYfaqb f/PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=2lne34Bgsltqu3lapK9YX7sbymR3G2JcYO7zm77mdNE=; b=tAtH/rm059YubnyYBZpfRyybu6XkQZhGpZQxbtD0N2uN3zrTfVkgjSYTxjeJvnvYQI BGnuNEkeL4o2RNvIxz/vVklVFuDW0STiqU6wAnzdKIhps+nRQVPK/FUUU0ablXGOV1Sa NSJZh22HVWxN1reKhYzUNgc1No6WM/AK972m11EKpxOZ1nry6VQkgzDvj6/oy3pievvw J3Me6h7eOiQWugLxGYWnp3NP7d+pFJHBpe8ZBkoEIIZwt42vM1OOS15F152GNKBVBjyq yBMiN/svCGwwacT5ij7Omx3KllpMCWCLb/ItAoslid74DMggBoenJH09j7uYOqhAr+f7 pvJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=nHbvHZHI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt12si20589368ejc.46.2020.06.24.14.53.45; Wed, 24 Jun 2020 14:54:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=nHbvHZHI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390112AbgFXUr1 (ORCPT + 99 others); Wed, 24 Jun 2020 16:47:27 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:1502 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729867AbgFXUr1 (ORCPT ); Wed, 24 Jun 2020 16:47:27 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 24 Jun 2020 13:47:13 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Wed, 24 Jun 2020 13:47:26 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Wed, 24 Jun 2020 13:47:26 -0700 Received: from [10.2.59.206] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 24 Jun 2020 20:47:24 +0000 Subject: Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages To: Jason Gunthorpe , Chris Wilson CC: , , , Andrew Morton , Jan Kara , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Claudio Imbrenda , "Kirill A . Shutemov" References: <20200624191417.16735-1-chris@chris-wilson.co.uk> <20200624192116.GO6578@ziepe.ca> From: John Hubbard Message-ID: <44708b2e-479f-7d58-fe01-29cfd6c70bdb@nvidia.com> Date: Wed, 24 Jun 2020 13:47:23 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200624192116.GO6578@ziepe.ca> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1593031633; bh=2lne34Bgsltqu3lapK9YX7sbymR3G2JcYO7zm77mdNE=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=nHbvHZHIjUANZly99KWpI0RSdeNad4AK7nIXU5pCxrbQ5vWImuiYwSjbdJoCOXR08 IdrDGS/BHFsg0UX2z3Pzd0rnDwisWyZp9RUN6N8lUHHZtMQmzYj8ryw7VGqnos1xWz /PJBzVgEP16oGD6Jhptv7NtjKJQoWrqGTz4l68UmxP2JQZhZDH5PF986iJQz0XiSkE Ghw1gl1yBLHuE5BDJPtDcNRizNB/blV6dUTzudJqHMJplitxETQg24AjXsYG8fGstc 22evbs+ZsahLfC8gaXvPNambISBtM6BQLhP5vScPMbb/e7g1fzUr2UtTTUAfRh2HoK 9fUDzyn6K/GBA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 attempt to reclaim a page being >> pinned for active dma [pin_user_pages()], we will incur far greater >> latency than a normal anonymous page mapped multiple times. Worse the >> page may be in use indefinitely by the HW and unable to be reclaimed >> in a timely manner. > > A pinned page can't be migrated, discarded or swapped by definition - > it would cause data corruption. > > So, how do things even get here and/or work today at all? I think the > explanation is missing something important. > Well, those activities generally try to unmap the page, and have to be prepared to deal with failure to unmap. From my reading, it seemed very clear. What's less clear is why the comment and the commit description only talk about reclaim, when there are additional things that call try_to_unmap(), including: migrate_vma_unmap() split_huge_page_to_list() --> unmap_page() 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 forgetting something. thanks, -- John Hubbard NVIDIA