Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp188725imm; Tue, 19 Jun 2018 18:58:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ+dxhw079DQCc4LRsHP22pOpn1JGJaHiKzQhPi8BtJQoxKVF6Bv2J9ZiXlnVCexaYGZFYB X-Received: by 2002:a62:494f:: with SMTP id w76-v6mr20389870pfa.152.1529459923494; Tue, 19 Jun 2018 18:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529459923; cv=none; d=google.com; s=arc-20160816; b=DxAf4gL1anO31p4kwKWnkr4z/SvlKG74Ok1MNB61N7rPaFI3avjBS2ImHePlefbTyD oB0Hj7I2J4HMkW52jrHZ9+gk4SJ9yeJvKagZiq195YWV3mLPf/smnPC+ZQy6Bv775fi8 aJ1IuuGqybUUfBbLJYfqp4+VS5MNgglKWAoRK9+OIoqwuE+MBtq/Oe5Ole8gEQhZzQdu Kqr5vRI+A1B8Cb4uDRsKUyptAhJ5P+QW0AG7KvjS/vHbIEyfRttzycorik+4FJClqWQO ChS2XvGuIcl0d1/llsPQdD22WuO0saLFwrqGj9SEKDJZRCHIgzG4CQsMS2eAdRz+cgS1 ASZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=x1cDTKwy+A0g7klqr4/9PADmywcPYq6UGwzf/26w3Fc=; b=LJe2l5lufv+Wd8Z9hLyv8CyK/xKmUeQMOxgwSxfurVIuN3w8BPjQ0O9MjoAacSutvj MWBLXgOcL9RM6amH3QAuJkcO9DUw69bhEb7/3fmUPYb5FG8Rgx6u1oUms2Xrd/LaMBOi N/BCX04Krvcfkh4zKGKC5quOs3lmJGa2GEZ2NMyKYQ+RB5dylfQjNfDVI4FMWSyjGftZ 4tiewGbVfT3uk/7eOVXu/JF1gDk5x03XV3w3FyHFUUtNOUjnaHsm1hiAZ1JVyTnUZT8r xC6mkn0WusQ0pay8Gy9Gr4X0pH17MnColJm7qCOcD3SM2fGT9ktQ+Loc4g6LptJCRWmh ILLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=dYeowoDr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10-v6si1065056plg.396.2018.06.19.18.58.28; Tue, 19 Jun 2018 18:58:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=dYeowoDr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754014AbeFTB5p (ORCPT + 99 others); Tue, 19 Jun 2018 21:57:45 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:36247 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753619AbeFTB5m (ORCPT ); Tue, 19 Jun 2018 21:57:42 -0400 Received: by mail-oi0-f67.google.com with SMTP id 14-v6so1609177oie.3 for ; Tue, 19 Jun 2018 18:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=x1cDTKwy+A0g7klqr4/9PADmywcPYq6UGwzf/26w3Fc=; b=dYeowoDrdhsa/IKDB+Ai0hYgs7PYNvN5oYRKUTBu/ilzsR/K1MZjGzSRBV0T9KLukq etalU8pGG0vQmJpbBLkbDEz2iypN1G4OfD3OtZqvFghees4u0u2AaX6OCFxYya/eii/q SEcUEjcg1w4cnwqucam7m+JNhWWY7myBH+qDpVQ2SvFeht1xpjK1aCfMs6Su0CNg7QSZ 8lsBiZC18gmmXgiyTycDZMGNBZ7qDHt2L+WkCzt6M7dEEdOXIOWyEtS4cWvLmNZ1RNSB CFyOLs0ImKJuI7MYtQH/ofQnG+doIlECn+e3GTijjZpU8DTrQ+nmGW+3tQ7dWnFIya7W URjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=x1cDTKwy+A0g7klqr4/9PADmywcPYq6UGwzf/26w3Fc=; b=kBvLWu9tH2rPl0SVtvejmmXyy8JOwszi6rOUCs+1i9k5Au0BVpNeuki3aYO+eUlydg GfPMyISe+jsUyP0Od02tIdVntYoNlOUTYnq2pj3sECyYYq1L7X37Ap86Bq/ELSFimqRH ltX2Lbw6JUgWHEhueGdp9vJ3YUCdkvzKGA8ddXPdUTqhky+UYUwmMgkrGaI4rGHFiRDQ CUe47g3ZOANfPjM6PXjU8QLpHDUzr2pXDfOv3VdLTvfU5l7gL8aXRlKeRtMB6LDHoSa/ L8M1AIhyZ3ycdNlt0ubOLc61WEHXZoE2kZiA6e6KfhRJZ5GOddrIJCkc/1Zhcze8TIcK i4Ig== X-Gm-Message-State: APt69E3iBUdginb8h4BKZirfCGIiYTmCrYXoP/IF+rTM2OfSh/GK6zsK fBO9y5cOoQMgWhGYHROAatMR+Zu4NlyZUWPnCAiFQA== X-Received: by 2002:aca:745:: with SMTP id 66-v6mr10015355oih.295.1529459861835; Tue, 19 Jun 2018 18:57:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:2ea9:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 18:57:41 -0700 (PDT) In-Reply-To: References: <311eba48-60f1-b6cc-d001-5cc3ed4d76a9@nvidia.com> <20180618081258.GB16991@lst.de> <3898ef6b-2fa0-e852-a9ac-d904b47320d5@nvidia.com> <0e6053b3-b78c-c8be-4fab-e8555810c732@nvidia.com> <20180619082949.wzoe42wpxsahuitu@quack2.suse.cz> <20180619090255.GA25522@bombadil.infradead.org> <20180619104142.lpilc6esz7w3a54i@quack2.suse.cz> <70001987-3938-d33e-11e0-de5b19ca3bdf@nvidia.com> From: Dan Williams Date: Tue, 19 Jun 2018 18:57:41 -0700 Message-ID: Subject: Re: [PATCH 2/2] mm: set PG_dma_pinned on get_user_pages*() To: John Hubbard Cc: Jan Kara , Matthew Wilcox , Christoph Hellwig , Jason Gunthorpe , John Hubbard , Michal Hocko , Christopher Lameter , Linux MM , LKML , linux-rdma Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 19, 2018 at 6:34 PM, John Hubbard wrote: > On 06/19/2018 06:24 PM, Dan Williams wrote: >> On Tue, Jun 19, 2018 at 11:11 AM, John Hubbard wrote: >>> On 06/19/2018 03:41 AM, Jan Kara wrote: >>>> On Tue 19-06-18 02:02:55, Matthew Wilcox wrote: >>>>> On Tue, Jun 19, 2018 at 10:29:49AM +0200, Jan Kara wrote: >> [..] >>>> And then there's the aspect that both these approaches are a bit too >>>> heavyweight for some get_user_pages_fast() users (e.g. direct IO) - Al Viro >>>> had an idea to use page lock for that path but e.g. fs/direct-io.c would have >>>> problems due to lock ordering constraints (filesystem ->get_block would >>>> suddently get called with the page lock held). But we can probably leave >>>> performance optimizations for phase two. >>> >>> >>> So I assume that phase one would be to apply this approach only to >>> get_user_pages_longterm. (Please let me know if that's wrong.) >> >> I think that's wrong, because get_user_pages_longterm() is only a >> filesystem-dax avoidance mechanism, it's not trying to address all the >> problems that Jan is talking about. I don't see any viable half-step >> solutions. >> > > OK, but in that case, I'm slightly confused by Jan's comment above, about leaving > performance optimizations until phase two. Because that *is* a half-step approach: > phase one, phase two. No, sorry, I might be confusing things. The half step is leaving truncate broken, or my strawman that only addressed unmap. > Are you disagreeing with Jan, or are you suggesting "fix get_user_pages first, and > leave get_user_pages_fast alone for now?" I'm agreeing with Jan, we need to fix page_mkclean() and try_to_unmap() without regressing truncate behavior.