Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp234528imj; Fri, 15 Feb 2019 22:36:05 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaoz6DDwON7OpXrWHj7+gGbXagswjCarUr18Jgr1bY93/A5vh3fFBvJ5lV9Jfx/SIKZO5V2 X-Received: by 2002:a65:534b:: with SMTP id w11mr8975581pgr.125.1550298965449; Fri, 15 Feb 2019 22:36:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550298965; cv=none; d=google.com; s=arc-20160816; b=cVaxkirwVV1ArQ35Jx+U+gU/dWZ2TOrh2ozGTVVzEN4VdGH9OW/LDquTJRKHPjWTF2 23Njmk7vM+wv4WKeeHzbQXKRskvs3FoeSlz6uC7tBro8ebN8/C5jRsdGaUgz7klHSGsT PcWvoPFLildZrLlWsu9+v9aYrXdoiVNHwvjabReHrcErYQwfKCTlGCdN0qpLfHDpLT18 rnnkvbEp+C17fcxsckc3PLs9a7ATMhoC5T/u9nBZCFBgenvB73BfLY16CcmAkLrGJvbo 2MuhJGBw6yUAQnPdFMH79Z5DkOPvWNDly9JfvOQtMV30s+NQm71CeSWoPoY5lqTxOgit q2FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BPo4L00nJNWboHbjRe2yO506WpmxFVponUnGvafgyYk=; b=uoVteEDgf9bYL2lAnaA6VVg/uan2hhn4Ql2RyNaTmf/ps6+yVkY58ygHM/r0b8y8f7 UmS+k8+A/fKn9SossxJNnuv5IXTgvXuLFb/D46DLGZeYmg2Of0/ajVS82U11HAY+yrRP NnlIMfhx+L9SHVYgAc6rIMKirYr4O/fSZiZnzXSApHDFtJdjaA/lmF+mQx2nEsJVLtr1 5dqr5t27f2WOBoFrjyZfgmzEh+EoxLST7Sg9XSzUSOGLc80gunbTvsZEwKVG7kr+VUIi NmyCinwmFBLBw2jdC9RUEw7CR4aOL3EzJW9DXcpWhBOgaTZKHcWnVUsx4QfPwkp/wwRe HGSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z67hndWy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u77si8385524pfj.139.2019.02.15.22.35.49; Fri, 15 Feb 2019 22:36:05 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=z67hndWy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730552AbfBOTCO (ORCPT + 99 others); Fri, 15 Feb 2019 14:02:14 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39691 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbfBOTCN (ORCPT ); Fri, 15 Feb 2019 14:02:13 -0500 Received: by mail-wr1-f67.google.com with SMTP id l5so10347547wrw.6 for ; Fri, 15 Feb 2019 11:02:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BPo4L00nJNWboHbjRe2yO506WpmxFVponUnGvafgyYk=; b=z67hndWyOGYJ12sSSJSnu9dDJFzvdFG+T0cXGR7aqKpkGy6GcItiRQhC3geOxjv/BV cjkv3ZTnKJ/RF0Y5n9xmeUsO2VUXWJKDafp8I+Ul0PbP38J/545hgq0COFrkdTtjL9tX /NTP4n1wJfe84OrOZBKK6Jl1x9XFh1Grz0/i+L2kGOd0g6S4VfVm6XMeC8upDkYNFMF4 SNWLp3/nDVjLwMcb3Z82Zh1sDyFJuEkC5AKZ+DAoQCbz1iZZPBEoyMygMSFHxo0HbVRD yXhIag0ddgMyE4/4iKbkQeGZkdeisljcnXfoDM6zolwXFdkR4aYsDqGIQHVUMifT0jSV LGmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BPo4L00nJNWboHbjRe2yO506WpmxFVponUnGvafgyYk=; b=bQrU21vhOb8E+XVT5Bie1uxcS4mtjOou4S/lYyOFFRD6eUb//CmVPe5Y2B8TpmJt6P 1RT103DvBQUeZ7LRZUpHT8uyTKQfeKtXHDUJFkF4hy7sx1h1yu73Fn7qpCkkF0sJCxqz MqQ6I+x958p+bgOO4YFj2EdGx+dcc9IcBtJ4RD0lSrDmiy8tqhtCI0v5URMTrCSk1SP6 y3ZycoiyJXwXsWXCpjvtsPXnOKteq3nuRjIDk/6mZZREYpAffPt8/JXCpcw6sMGQXhJM c4JF1iSuga+wteYiUzOUnX2hSsZ47x0yGBJ6JZXJjjiNJpyWduNnVmusU8b5qhrawcSx sCUg== X-Gm-Message-State: AHQUAua0rEkwWlCIQZa3ok9JShnAT82fT0n5y2HdZrprqaUN2fmcUmDc fOYSolwKf3kSabvweOP+rvbAxmwqlxnlOfNNs/70EA== X-Received: by 2002:adf:c543:: with SMTP id s3mr4747020wrf.192.1550257331718; Fri, 15 Feb 2019 11:02:11 -0800 (PST) MIME-Version: 1.0 References: <20190128214408.25442-1-afd@ti.com> <20190215105057.jujgm4k77rhkvmo7@DESKTOP-E1NTVVP.localdomain> In-Reply-To: <20190215105057.jujgm4k77rhkvmo7@DESKTOP-E1NTVVP.localdomain> From: John Stultz Date: Fri, 15 Feb 2019 11:01:59 -0800 Message-ID: Subject: Re: [PATCH v2] staging: android: ion: Allocate from heap ID directly without mask To: Brian Starkey Cc: "Andrew F. Davis" , Laura Abbott , Sumit Semwal , Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Christoph Hellwig , Liam Mark , "devel@driverdev.osuosl.org" , lkml , dri-devel , nd Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 15, 2019 at 2:51 AM Brian Starkey wrote: > > Hi John, > > On Thu, Feb 14, 2019 at 09:38:29AM -0800, John Stultz wrote: > > > [snip] > > > Some thoughts, as this ABI break has the potential to be pretty painful. > > > > 1) Unfortunately, this ABI is exposed *through* libion via > > ion_alloc/ion_alloc_fd out to gralloc implementations. Which means it > > will have a wider impact to vendor userland code. > > I figured libion could fairly easily loop through all the set bits in > heap_mask and call the ioctl for each until it succeeds. That > preserves the old behaviour from the libion clients' perspective. Potentially, though that implicitly still caps the heaps to 32. So I'm not sure what the net benefit would be. > > 2) For patches that cause ABI breaks, it might be good to make it > > clear in the commit what the userland impact looks like in userspace, > > possibly with an example, so the poor folks who bisect down the change > > as breaking their system in a year or so have a clear example as to > > what they need to change in their code. > > > > 3) Also, its not clear how a given userland should distinguish between > > the different ABIs. We already have logic in libion to distinguish > > between pre-4.12 legacy and post-4.12 implementations (using implicit > > ion_free() behavior). I don't see any such check we can make with this > > code. Adding another ABI version may require we provide an actual > > interface version ioctl. > > > > A slightly fragile/ugly approach might be to attempt a small > allocation with a heap_mask of 0xffffffff. On an "old" implementation, > you'd expect that to succeed, whereas it would/could be made to fail > in the "new" one. Yea I think having a proper ION_IOC_VERSION is going to be necessary. I'm hoping to send out an ugly first stab at the kernel side for switching to per-heap devices (with a config for keeping /dev/ion for legacy compat), which I hope will address the core issue this patch does (moving away from heap masks to specifically requested heaps). thanks -john