Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6019815pxb; Mon, 14 Feb 2022 13:17:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjjL+lt7f4RPDeBE9uShnD4+/drQNMM4zFgu2KFp5Kd3lYzFHq+8pOWtpixB1fXHvDJTO4 X-Received: by 2002:a17:907:d04:: with SMTP id gn4mr571010ejc.86.1644873431519; Mon, 14 Feb 2022 13:17:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644873431; cv=none; d=google.com; s=arc-20160816; b=MACSqWvaC0YI/LCf7vKTcYfOCrfxDFuczxTcdV0ROYF2G4rn8gkjXHZSmvwxvl1IOB b5ZL+z2ochYUrg8q+ubQyNYmiItzhtRlVnfsrb9/CgV7QUcEC1+dZjixiiWBUs7AszSy XEVreEDzs3vLSP6HDPuQRxgUpjJ5NW9EdoHLrpxgork6WIsqiRgQuZzfG+p5Qy/CBBCm IRjwUC+geHvyHHsz0chZYZks8r2gDkGL3eKtE6+eMIR7BPbAkZmRgSS9es8dBYqYfu7t me06OsM8e7nlX8UlT5opy0N8ot4/TWYBjOMfkz62SckFTSLLB2TzFAgTOYWEIXaUklZH rl2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=koOwKzeH7/Gb78FEuOvCok9kPJwObv2S7DVJdDdOgNA=; b=LvF58+2lzVdPpfxTw84r21tkjHn0jDbLPZQdiwl5BA/mHDAHD4JLX8OfNfRIAsmUho cLUnSGUr3WoHGQJFilYr6li0edHQH5Rqz8k+JZ9+txh72ZsbetHbYjB2BR1EdwRA2+LP fz1Z33yJkI30+pXEj5zVZ5izhmlHvrBDuE1eb08f49IzJHubrbEB08AFwtDbJ6k3FnfR NcNc3yjmBIC7v1ALiJc1sro8T8prVu/vviCPtcf+4/Hibgle6CHwv3pPQS+TCu3PnHqe ppQoGiv3amcQsiUEOpb43ovRGgx6KfrozKAaBhTCgWT+7fIj4tdUNfBOl3aRtl5L3kd8 +PDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Pb5dbCHS; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt19si15878732ejc.0.2022.02.14.13.16.48; Mon, 14 Feb 2022 13:17:11 -0800 (PST) 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=@google.com header.s=20210112 header.b=Pb5dbCHS; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbiBNVP5 (ORCPT + 99 others); Mon, 14 Feb 2022 16:15:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230349AbiBNVPg (ORCPT ); Mon, 14 Feb 2022 16:15:36 -0500 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0916811ADFE for ; Mon, 14 Feb 2022 13:15:28 -0800 (PST) Received: by mail-yb1-xb35.google.com with SMTP id j12so27852127ybh.8 for ; Mon, 14 Feb 2022 13:15:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=koOwKzeH7/Gb78FEuOvCok9kPJwObv2S7DVJdDdOgNA=; b=Pb5dbCHSbOY7B3ORjcQJ4tOqYQjm9jFUDuW4A8Uw3ddfl/KioQspJ7vPApWeypuuyQ AbdlnFPPC52dg3yNb0beEJdpRbmFdEDeTuxJF39E+eg6ecEa/6ji0TduWQr0JYt33wqk F00WTtwEQGRE8fkzuYE19P4BzBBNjs+GOqaHl31cAznCEZMsRqDikQkTwDJclPuKCvxV kmxmrEI4FfjSSPAK5el+JyX7Hj1ZqafjYSIjdKPhGDhpAMZDyhpvvBv0wjDJRI2gXsaV ekGOhI3vLetimUVdXqmZTzeAxc7HUExrhEQoRc2Vs4Ips6kQQ/pBnxkN2I0ZLJPdeW+t EH2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=koOwKzeH7/Gb78FEuOvCok9kPJwObv2S7DVJdDdOgNA=; b=Axf7HjDv5cfjksAAypCKQcOy9oa79Uosc7QYq3HUy/UYL1XU8dm5UuN3Lh52TEDW/Q fSXtwXsFJAnMPRRdbAMtC4WJW14FmN33n1AqoTyRYES52W/m0hEQSz3b7YUKWfCwD6ND +GPURdLHrH/hU0tOXn5ti1PKKeLfThCDjjOT8ifIck9llLpfQy5sI6gbej47yQ4KZyCW TfpJuLvtj9ZabZM/FZ+j28oFSta4Se7uSi5GGSXc0jXHu0MT4bcWbLVuMS9MNxs3YrdT zRONnrIRV9xmH29wOoxgAuoXmiBpfIVRgoNS48qquzyOffquqqEVY+9hoIlcXeFyn5Kg ZN1g== X-Gm-Message-State: AOAM533wsFGhmQ8o0HlV7DWZOl5nMBaOUIsQjwgZu6dTscLTztvsePsf Msk/RyJ+i4o1sBY3boA3uX4aVtu3k6Gogcwvn9BCLA== X-Received: by 2002:a25:ad18:: with SMTP id y24mr1012325ybi.420.1644873327127; Mon, 14 Feb 2022 13:15:27 -0800 (PST) MIME-Version: 1.0 References: <20220211161831.3493782-1-tjmercier@google.com> <20220211161831.3493782-7-tjmercier@google.com> In-Reply-To: From: Hridya Valsaraju Date: Mon, 14 Feb 2022 13:14:51 -0800 Message-ID: Subject: Re: [RFC v2 6/6] android: binder: Add a buffer flag to relinquish ownership of fds To: John Stultz Cc: Todd Kjos , Suren Baghdasaryan , Greg Kroah-Hartman , "T.J. Mercier" , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jonathan Corbet , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Benjamin Gaignard , Liam Mark , Laura Abbott , Brian Starkey , Tejun Heo , Zefan Li , Johannes Weiner , Kalesh Singh , Kenny.Ho@amd.com, DRI mailing list , "open list:DOCUMENTATION" , LKML , linux-media , "moderated list:DMA BUFFER SHARING FRAMEWORK" , cgroups mailinglist Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Mon, Feb 14, 2022 at 12:37 PM John Stultz wrote: > > On Mon, Feb 14, 2022 at 12:19 PM Todd Kjos wrote: > > On Mon, Feb 14, 2022 at 11:29 AM Suren Baghdasaryan wrote: > > > On Mon, Feb 14, 2022 at 10:33 AM Todd Kjos wrote: > > > > > > > > Since we are creating a new gpu cgroup abstraction, couldn't this > > > > "transfer" be done in userspace by the target instead of in the kernel > > > > driver? Then this patch would reduce to just a flag on the buffer > > > > object. > > > > > > Are you suggesting to have a userspace accessible cgroup interface for > > > transferring buffer charges and the target process to use that > > > interface for requesting the buffer to be charged to its cgroup? > > > > Well, I'm asking why we need to do these cgroup-ish actions in the > > kernel when it seems more natural to do it in userspace. This was our plan originally i.e. to create a cgroup interface that userspace could use for explicit charge transfer. However, in our initial discussions with all interested parties and cgroup maintainers we reached a conclusion that an explicit charge transfer UAPI for the cgroup controller did not fit in with the current cgroup charge/uncharge mechanisms. Like John mentioned, the charge transfer during binder IPC was suggested by Daniel during LPC. Regards, Hridya > > > > In case its useful, some additional context from some of the Linux > Plumber's discussions last fall: > > Daniel Stone outlines some concerns with the cgroup userland handling > for accounting: > https://youtu.be/3OqllZONTiQ?t=3430 > > And the binder ownership transfer bit was suggested here by Daniel Vetter: > https://youtu.be/3OqllZONTiQ?t=3730 > > thanks > -john