From owner-freebsd-current@freebsd.org Sun Dec 10 08:49:35 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1DC9E86238 for ; Sun, 10 Dec 2017 08:49:35 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4849F68B56 for ; Sun, 10 Dec 2017 08:49:35 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id n138so9370244wmg.2 for ; Sun, 10 Dec 2017 00:49:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=11ut9dutHcowSDcurtNJMGlfuBBeoy7TKtQMawQQlXo=; b=CYxCT1iSmHwSKQ/CgHeIiM8MGcaUIZZxwfMfMeTfm4cjHwL5KeHThK1+S0TmjbtiB+ lDYVutPqlMZxDrjhGYGmTSsB4qKE6Jm/QsR0IM87gMjyarbZRiIl6TaGaigt3IBSoSLO oLOLhASHrLq/u529RDR1cmAz4INEU6ean6Wrh3j5GKlaEOO6nZ+gYq+sSJSA4fxBFpyp 4kva+RDK9RgvrvyGy0Nq0gpK6v6qgoCmgo0fj7sQ/wqb7Zu02Tj435aRPtUz8EIYEB6w xb3O6wmAP2teGteo3kGt7LxaHVnzXZQNNtEr1RpaJj1QlSMaVVGyLf2jnwhQBeAiLX/J lZRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=11ut9dutHcowSDcurtNJMGlfuBBeoy7TKtQMawQQlXo=; b=FEdTjPskmP81WbhX+qYa18+6Hr640k1zhoZ9GZmge4LShhh1CqM5kjjyCvfygAIgdz 8ckg8eQ7RkpkMCnbrDNBVEZDzLmBGzkKpNCeUU1KGOuQPxOxO6ZBjhSKn+pVmDoFvQDP 0w4s46me9p4BPlWvPsRUQX8WPZh8pb8Xq0rMCqQ+ziz6iV23BiIfrM3aRPw8dmLtYFFm I57haShLstdYqOU0Z7vC04YHGoA+Kdr+UoeaZ3A5W9pXG8wufEU7IT6WKOqVfwYL+6Wr 2Qnwze4ZztoVwY65SD2t4v4UtrpNdEnvCUJm9kbvbran0adqlP9I50MKUJ59wrZZhUj/ M3hA== X-Gm-Message-State: AKGB3mJCZ0h82niLzT+TsgodY+beuo9Wsd7/mv7X+PFtgv9DKByarL+/ 0QTQMda8U/vCfcz4x2hfFaG1uaLcWs+7ixj3Bc4YMQ== X-Google-Smtp-Source: AGs4zMYwWdfdkOxnICOtoPU1crgNSK8IQRUC0FaZsufkFwsI7TjwGHRaujgTwTWgteFxibcVCyTtJcj6FfSgKBf5xBw= X-Received: by 10.28.157.7 with SMTP id g7mr7008841wme.99.1512895773536; Sun, 10 Dec 2017 00:49:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.197.68 with HTTP; Sun, 10 Dec 2017 00:48:53 -0800 (PST) From: Johannes Lundberg Date: Sun, 10 Dec 2017 09:48:53 +0100 Message-ID: Subject: Advice regarding sync_file implementation To: freebsd-current Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Dec 2017 08:49:35 -0000 Hi I'm working on getting drm-next graphics parts up to Linux 4.11. After current drm-next version drm start using sync_file to synchronize access to shared dma buffers between userland and kernel. sync_file is using anon_inode, both which currently are missing from linuxkpi. http://elixir.free-electrons.com/linux/v4.11/source/drivers/dma-buf/sync_file.c#L31 https://elixir.free-electrons.com/linux/v4.11/source/fs/anon_inodes.c#L70 This will be used by both kernel (drm and graphics drivers) and userland (libdrm). What would be the best solution to implement this on FreeBSD? Do we have anything equivalent that we can use or is it best to make a similar implementation as done in Linux? We want to reduce the need of patching upstream and Linux code as much as possible and implement things in linuxkpi to make further updates more smooth. Cheers! /Johannes