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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 2A79FC388F2 for ; Fri, 6 Nov 2020 10:02:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 193D02087E for ; Fri, 6 Nov 2020 10:02:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="JxYI6LDo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 193D02087E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 299146B005C; Fri, 6 Nov 2020 05:02:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 249386B005D; Fri, 6 Nov 2020 05:02:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1381A6B0068; Fri, 6 Nov 2020 05:02:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id D8D4E6B005C for ; Fri, 6 Nov 2020 05:02:10 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7F69D181AEF10 for ; Fri, 6 Nov 2020 10:02:10 +0000 (UTC) X-FDA: 77453552820.04.cart46_3703191272d1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 5E769800433C for ; Fri, 6 Nov 2020 10:02:10 +0000 (UTC) X-HE-Tag: cart46_3703191272d1 X-Filterd-Recvd-Size: 5251 Received: from mail-ot1-f68.google.com (mail-ot1-f68.google.com [209.85.210.68]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Fri, 6 Nov 2020 10:02:09 +0000 (UTC) Received: by mail-ot1-f68.google.com with SMTP id 32so760367otm.3 for ; Fri, 06 Nov 2020 02:02:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Pk2kOuIDyNkJ29R6DHQ3ZwTfwhAfAev58wxOeRlEcVQ=; b=JxYI6LDoYBIyKAFkO0mmU5GO0vKXW+XCgfB3nhMPB/96K75h8XEzFsF5vfwoI9o4Aa YXO5ScRni4mdNnVG7TEPzZnkXGbky0dU2v6WgMTgqxnDpBRtAtlXHbhIcZNyR+EoGosa 88KCvZizdR0CJdRqQAGfzd4+9xfkExbEg2qoA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Pk2kOuIDyNkJ29R6DHQ3ZwTfwhAfAev58wxOeRlEcVQ=; b=KFgmh2C8tlYF2oip3b0SsT6F2kr5cUwMvFTOvcKDI14m68bAFp7nVCKg0GpPauAij0 OUHv2bx925c7Mc1EWJRdghFZ/uf0cXNCJ1ObI13/buDLFv2Ok2qu1U+YEbcmchC7WIHP cfEV6i9H3v+KoF1yH6zHy2Y2CH/oOA42EYa4LEFNCROgKBZAbWjlsTu5GqLpU146Yv8y 0v6boTRAMFx0SUFHcu2S6L+bXM0XX5jZ6zq2HGagcBIV1s3phExOqKGBWMgcaxCyL8TV ZUlJbNsAz4ar+F2sh4Y/qNbPJuyc7qGoDqM/PsB8oOGWWdeqDTO/JQ8r2quA707NuF9K Y4zw== X-Gm-Message-State: AOAM53195MJB4vGJLHucmwHy9fAYXUQZYlzZvSo+kgg7GMMNR9atsBQV Uc7yqpMvSuvS+mGqdu+nuj7Z8Fmk1U2ENCsR7nfxJQ== X-Google-Smtp-Source: ABdhPJy9+JOeNi7tvqFhbCecRqz/u5D2Qj576z0eBlCGtTEM4NmQBII1FIZeWz8GCbRUxBcA/Ididy+MZpD88l6oJcg= X-Received: by 2002:a9d:6a19:: with SMTP id g25mr586779otn.303.1604656928858; Fri, 06 Nov 2020 02:02:08 -0800 (PST) MIME-Version: 1.0 References: <20201104140023.GQ36674@ziepe.ca> <20201104162125.GA13007@infradead.org> <20201104163758.GA17425@infradead.org> <20201104164119.GA18218@infradead.org> <20201104181708.GU36674@ziepe.ca> <20201105092524.GQ401619@phenom.ffwll.local> <20201105124950.GZ36674@ziepe.ca> <7ae3486d-095e-cf4e-6b0f-339d99709996@nvidia.com> In-Reply-To: <7ae3486d-095e-cf4e-6b0f-339d99709996@nvidia.com> From: Daniel Vetter Date: Fri, 6 Nov 2020 11:01:57 +0100 Message-ID: Subject: Re: [PATCH v5 05/15] mm/frame-vector: Use FOLL_LONGTERM To: John Hubbard Cc: Jason Gunthorpe , Christoph Hellwig , "J??r??me Glisse" , linux-samsung-soc , Jan Kara , Pawel Osciak , KVM list , Mauro Carvalho Chehab , LKML , DRI Development , Tomasz Figa , Linux MM , Kyungmin Park , Daniel Vetter , Andrew Morton , Marek Szyprowski , Dan Williams , Linux ARM , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" 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 Fri, Nov 6, 2020 at 5:08 AM John Hubbard wrote: > > On 11/5/20 4:49 AM, Jason Gunthorpe wrote: > > On Thu, Nov 05, 2020 at 10:25:24AM +0100, Daniel Vetter wrote: > >>> /* > >>> * If we can't determine whether or not a pte is special, then fail immediately > >>> * for ptes. Note, we can still pin HugeTLB and THP as these are guaranteed not > >>> * to be special. > >>> * > >>> * 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. > >>> */ > >> > >> We support hugepage faults in gpu drivers since recently, and I'm not > >> seeing a pud_mkhugespecial anywhere. So not sure this works, but probably > >> just me missing something again. > > > > It means ioremap can't create an IO page PUD, it has to be broken up. > > > > Does ioremap even create anything larger than PTEs? gpu drivers also tend to use vmf_insert_pfn* directly, so we can do on-demand paging and move buffers around. From what I glanced for lowest level we to the pte_mkspecial correctly (I think I convinced myself that vm_insert_pfn does that), but for pud/pmd levels it seems just yolo. remap_pfn_range seems to indeed split down to pte level always. > From my reading, yes. See ioremap_try_huge_pmd(). The ioremap here shouldn't matter, since this is for kernel-internal mappings. So that's all fine I think. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch