Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp143844imj; Thu, 14 Feb 2019 17:16:23 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib6gkkYtcfbK674nUFO6iV0N01XZ3ZTYL/Gi2QYod2Hw5BLmFX+/lnj0hb+62nfoCViqogy X-Received: by 2002:a63:d30a:: with SMTP id b10mr2788211pgg.279.1550193383397; Thu, 14 Feb 2019 17:16:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550193383; cv=none; d=google.com; s=arc-20160816; b=WsDySaMCwGw7gkPkN6sJ4pWETTZY+DX6b87C9V/2kPFBroJqinaAuovZFJj2nSW4oO UQdORhYFKmHmwB8D0HAK6hMqQObLA2fdENhOxmfW1GdjUmHIGQCN31GJ876GuSauCk4F 4n72OG+/s7yFd6v5mTVvP1uxHtEiZuxXeQCSknjOUTAdnbFUGEsggpMgl6eckPdkCZwo FBt0gHq+g1q0Nud3JT5c+tBsoKr222xRkrmQ5HUxPhqhij5Uaa1y+CaiCg0QzVE9NWjN ldajzSPQ68soIzkZ0pOOe5HsWZlLI3pbFbrs1hlnYgDLjSBNZTlUYXsm4nLwHw3ZfSFJ ZYQQ== 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=xzxb2/6sF1ujNDtDRfGaGMN4dEjiv01x5MSAjKDEmmA=; b=R2/PjWub9iNRIYyIoFYxK9DF504nV2wApfQczJXR0TdQxlBodUVjVEibKVvcBSfRhg hWX79CJAcrBXTNAOQwUuXTsaHX6J4cTbh4ul06PLlFpbzd67vI0BIiaVJZkO7y9azYic NlZ0Rl0uNlpCNwf5EcmTDP3eTGskbSLAjVVqMjEXNiP7F0a6tW4mKZ4aDHeQP0IodXtD eljfv1CWRh7Alk1WU4ZyRm+/I4xlYFlOxFXgNoNG2k99d464vzDjFvWAiDfd33lzXoOY K6lc3WP3DlfRcloAWv8l4OD1N6/nZnYsn6tD6o0AwrRpFMBMQpPj9Tnu2DZMa5joZqUq kevA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GajKadLu; 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 l26si3831016pff.160.2019.02.14.17.16.06; Thu, 14 Feb 2019 17:16:23 -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=GajKadLu; 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 S2437412AbfBNRir (ORCPT + 99 others); Thu, 14 Feb 2019 12:38:47 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50746 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729725AbfBNRio (ORCPT ); Thu, 14 Feb 2019 12:38:44 -0500 Received: by mail-wm1-f67.google.com with SMTP id x7so7172462wmj.0 for ; Thu, 14 Feb 2019 09:38:42 -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=xzxb2/6sF1ujNDtDRfGaGMN4dEjiv01x5MSAjKDEmmA=; b=GajKadLuglcuOcO6N0R7S0CVX1DDXLtMkOwGWFMbI1HsxnpCoeD4WHTHr0yC6DeS3h WrTCLXWB1e1oG7Xwn5QgohwLpjOctFpkSUvbx+hq2yly8CqZfldaHATQaiM17oArxi4Z QbX7XsSy0dv3Ev+DdTnJ1/b7vb2aMvSrun2n1addlynmU6hVlAgwkE8yTHnjADZVTk5l FSt1Cdiuzeaeyn6dP7F2vTgmgVAh5rrWqZ2ZPGEOMlodjHBJv6FxnF2UthrAn6uJwhKC e/KkIzd3MKE024BwAJLcbdoB9pMQ8oPbqQB5lfxMAWv6XsflQjjzdj4IzaQ1iJXilBUk Pheg== 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=xzxb2/6sF1ujNDtDRfGaGMN4dEjiv01x5MSAjKDEmmA=; b=Q+TVm/S8Zy5EiacylwNq182sykg+ftCG5xzGVOYM0ewdvbc93y54t0Vbs0qpSfVAUu 61TQz6MRF6gn9Xev1tgtRbAJS765bqKptSj9pGeskSsBQnrptFlis6sfiDaH0JNv4QM8 FRqTAHmH3Hs1QeNGigdoCB/8OHGP8ihRW2jHSMBDGqwTDyhNmLFNsA5QWhPfdf+CfoY6 GdGpH4dBHIJ3QW8q58h+Etm4TtCVjO/w0cu1HaLZJ/0ANiwkXlD37wbDWVAu5RDu/wD3 5nxB64gaQUWbe+Hytj7SzXfMQ7i48J1E/MGTQW3lpwAwDEqLrOiy+m+oy7G8irhk3hlv FyWw== X-Gm-Message-State: AHQUAubfQewcdBUPlrHlE1t4PMbSQzSG8vGHRcGD03qg9pct8Q/LpFUn 59CjTtWdjxp9zWBZKRx/C8ItQ5KEJ+Uu/nxfa0uWtQ== X-Received: by 2002:a1c:eb10:: with SMTP id j16mr3346247wmh.64.1550165921766; Thu, 14 Feb 2019 09:38:41 -0800 (PST) MIME-Version: 1.0 References: <20190128214408.25442-1-afd@ti.com> In-Reply-To: <20190128214408.25442-1-afd@ti.com> From: John Stultz Date: Thu, 14 Feb 2019 09:38:29 -0800 Message-ID: Subject: Re: [PATCH v2] staging: android: ion: Allocate from heap ID directly without mask To: "Andrew F. Davis" Cc: Laura Abbott , Sumit Semwal , Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Christoph Hellwig , Liam Mark , Brian Starkey , devel@driverdev.osuosl.org, lkml , dri-devel 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 Mon, Jan 28, 2019 at 1:44 PM Andrew F. Davis wrote: > > Previously the heap to allocate from was selected by a mask of allowed > heap types. This may have been done as a primitive form of constraint > solving, the first heap type that matched any set bit of the heap mask > was allocated from, unless that heap was excluded by having its heap > ID bit not set in the separate passed in heap ID mask. > > The heap type does not really represent constraints that should be > matched against to begin with. So the patch [0] removed the the heap type > mask matching but unfortunately left the heap ID mask check (possibly by > mistake or to preserve API). Therefor we now only have a mask of heap > IDs, but heap IDs are unique identifiers and have nothing to do with the > underlying heap, so mask matching is not useful here. This also limits us > to 32 heaps total in a system. > > With the heap query API users can find the right heap based on type or > name themselves then just supply the ID for that heap. Remove heap ID > mask and allow users to specify heap ID directly by its number. Sorry for the very late reply. I just dug this out of my spam box. While this seems like a reasonable cleanup (ABI pain aside), I'm curious as to other then the 32-heap limitation, what other benefits this brings? My hesitancy is that we still have fixed number to heap mapping. Curious how this fits in (or if it would still be necessary) if we finally moved to previously discussed per-heap device-nodes idea, which is interesting to me as it avoids a fixed enumeration of heaps in the kernel (and also allows for per heap permissions). > I know this is an ABI break, but we are in staging so lets get this over > with now rather than limit ourselves later. > > [0] commit 2bb9f5034ec7 ("gpu: ion: Remove heapmask from client") > > Signed-off-by: Andrew F. Davis > --- > > This also means we don't need to store the available heaps in a plist, > we only operation we care about is lookup, so a better data structure > should be chosen at some point, regular list or xarray maybe? > > This is base on -next as to be on top of the other taken Ion patches. > > Changes from v1: > - Fix spelling in commit message > - Cleanup logic per Brian's suggestion > 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. 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. thanks -john