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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CC53C19F2D for ; Tue, 9 Aug 2022 08:45:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239358AbiHIIp5 (ORCPT ); Tue, 9 Aug 2022 04:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241114AbiHIIpr (ORCPT ); Tue, 9 Aug 2022 04:45:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46EF860D2 for ; Tue, 9 Aug 2022 01:45:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 05568B80B89 for ; Tue, 9 Aug 2022 08:45:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 671D3C433D6; Tue, 9 Aug 2022 08:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660034743; bh=VKIJz/3kseX4NXW5x3L6MqsO9hB4DzRJ2UXkmwU0jLY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k6wrqg9/xFtT/6CURaKkO/Pfga0WpsRzfLdgqihdYhelEtipuK7OAUp+LDHU8GTJV Jn3GdKFC/V31aWSlo9gjwqWlFWJj6njcSRF8XU/8ELupdFlb2wnqyo2Ulg4wlU6h2V 4IrqmLWeXHIQutSMd9Zz7NBI4034owXmtBBvzWmQ= Date: Tue, 9 Aug 2022 10:45:42 +0200 From: Greg Kroah-Hartman To: Christoph Hellwig Cc: Jason Gunthorpe , Oded Gabbay , Dave Airlie , dri-devel , Yuji Ishikawa , Jiho Chu , Arnd Bergmann , "Linux-Kernel@Vger. Kernel. Org" Subject: Re: New subsystem for acceleration devices Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 09, 2022 at 01:04:15AM -0700, Christoph Hellwig wrote: > On Tue, Aug 09, 2022 at 08:23:27AM +0200, Greg Kroah-Hartman wrote: > > Based on the number of drivers that I see submitted weekly that try to > > restrict their open call to just one user by using atomic variables or > > other tricks, I think my interpretation of this stands :) > > I think they really want what Jason described most of the time. They > just don't know about the pitfalls of dup yet. > > > > This is different from the number of FDs pointing at the struct file. > > > Userpsace can open a HW state and point a lot of FDs at it, that is > > > userspace's problem. From a kernel view they all share one struct file > > > and thus one HW state. > > > > Yes, that's fine, if that is what is happening here, I have no > > objection. > > It would be great if we could actually life that into a common > layer (chardev or vfs) given just how common this, and drivers tend > to get it wrong, do it suboptimal so often. No objection from me, I'll gladly take patches to chardev or miscdev to support this. greg k-h