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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 B59E2C4363C for ; Wed, 7 Oct 2020 10:48:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1BB9F2080A for ; Wed, 7 Oct 2020 10:48:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ed2S/aeQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="QJhnd4W0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BB9F2080A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:MIME-Version:Date:Message-ID: From:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ngi+NwvEI1BrTgYOFi0oWS4I4FUa8A0PUO0mBHDCu4I=; b=Ed2S/aeQA1fKzs4JfxHmOfa7B IAO91i+Cba+VR52Cv8zZQGcrZ00y20BEuSZa9RYRcld572F1eb5w4WNCPhfro0rerq+GLNehcqQjF 6wuFJyXDQB2gkpk3kdhVsSGdWg0ws7snFJ3RCRgGaw2cZFZqFC9di4f2fcCbMe9YJVOi250MC72r5 XC+AuT1RtT0zcvB24puIo5LL4zQVaGUR72nE7KNiuhK+EzXGmg3zNkvtqCzBOG1p7slGPkStP34ai J6FGe9hETjdcgfadOyRhUu1bMTLKmu8MGl0jRQmXppBR6NsoErI2vkk2I0s+Jl7oRcmMDYkDNRdJA QAVteCbiQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ6yb-0006LV-G9; Wed, 07 Oct 2020 10:47:17 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ6yZ-0006Kt-Cx for linux-arm-kernel@lists.infradead.org; Wed, 07 Oct 2020 10:47:16 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201007104712euoutp018e17802c6b8a96b2982df3f27bddaa07~7sAYoKSa02208022080euoutp01n for ; Wed, 7 Oct 2020 10:47:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201007104712euoutp018e17802c6b8a96b2982df3f27bddaa07~7sAYoKSa02208022080euoutp01n DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1602067632; bh=E5XERvvgz2kHeHngJGLKNS1MxI488JkYoBjaEOnm4F0=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=QJhnd4W0iuSmYplSDfsdUsI1zbZQIqQKqYLdEDILkjXPjbTgyOJGqN33OrggZl2lt 8+H+WT9MataicZBMK6LfIHUbHXZEoTtO/GAY3dClQsV0KAO9YlZSOybiQs6d2srn70 Zg3jdiy20Fm1DYEzghh1/EBNToxgyGD7SW/k8K+4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201007104712eucas1p15a76d78779d57144160e51c36d83d24e~7sAYLFOLh3224932249eucas1p1I; Wed, 7 Oct 2020 10:47:12 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id ED.76.06456.0BC9D7F5; Wed, 7 Oct 2020 11:47:12 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201007104711eucas1p1a1b0945d6b12e3260b210dfcb5756ab9~7sAXtthzZ0030400304eucas1p11; Wed, 7 Oct 2020 10:47:11 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201007104711eusmtrp1487b9ffe41a58ec6aaec5d6c86578d4d~7sAXs58Da2859428594eusmtrp1b; Wed, 7 Oct 2020 10:47:11 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-2a-5f7d9cb05c38 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 66.4B.06314.FAC9D7F5; Wed, 7 Oct 2020 11:47:11 +0100 (BST) Received: from [106.210.88.143] (unknown [106.210.88.143]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201007104710eusmtip191849209bf06805c0437d3901896f954~7sAWmUm-z2861128611eusmtip1e; Wed, 7 Oct 2020 10:47:10 +0000 (GMT) Subject: Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM To: Daniel Vetter , Jason Gunthorpe From: Marek Szyprowski Message-ID: Date: Wed, 7 Oct 2020 12:47:10 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA02SaUwTURSF8zrTmQEtPiqGqxKXxrglinXLSzSKxujERKO/XBLBKiOgbLaA 4EpoIIDgAhpqqYJ1QQgIomBFWUQUTZFVCSg7GIuxIosaIUEZxoV/3z333LxzksdRSjMzg/ML DBG0gRp/FeNIF774WbMkz3TKa1lk6XRiys1mSMrlWkSud7ZSJKPqLkXefOtjSFL7BZqkpuhl 5IrhJRojm4zc+2Bmia2tjiavoz6zJL+7UU4aikwMScgrkJO27F9yYqgpkZFa23s5uWT/yRJD ci9DBqNHGY9pfGpkHc0Xf0+n+UfGVpa/8aRXxucPJLH8S8MIzbefrZTx92+e4RP1Xxi+e7iX 4ftK3jL8uQdZiK9Kr2D5wfxZfMHge3rHlL2Oa70Ff78wQeu+br+j7+OWbCbY5hB+se08FYls bDxy4ACvhAR92Tgr8R0EjRkh8chxjIcQxNSflUnDIILE6tx/Fz3vfsilRQaCFx+LaWnoQ/BQ 3ywXXVMxgetpMTKRXfBWiK2IQaKJwo8YKLRYkLhgsBri7fGMyAq8DtqtDWM6x9F4HtRYtovy NHwArLVRrGRxhldXemiRHfBOiEpLGWcKz4aHdhMlsSu860kbjw24g4O8iq+MFHsTFNuj//BU +FT54E8dN7AmJ9DSgR5BZ3UOKw0JCBqiDEhyrYGW6mFGTEfhRZBb5C7JG+BW3Be5KAN2gia7 sxTCCZIKUyhJVkBsjFJyzwdj5d1/zz6tracuIJVxQjXjhDrGCXWM/99NR3QWchVCdQE+gk4d KBxbqtME6EIDfZYeDArIR2M/1zpaOWBB3+oPlCPMIdVkxe6jJ72Uck2YLiKgHAFHqVwUG19b PZUKb03EcUEb5KUN9Rd05WgmR6tcFSvMvfuU2EcTIhwRhGBB+3c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bxBSBCEA4L+v4fRUj8jKMOW V7/ceXr0yuqhqZtRibaVGt1v+/aKutSa+uiWiNxk1vuNZ8ynnX6PgNC7bbDFH2V0LjU2Fay3 TUleF7ffODFu8+nY9PxzzlXNpKGY68/NTI5G+fwCu/9JS1ZIQnZTdT3/zmOjSbbwmCovUkoc VHVPi1Ats15P6F2huWbfoSDEOJ5dietF/i8Y0zPsRwMAAA== X-CMS-MailID: 20201007104711eucas1p1a1b0945d6b12e3260b210dfcb5756ab9 X-Msg-Generator: CA X-RootMTR: 20201003094038eucas1p12aaafe0f52a7747bc2ba95ccb91d1651 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201003094038eucas1p12aaafe0f52a7747bc2ba95ccb91d1651 References: <20201002175303.390363-1-daniel.vetter@ffwll.ch> <20201002175303.390363-2-daniel.vetter@ffwll.ch> <20201002180603.GL9916@ziepe.ca> <20201002233118.GM9916@ziepe.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201007_064715_627135_1F1A02AD X-CRM114-Status: GOOD ( 17.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oded Gabbay , Inki Dae , linux-samsung-soc , Jan Kara , Joonyoung Shim , Pawel Osciak , John Hubbard , Seung-Woo Kim , LKML , DRI Development , Tomasz Figa , Kyungmin Park , Linux MM , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Daniel Vetter , Andrew Morton , Dan Williams , Linux ARM , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Daniel, On 03.10.2020 11:40, Daniel Vetter wrote: >> After he three places above should use pin_user_pages_fast(), then >> this whole broken API should be moved into videobuf2-memops.c and a >> big fat "THIS DOESN'T WORK" stuck on it. >> >> videobuf2 should probably use P2P DMA buf for this instead. > Yup this should be done with dma_buf instead, and v4l has that. Yes, V4L2 has dma_buf support NOW. That days, using so called V4L2 USERPTR method was the only way to achieve zero copy buffer sharing between devices, so this is just a historical baggage. I've been actively involved in implementing that. I've tried to make it secure as much as possible assuming the limitation of that approach. With a few assumptions it works fine. Buffers are refcounted both by the vm_ops->open or by incrementing the refcount of the vm->file. This basically works with any sane driver, which doesn't free the mmaped buffer until the file is released. This is true for V4L2 and FBdev devices. This API is considered as deprecated in V4L2 world, so I think supporting this hack can be removed one day as nowadays userspace should use dma buf. > ... Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel