Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp671477pxa; Fri, 14 Aug 2020 14:49:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL38oEYUM8uE30fDKw2qx6eVcU1A+3VvRFzSGxIrvjAYlpzSDVtYOUJ7dswFOwtaU+CzVN X-Received: by 2002:a17:906:95d4:: with SMTP id n20mr4593312ejy.485.1597441776213; Fri, 14 Aug 2020 14:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597441776; cv=none; d=google.com; s=arc-20160816; b=YxJWNL7iERbs2NSiThniDd4vBvOPUYB6MkXy0duNja+BmyQT5dwqPrFaLCc7uqSsG4 jLgCGykjrK8l6SuzZpkD8PpjhhX5SNhprkpGYx1erRb0eKN8nNE9rBbJhOovb4tV5djC u57gcKlHjUDna5+PbYMoE1Z/vy/IugKh/9CWuPkHoHsNKtGW9VBCNMeNIJkvhMl3ET6W Iah4xVzTKbdXWBCgpSLtFMUqoJULRWfj083dgOd2YGbkQFHmV3kcMKbGOEvRloTVVdu+ /GkqTZwkTMslBiP1QCYxpagFWFlXFQ7rE4TdgitUHNq0wL+4+gR80bO3XtNu0aJ/XzIK sR8w== 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=K1VjQolyfnnNVHHYuPIt8KNCctqJMTa9sGgTeUR70Ro=; b=Lc+eOLvJQA4sZrHryBfqr0Or8GWlzlU2PZ7gQTN8JPgZdFek7+O1BwIit4UvTbLH8M Lt8bSBC53tDL1MuBo3xhLK2RvKCuBDHyUk571Y6Ozq/o8bMdoUYK1e/ajKsIDb9cqRL7 GauZ+8R+TKVgp9T0K4I4zL9/P9m2XkuNwoa2ugFvf4rBlj0dHLsgAhdvjtYnJPtOLOHg SP9f8NgqJcsq3PQFeKdHDvsj57eEvsBG1rjQKknCGTunqa4Hr/av2y2KRWqvv7Rt7zJd YzOkzBe5WIztkstDxLhqUKj/hXYUKWsELxJPp0JiGlPAVygFwgvxJqBuJt7uza7fRi2r GKBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DZ5myydx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id x8si7740718edl.249.2020.08.14.14.49.13; Fri, 14 Aug 2020 14:49:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DZ5myydx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726265AbgHNUPH (ORCPT + 99 others); Fri, 14 Aug 2020 16:15:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbgHNUPH (ORCPT ); Fri, 14 Aug 2020 16:15:07 -0400 Received: from mail-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07400C061385 for ; Fri, 14 Aug 2020 13:15:06 -0700 (PDT) Received: by mail-oi1-x244.google.com with SMTP id a24so9189575oia.6 for ; Fri, 14 Aug 2020 13:15:06 -0700 (PDT) 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=K1VjQolyfnnNVHHYuPIt8KNCctqJMTa9sGgTeUR70Ro=; b=DZ5myydxcvkGbm+IsJi3gh56/Bx0I9UaNCaJ/ja2SMZKO1klTplQvWE6mNbZhrGgv/ UF99xSMV81q7h9YWU718ve0oCTci6YlEkeVIgBIl9rUO1DHkOKOkkBQFqnrtqVoFnicG 4khUMVOXYg0QltxHVsuE+SOlJtDagL5LrMwEFeOG59n3JY92s+7oxtRSGfxB0VBeSIO+ JwC4EnIwyEOh6Towkp8VMDKmTtvInhnauublH668LYzQWCOBwh0YFwelJM688XPUQFCX B5wqPD15o5+/D+tCHj5tTucdfC1n3qt2hRdNi79xBh/2bZTC3cBgEmROvyrkCxKk+NV9 wxiQ== 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=K1VjQolyfnnNVHHYuPIt8KNCctqJMTa9sGgTeUR70Ro=; b=mC0nbk7WBK+AYVPSjnASXaAWXm87T6Nj0GC/kgTszpO+CCSTglvQqfrkFXg6kMJELS wEVF1u4CuVZAbS3QSOY0Kh+0ANDOq9nXN47g9L+GtW4of5ljOzrsYRaOlLsEybEdaPni Y7TdSPDZDxVoIzLSPy3Yt0L1O4jx+1sH8d7aMqzp6T49+u4WY62JlHkGX7X3tJdhrE5c pIdjEjtt8kbAsuyLNeFc+TUzmWpRgggk4AVL8EC8GY8hjqkvWyyfit9AVTYd6SSGWc49 qrIS+yS7tHxQMHZEIYmnessVjkYwHtWoZznCQ713BOi6nbghPhKE61zcimJjICTdiELA egsA== X-Gm-Message-State: AOAM530qzstDtFA0linYnZtVZskVEhNQgp1lxsOmhmSOf22pFrzMkqU+ zVEoEG6vnznf/GAwBqTkY/6/eF6wiNcluoS0VYNFvQ== X-Received: by 2002:aca:dc85:: with SMTP id t127mr2517949oig.169.1597436106306; Fri, 14 Aug 2020 13:15:06 -0700 (PDT) MIME-Version: 1.0 References: <20200814062458.53049-1-john.stultz@linaro.org> <20200814062458.53049-2-john.stultz@linaro.org> In-Reply-To: From: John Stultz Date: Fri, 14 Aug 2020 13:14:55 -0700 Message-ID: Subject: Re: [RFC][PATCH v2 2/2] dma-heap: Add a system-uncached heap To: Ezequiel Garcia Cc: lkml , Sumit Semwal , "Andrew F . Davis" , Benjamin Gaignard , Liam Mark , Laura Abbott , Brian Starkey , Hridya Valsaraju , Robin Murphy , linux-media , 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 Fri, Aug 14, 2020 at 9:15 AM Ezequiel Garcia wrote: > Thanks for the patch. > > On Fri, 14 Aug 2020 at 03:25, John Stultz wrote: > > > > This adds a heap that allocates non-contiguous buffers that are > > marked as writecombined, so they are not cached by the CPU. > > > > What's the rationale for exposing the memory > attribute as a new heap, instead of just introducing flags? > > I guess this calls for some guidelines on what situations > call for a separate heap, and when it's just a modifier flag. YES! :) A big part of this patch is to start a discussion and feel out what properties of heaps are generic enough to be flags, and what aspects are unique enough to deserve having their own heap implementation. ION used the ION_FLAG_CACHED bit for this and considered it a generic property (though by default all buffers were uncached). This seemed to cause enough friction in reviews that we dropped it and used cachable buffers for the initial DMA BUF heaps. Further, I want to make sure we avoid the custom flag abuse that ION saw, especially with vendor heaps. So I think having each unique behavior being a separate heap is a reasonable stance. That said, we added the (currently unused) heap-flags field to the interface as there may be some attributes or modalities that are truly generic across heaps. So if we want to add an UNCACHED flag instead, I'm open to that.. however I want to make sure it has clear general meaning so that its behavior is consistent across all heaps and architectures (or produces an error if it's not supported). thanks -john