From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 597D6C433E0 for ; Mon, 29 Jun 2020 13:14:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D55023D56 for ; Mon, 29 Jun 2020 13:14:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="nHbvHZHI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D55023D56 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8691E89F27; Mon, 29 Jun 2020 13:14:33 +0000 (UTC) Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id A94EA6E876 for ; Wed, 24 Jun 2020 20:47:26 +0000 (UTC) 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 To: Jason Gunthorpe , Chris Wilson 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-Language: en-US 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== X-Mailman-Approved-At: Mon, 29 Jun 2020 13:14:32 +0000 Subject: Re: [Intel-gfx] [PATCH] mm: Skip opportunistic reclaim for dma pinned pages X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kara , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Andrew Morton , Claudio Imbrenda , "Kirill A . Shutemov" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx