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 13AA3C433EF for ; Mon, 14 Feb 2022 21:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230351AbiBNVP6 (ORCPT ); Mon, 14 Feb 2022 16:15:58 -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-Google-Smtp-Source: ABdhPJxYpCGSJ97h8+PYs4ql8r4Wi52kEXKqBk5pvfZj6f9b/g73lOi4fZfqGVy147NfKJkJXNKE6/edp4TkHfyblNY= 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" 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