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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 CC712C433DF for ; Wed, 24 Jun 2020 19:21:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 73C6020823 for ; Wed, 24 Jun 2020 19:21:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="OJncFXFd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73C6020823 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 06E686B0008; Wed, 24 Jun 2020 15:21:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 01E4E6B000A; Wed, 24 Jun 2020 15:21:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E4F766B000C; Wed, 24 Jun 2020 15:21:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id CE8386B0008 for ; Wed, 24 Jun 2020 15:21:19 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 57DF82DFC for ; Wed, 24 Jun 2020 19:21:19 +0000 (UTC) X-FDA: 76965073878.19.watch45_2f01a4a26e46 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 21DA91AD1B1 for ; Wed, 24 Jun 2020 19:21:19 +0000 (UTC) X-HE-Tag: watch45_2f01a4a26e46 X-Filterd-Recvd-Size: 4044 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 19:21:18 +0000 (UTC) Received: by mail-qv1-f47.google.com with SMTP id p7so1599466qvl.4 for ; Wed, 24 Jun 2020 12:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lbKCmmztI3GgkMC9SQmlMbuo/bkXgsTXp+Ju628Hzro=; b=OJncFXFdbc+4VNNWbBXY/ONS10iTtFLqYn5Nej/BXiYIlE7wXPRGFVSu8ZW607rFKr YknLuolvGMfXTw1BdQHDCnuJQI8IZ6e1ci5+5PMyFELyMNYv+yReSBqpSfGs10N4398w 6/M5HZ7dqwB1N6G71BIQ0sTf1V8F056Nsfj7I8ub3w36xCjEXwOz6x5x3TWV7KfmsSk3 vDTPMwCKXuQIt+B3olNNZtkZ5sWsE3yQQQpgCMuoryEKw4DkykTYk4c218295wog872Y 0VtDMaiEWJMNPTdQk9qgfZB4FowV506Ijg9f+kTS/YvAvzmq4EuQzUl/AY2TSgsnnw5T QgHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lbKCmmztI3GgkMC9SQmlMbuo/bkXgsTXp+Ju628Hzro=; b=PTUh8urxSJuQKPOSz0LcuajRz8Nelepf8MDUhI0D3RAygvQq3AWARBigFN1lpSxORm WGHP9UkmhpqmpdlFGOl8HxYNUlHqgLF5E3wTKiWCo1of1GXcmh5jgU+t2SrCu8AUvugs QbHscVZCxNsnCgpvgxr9cywQ1JpFV0xvhXWGpkxclxrcwnWWup6Hmtfm7Y7AQLv18a3s oiuxPQrXzKuirWMQPUpcHHZ5n8oGdq6ml7L0KAZRRa8bf35/7/2cEhZiMjZxpFpvLxFi r2TI7S3JhKKb3gDG1AtypaWWFYunDCK+SA/f1yXGFKCpPWzJ5gnwLrkwugLSnFU+W9dS qAUw== X-Gm-Message-State: AOAM533QBuNUDCX5Q/2qD+gNMVHbvX16P4bPxmsticiXdZ2zusZNsdmp Js3e7J/hScNEU2arLSTGdPF5UQ== X-Google-Smtp-Source: ABdhPJyho45QObrN+BKeqm/MpnwnYYjrO/2aj2hyfcW5lNxqkyNoe1fDIsNNoLHTtmdM5ssJGxFWzQ== X-Received: by 2002:a05:6214:1190:: with SMTP id t16mr33464697qvv.219.1593026477776; Wed, 24 Jun 2020 12:21:17 -0700 (PDT) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id k26sm3854365qki.98.2020.06.24.12.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 12:21:17 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.93) (envelope-from ) id 1joAxQ-00DixB-Bk; Wed, 24 Jun 2020 16:21:16 -0300 Date: Wed, 24 Jun 2020 16:21:16 -0300 From: Jason Gunthorpe To: Chris Wilson Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, Andrew Morton , Jan Kara , =?utf-8?B?SsOpcsO0bWU=?= Glisse , John Hubbard , Claudio Imbrenda , "Kirill A . Shutemov" Subject: Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages Message-ID: <20200624192116.GO6578@ziepe.ca> References: <20200624191417.16735-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624191417.16735-1-chris@chris-wilson.co.uk> X-Rspamd-Queue-Id: 21DA91AD1B1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Jason