Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4956718imm; Tue, 31 Jul 2018 03:08:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpczLhg2DrjC/jeWDQ3HqMaP5d9OXhf4NQ2BA1TIOIII679skPLHPwHjQFQZv/IusrDQFn8J X-Received: by 2002:a17:902:1ab:: with SMTP id b40-v6mr19387739plb.55.1533031694404; Tue, 31 Jul 2018 03:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533031694; cv=none; d=google.com; s=arc-20160816; b=oXbP9ek+X6SjqhDLhAoT8EmgFRSyAbtlgodfRv/NoZgUzgTnjgsf47A+0HGqIkF3Uw vNlwkfWeO8vqIS50EU0yRWoV+Zec4k4ic4YVAkGc3SkqmNNkdF0EPmoGChVbwal2r+eZ e47Nk5FznHWMqACsM+L8ZEPhrNsgFvhUq7NtGv/WZAouM5Lwid+Yix/tz/ECJ3qCGvxv oN9CrGcaEHYphhH9taX7UBcCbNJR3ZjRyK7/FGJlqtD+esdd5ssx4f1CNbeyP83r2dU0 IyN7FMqUlGyCXgRGQ55GCMWBP04S/0h3nLyuX5Pkq0gKm0LVbEGmSm4MHIJoo/6ZjbTK Bszw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=TKZkZ4tDFdAZarAdDrvBNOkTew3eCsd6Q2XaZ4P19ks=; b=CWU5gRkGY6rS1eBlLx3bogagsl3LgbQgGcnhj7v7OQGcuWKP84DccBixDiuOktXRiz NU/67af3dAKbj+UT7viqQxA462FhrjLvOyooSVvPxIs4wgPRt5dl3/sNi4GuW8yzRkPR eOY/XT9nMoOopfMNdNgWwbS9SJYKzEQz4MupvcoAuwWHvKEpdsiM4UtYUiVT/fBhDm1E I3iUY7J3h6KStZmyrnDwZZcEQZ/CohsToLeAPMw0J+8ZIMfoMzUwe8nVjB/ENJorqouO NPyeFQwVg5yrty82eAcozvhEo/rG/SMWpkd1s7ls6/gttHnEOGRtqZsvKTGdToZd6zma vKRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w17-v6si2510639plp.246.2018.07.31.03.07.59; Tue, 31 Jul 2018 03:08:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731984AbeGaLqk (ORCPT + 99 others); Tue, 31 Jul 2018 07:46:40 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:32754 "EHLO mx2.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727524AbeGaLqj (ORCPT ); Tue, 31 Jul 2018 07:46:39 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 0D08641113; Tue, 31 Jul 2018 12:07:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id c-3RN5yAc0lw; Tue, 31 Jul 2018 12:07:02 +0200 (CEST) Date: Tue, 31 Jul 2018 12:07:01 +0200 From: Christian Brauner To: Martijn Coenen Cc: Matthew Wilcox , Christoph Hellwig , Al Viro , linux-fsdevel@vger.kernel.org, LKML , Arve =?utf-8?B?SGrDuG5uZXbDpWc=?= , Todd Kjos , rlove@google.com, ben@decadent.org.uk Subject: Re: [PATCH 1/4] file: export __alloc_fd() Message-ID: <20180731100701.GA18871@mailbox.org> References: <20180730143710.14413-1-christian@brauner.io> <20180730143710.14413-2-christian@brauner.io> <20180730163155.GA27761@infradead.org> <20180730203633.GC12962@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 31, 2018 at 10:44:33AM +0200, Martijn Coenen wrote: > On Mon, Jul 30, 2018 at 10:36 PM, Matthew Wilcox wrote: > > I'm not entirely sure I understand the binder code (... does anyone?) > > but from what I can see, it intends to open a file descriptor in the > > process which is the target of the message being sent. > > You're right. > > > That strikes > > me as wrong-headed; it should be allocating a struct file and passing > > that file to the other process. When that process receives the message, > > *it* allocates a file descriptor for itself.ho > > We're looking into cleaning this up (historically it was done this way > because VIVT caches made this not very efficient), and this is indeed > a very good candidate for fixing it. Ah, this wasn't brought up in the original thread when discussing to turn this into a module. If using internal functions like this is going away it makes sense to wait for this work to happen first. Is there a time-frame for this? Thanks! Christian > > > > > But I think the binder user-space API relies on this. The userspace API > > seems to rely on passing fd numbers around ... but I'm having trouble > > figuring most of this user API out. Perhaps Martijn can help here. > > The UAPI does expect a file descriptor, but we may be able to do the > mapping from fd to struct file (and vice-versa) in the kernel driver, > so userspace wouldn't notice. > > Thanks, > Martijn