Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp13371pxf; Tue, 23 Mar 2021 20:12:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO9R34JQVxasAooZqlW4BkpxpJrZ4NVPR4xoT+86ZdLgIZ0JiZcAgCFMd4Pk3dp0cQN+lj X-Received: by 2002:a17:906:aed6:: with SMTP id me22mr1367880ejb.146.1616555536705; Tue, 23 Mar 2021 20:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616555536; cv=none; d=google.com; s=arc-20160816; b=Hexav7dsGVL3Ml6A3QAl9iGApiON8FNdadO2jv8w7DDyNcacz5rxtbLK9AUoKXf49h EmaLToT/7/2RXS3TjjUEOwaBsoM0QAC90Soz9SNjXY5BaeTjSQnT7pD0lUzkcoFtEp29 vWddOvrR6WA/dP84NCKu5qsUZnE29bSsHFczEVmdSCPtHqYRiNOphn8Xxh1JhoNQ1swV FmzzY8O+YiT0GY3jB/VrRy92oHt093+HH1ZK5+YmMI56Ewwvzf044CG/GOyaheNf0yP1 QbUW9TLqK5mct7/ZhJfTp0EyJDVS39w9FHfVeRbtrtJQyHXL+rtYpKwxnrpevA7nle9o m6rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=u6LQ9z7na2aZkO8qszFamJZoAB7+bZ8ZYKCjVaf5Sfw=; b=GbnnxuZsoiqvW+DZHhLKjbhGbMBOwvEfjCN+GxiOocKkpt1fy9sB4NUgTUHHlvr+Gy dIXhhG0CEHLXcVwZUxlGERC+/yokI3Ip2NE6Pq5xLiYqX7omUO76WmPJm3SndSruDRIP wbCkHl/QSNWNm1twqQCEKyCKfLjp8dH8GJrtqqCeYcYKoa/EFPQyHJMWPZFF52eSQ6sZ b5LEWm71SryWuVQuvJrYT+2jt/Ocaw8yyqDdlQQfqqZalJDtDbQQC/+mDGVDuAkrvpi5 /Y2R2kA6fJ4pDkynp37Y1g2IFvw6ld/DlN63VMOTRfxybwDqgHXgWcX8eZZMM/ifZTVL 6CoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=FHZiIXFT; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g27si794560ejc.32.2021.03.23.20.11.51; Tue, 23 Mar 2021 20:12:16 -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=fail (test mode) header.i=@shipmail.org header.s=mail header.b=FHZiIXFT; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232608AbhCWPFo (ORCPT + 99 others); Tue, 23 Mar 2021 11:05:44 -0400 Received: from pio-pvt-msa3.bahnhof.se ([79.136.2.42]:36388 "EHLO pio-pvt-msa3.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232518AbhCWPFR (ORCPT ); Tue, 23 Mar 2021 11:05:17 -0400 Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa3.bahnhof.se (Postfix) with ESMTP id 8ADF93FBD2; Tue, 23 Mar 2021 16:05:15 +0100 (CET) Authentication-Results: pio-pvt-msa3.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b=FHZiIXFT; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Flag: NO X-Spam-Score: -2.1 X-Spam-Level: X-Spam-Status: No, score=-2.1 tagged_above=-999 required=6.31 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no Received: from pio-pvt-msa3.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa3.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bl9FkwmAFN1D; Tue, 23 Mar 2021 16:05:14 +0100 (CET) Received: by pio-pvt-msa3.bahnhof.se (Postfix) with ESMTPA id A80863F84E; Tue, 23 Mar 2021 16:05:11 +0100 (CET) Received: from [192.168.0.209] (unknown [192.198.151.43]) by mail1.shipmail.org (Postfix) with ESMTPSA id E31823602AF; Tue, 23 Mar 2021 16:05:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1616511911; bh=ERRcOLv79yXvN5bQmSpWkBFFjvHOVmKGZWh48H3jXZg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=FHZiIXFTZJTov+7Y6hz8XbGGOxxnA+/UU9rC1aJzGqUPG4RYqXwljopR6NAfvmX3B RiGxPJdgALXFMrqDKNaoxOdiQ5zhUMmji651p/Z0wqlmVOUtjqL+8HNcZGQvtU+1WP Rh5WLj/6apbPakGeqElDVHyhNnfY1yMSz79lQtEY= Subject: Re: [RFC PATCH 1/2] mm,drm/ttm: Block fast GUP to TTM huge pages To: Jason Gunthorpe Cc: dri-devel@lists.freedesktop.org, Christian Koenig , David Airlie , Daniel Vetter , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210321184529.59006-1-thomas_os@shipmail.org> <20210321184529.59006-2-thomas_os@shipmail.org> <20210323135217.GD2356281@nvidia.com> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28Intel=29?= Message-ID: Date: Tue, 23 Mar 2021 16:05:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210323135217.GD2356281@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/23/21 2:52 PM, Jason Gunthorpe wrote: > On Sun, Mar 21, 2021 at 07:45:28PM +0100, Thomas Hellström (Intel) wrote: >> diff --git a/mm/gup.c b/mm/gup.c >> index e40579624f10..1b6a127f0bdd 100644 >> +++ b/mm/gup.c >> @@ -1993,6 +1993,17 @@ static void __maybe_unused undo_dev_pagemap(int *nr, int nr_start, >> } >> >> #ifdef CONFIG_ARCH_HAS_PTE_SPECIAL >> +/* >> + * If we can't determine whether or not a pte is special, then fail immediately >> + * for ptes. Note, we can still pin HugeTLB as it is guaranteed not to be >> + * special. For THP, special huge entries are indicated by xxx_devmap() >> + * returning true, but a corresponding call to get_dev_pagemap() will >> + * return NULL. >> + * >> + * For a futex to be placed on a THP tail page, get_futex_key requires a >> + * get_user_pages_fast_only implementation that can pin pages. Thus it's still >> + * useful to have gup_huge_pmd even if we can't operate on ptes. >> + */ > Why move this comment? I think it was correct where it was Yes, you're right. I misread it to refer to the actual code in the gup_pte_range function rather than to the empty version. I'll move it back. /Thomas > > Jason