Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp806162rwd; Thu, 8 Jun 2023 08:02:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7FthXdLpDG8i6ExBRmSZZ6F5yTrAs4MUAo2RdBtxZZ5APQGScPe5AsW32xrYBpvyJMywpg X-Received: by 2002:aa7:8881:0:b0:655:7ebd:bf31 with SMTP id z1-20020aa78881000000b006557ebdbf31mr6243697pfe.8.1686236525240; Thu, 08 Jun 2023 08:02:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686236525; cv=none; d=google.com; s=arc-20160816; b=fxfF5xa7Co31ynFY/0gJ0ModkYzG93uWpVi7UqHGIuINOzUOKnBWTea+TK5i+JBv8Q JmjB3PyynTh9/et9oFLnO2NsgshzZ4NHcxyaGZaRCVOLBsGtr9Id9IHFpRYiNfAG5nAQ tnmRjVGACzMqQjtwHELJPkYPXB+K25uF+Ypo/mQ/X3tNCo+yHSl9ougiRdbhNaK7kBMS rZ9jO3XEwXcWiWRV/JLVeko9m+J3AETH0O2OjRJO1Mc0Bslqqy9+XQOg+f1GRjr1i5tp iNKxgCTLWtAOsc02rVv9vIliH7sF6VyyGKkEe4lQz09X1i6ma2IDh+HPTf/e5ywYhKHG hFyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=WKZex9fUecwhI+fn0LL3onFa6Kk5csSiaSsDMwzaaHc=; b=axRK2UNfCkZV7RDLTgBIsjpcVzZePMYC8bvfqN7Tnh+C5e3eU1b9BENHt71pJi20aR 8bv+TibU5PE20YnSmhNIFvBgght3Ro/I9b1F7IYk+GDnbnY+jVAfa2CjaLOLp3Z/Gouv hvwiWg1OuW6/z7XS76ju2ivEu+hyvR65BWz1Xqb96GpBZzUNVhV7Y6FphqITHkULF29M L2j2m5118dUPvGvb4bd/dbDmzkKfysZA5sdOSZcVp2ppsyxTUH/oK1NXUyyPK0v7PCHq OlBcFovCDOA1jObP5zqIpC4iHKqXmlUrlRavQV6Zg5b0pXnjqCRxwwryQtN6u+vuzSbk 1+xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FkS2ZiNK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s65-20020a637744000000b0053ef547263esi1108176pgc.169.2023.06.08.08.01.48; Thu, 08 Jun 2023 08:02:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FkS2ZiNK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236302AbjFHO1q (ORCPT + 99 others); Thu, 8 Jun 2023 10:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234566AbjFHO1o (ORCPT ); Thu, 8 Jun 2023 10:27:44 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC2F52D53; Thu, 8 Jun 2023 07:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686234439; x=1717770439; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=AOHF8Rb86ntesAI/yE6eOPe27CYMX9ghGd4LAdbYQLs=; b=FkS2ZiNKdRzafecRs5vfoQum0utUn6s8Qgs4pzsCv5c7XJNAcBQVdKjH KXWjjUihSYegMQrUzV4kdoLWqVZFOyXOeEI6afZEAT/rsrLNW40IRoIgQ G4gC2FBMA9dkx+nY7qSLJIgBD77Vt0kadshfZDsCeL8wES+1uwAyj13ap Zrom0wwnbG2SEhqO7j1cyyyx/P8yKBBHNOd/j5rUP3tewm8cW8e2uj9Dx oYPRUwckeGD9fZoMzP0ovqWkPOWBmvYvLBQ+VHqJl1+MzAjwmV8+jNkMI TSviLiIWm3PTNmL1EALH0wmmSqpIE37m9VcyTlDIfAD81M60/f45Sxi73 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="356177428" X-IronPort-AV: E=Sophos;i="6.00,227,1681196400"; d="scan'208";a="356177428" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 07:26:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="956736343" X-IronPort-AV: E=Sophos;i="6.00,227,1681196400"; d="scan'208";a="956736343" Received: from rirwin-mobl3.ger.corp.intel.com (HELO [10.213.239.227]) ([10.213.239.227]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 07:26:28 -0700 Message-ID: <77587046-aede-f625-6a35-55bf9c5f1179@linux.intel.com> Date: Thu, 8 Jun 2023 15:26:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [RFC 02/10] drm: Update file owner during use Content-Language: en-US To: Emil Velikov Cc: Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rob Clark , Brian Welty , Kenny.Ho@amd.com, Tvrtko Ursulin , Daniel Vetter , Johannes Weiner , linux-kernel@vger.kernel.org, =?UTF-8?Q?St=c3=a9phane_Marchesin?= , =?UTF-8?Q?Christian_K=c3=b6nig?= , Zefan Li , Dave Airlie , Tejun Heo , cgroups@vger.kernel.org, "T . J . Mercier" References: <20230314141904.1210824-1-tvrtko.ursulin@linux.intel.com> <20230314141904.1210824-3-tvrtko.ursulin@linux.intel.com> From: Tvrtko Ursulin Organization: Intel Corporation UK Plc In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HK_RANDOM_ENVFROM,HK_RANDOM_FROM, NICE_REPLY_A,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/04/2023 13:13, Emil Velikov wrote: > Greetings everyone, > > Above all - hell yeah. Thank you Tvrtko, this has been annoying the > hell out of me for ages. Yay! > On Tue, 14 Mar 2023 at 14:19, Tvrtko Ursulin > wrote: >> >> From: Tvrtko Ursulin >> >> With the typical model where the display server opends the file descriptor >> and then hands it over to the client we were showing stale data in >> debugfs. > > s/opends/opens/ Thanks! > But as a whole the sentence is fairly misleading. Story time: > > The traditional model, the server was the orchestrator managing the > primary device node. From the fd, to the master status and > authentication. But looking at the fd alone, this has varied across > the years. > > IIRC in the DRI1 days, Xorg (libdrm really) would have a list of open > fd(s) and reuse those whenever needed, DRI2 the client was responsible > for open() themselves and with DRI3 the fd was passed to the client. > > Around the inception of DRI3 and systemd-logind, the latter became > another possible orchestrator. Whereby Xorg and Wayland compositors > could ask it for the fd. For various reasons (hysterical and genuine > ones) Xorg has a fallback path going the open(), whereas Wayland > compositors are moving to solely relying on logind... some never had > fallback even. > > Over the past few years, more projects have emerged which provide > functionality similar (be that on API level, Dbus, or otherwise) to > systemd-logind. > > > Apart from that, the commit is spot on. I like the use of rcu and the > was_master handling is correct. With some message polish this commit > is: > Reviewed-by: Emil Velikov Are you okay if I just paste your very fine explanation verbatim, with credits? > I also had a brief look at 01/10, although I cannot find many > references for the pid <> tguid mappings. Be that on the kernel side > or userspace - do you have any links that I can educate myself? TGID or thread group leader. For single threaded userspace TGID equals to PID, while for multi-threaded first thread TGID equals PID/TID, while additional threads PID/TID does not equal TGID. Clear, as mud? :) My POSIX book is misplaced somewhere having not consulted it years... :) Regards, Tvrtko