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=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 A351DC433DB for ; Tue, 23 Mar 2021 15:05:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1E70B619B4 for ; Tue, 23 Mar 2021 15:05:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E70B619B4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shipmail.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 934FC6B0202; Tue, 23 Mar 2021 11:05:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E4586B0204; Tue, 23 Mar 2021 11:05:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7AFB76B0205; Tue, 23 Mar 2021 11:05:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0044.hostedemail.com [216.40.44.44]) by kanga.kvack.org (Postfix) with ESMTP id 5D6046B0202 for ; Tue, 23 Mar 2021 11:05:35 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 147DD1803F9A1 for ; Tue, 23 Mar 2021 15:05:35 +0000 (UTC) X-FDA: 77951463030.34.C461B34 Received: from pio-pvt-msa3.bahnhof.se (pio-pvt-msa3.bahnhof.se [79.136.2.42]) by imf15.hostedemail.com (Postfix) with ESMTP id C5D40A001A93 for ; Tue, 23 Mar 2021 15:05:22 +0000 (UTC) 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 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-Language: en-US X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C5D40A001A93 X-Stat-Signature: c9mfmmuq7d6g41pufdqjtgwh6n35xok1 Received-SPF: none (shipmail.org>: No applicable sender policy available) receiver=imf15; identity=mailfrom; envelope-from=""; helo=pio-pvt-msa3.bahnhof.se; client-ip=79.136.2.42 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616511922-10985 Content-Transfer-Encoding: quoted-printable 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 3/23/21 2:52 PM, Jason Gunthorpe wrote: > On Sun, Mar 21, 2021 at 07:45:28PM +0100, Thomas Hellstr=C3=B6m (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, >> } >> =20 >> #ifdef CONFIG_ARCH_HAS_PTE_SPECIAL >> +/* >> + * If we can't determine whether or not a pte is special, then fail i= mmediately >> + * for ptes. Note, we can still pin HugeTLB as it is guaranteed not t= o 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 require= s a >> + * get_user_pages_fast_only implementation that can pin pages. Thus i= t'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=20 gup_pte_range function rather than to the empty version. I'll move it bac= k. /Thomas > > Jason