Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3189073lqo; Tue, 21 May 2024 09:10:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtqGoStmTXgj7xoUJHZppiYlzrIgctq0geqOK9eAPHlASfVxjuge16iBU1QrT4Ke34mQg0Lq4qOqPiLWlPbyBeHwuU2pyLKvrtzKY/TA== X-Google-Smtp-Source: AGHT+IHGF2MRxX/URx7tzrROt2zNM3K4R9UxniOmwZ/Ufa9bN1ARUjbOfP2LRFn5nOaYQAq4sRVa X-Received: by 2002:a17:90a:dd8c:b0:2a2:9b37:367a with SMTP id 98e67ed59e1d1-2b6ccd6c44fmr26987723a91.39.1716307852212; Tue, 21 May 2024 09:10:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716307851; cv=pass; d=google.com; s=arc-20160816; b=Tzh6mks8YaEDrsuZbLzW96zoDLICDEl7Om3FvO2bgMwPzsZ24EBzfZBVzdSv9YoBTq YiqFHdxImwIFr4tvfX/GZLe3ahTfpdUzw8QaWuLuJCYEgd2UF4vQkxU6Vx/pjgYurzMV aFYUHCkKEPSLpnZqHcuQi9kDxxp8yWGdib/76XMqqXiZt1CUHgDEjf8G7fRs/V+ZgnFj xL2xFqCpBzTL24RcXcRmiwFnYUrSQRIMjbvfcvUeSd77EL8BGtARGdt6ELaNgFufNyc3 aFtive04UvpfGaAFxT17C2cCig3I1Qd8IkCEwaupalj98B+4MPDjbuSwep0Mrzy82PpD 50Uw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mJYdzH0pAsynv7wKO0qk2byjZJ72J8K30m6YCIFuLT4=; fh=HcNOXD4ha5y9gxBzk1uwqeUAlIe9UmIb20n/4LblwHQ=; b=hGOrdOsHGQe5kE+J6FtV0Ack6P4hlVynkiTHykHVOpvSGksVj6CvJ5K+ZFhHb9d4Hz uKXSNsHBzFAvIXxBJT+vY6G9dHsX+j/BlmkJu4ionpbFg3A9FU2lxZaUVZ5nOwEr2W68 NjRazJD7Oy0Z2VkfI4uNur9+AFv6jBA/g16qKkDak14Y9HwQUcm1RIJs95vUGnmDEhit F7lo9Fzw6KRtWgYHfuVl8NuLUPNudVACzUlK0gsLz/lBJEeB4l59ZVX8rlrtSd9FU4Y3 NAc9xtTJ6aT0fs0m8g7ImfOoEZ+/o5P+rf+DnaAgpTdjkvCCMMYC9bwDAivrO9oe3kFp md7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=jbrtEksX; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-184924-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184924-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-63b7244febfsi1481903a12.306.2024.05.21.09.10.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 09:10:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184924-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=jbrtEksX; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-184924-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184924-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 477A0283A71 for ; Tue, 21 May 2024 12:06:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E94D74C08; Tue, 21 May 2024 12:06:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="jbrtEksX" Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2099C524B4 for ; Tue, 21 May 2024 12:06:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716293187; cv=none; b=rOddkMWVgAWIiWZCNDTSyzi+A5fQg/Nq/0YqJR3NvBbSSvzvct8Gv2Ct/zN2wwAcmLo/BvPgeXlvb2hFhVSzjl+HmTEbOcnFPJSBWh6cg/LZYv9gD/zuRbjYw79kUU1tyTkAdUYhPz4At4nA0SVz6d7tNYTKeaVJz/Bxyyu+TDA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716293187; c=relaxed/simple; bh=y6uf/C+i1B/yZlW5DIn/xIOBl/tE1YV+evnBt2Jjmkk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=feC7vqVUTcChSt11zRzn/ODbdoLKeh/C9+F4yIr3NkbK6LNTybsq6Wh/Gu79GytTi6RbTcSIN4f+Qq77eitTex4e0WshFZ8Ew+lniIp56LYCxNKZinXqVfh/buYyV7ajRzWsXrcVksOSPKxF6UrmOtPHrkSq2fpHG7au+uQXPDs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch; spf=none smtp.mailfrom=ffwll.ch; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b=jbrtEksX; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ffwll.ch Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a59d5b112ecso12885466b.3 for ; Tue, 21 May 2024 05:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1716293184; x=1716897984; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=mJYdzH0pAsynv7wKO0qk2byjZJ72J8K30m6YCIFuLT4=; b=jbrtEksX6Do3jWz9S8J7A2RiC3sJeIZUNewnDgHUsOqvPhzUKVaq8AceCPeNuUQJ/X qaXHkIHF+TzKlSFThuYA7ZYi6F+DKhMIAigp49QE7J+eAd6j1hicu6UZoWc1bOM6cXkT MKMkon/MdFVWaCbzK44Q7fqx+DczFafCf466s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716293184; x=1716897984; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mJYdzH0pAsynv7wKO0qk2byjZJ72J8K30m6YCIFuLT4=; b=RgWGvZR+FmV6Qd7wWEPOtYhIh7NaSY2ucZLFB+Npuv85YNUNTKHCTyqWDjMMVGFvzh t6PJ5obB8aUF9tC1Zik6Z9lmohadPXWhHr1KaKanMT0vhzI14t3hLWDHC246b905QwzQ afvjo80OdLt4yrOYPC2/n+vuYPHyyurxKcAYX/OdD4C7Hu7obf+QIyA6gMNkhA9Arvl+ 4/0PkRSMD4dJyyj+u77wNwT/ywJDJpPFu3wjAAVaV7LKH8Bg9TjSyYu1XFgXatHcDt3e tQtnRoSsh2EqME9kv010uKv09dwzqiCz3/pukMRteh8FX18wTFuWUgCM+ZWuvWj/QgpR ahQg== X-Forwarded-Encrypted: i=1; AJvYcCW40cb9DES0jqtdQnzXXR9Xeo1yUYCQjfwmz8CijnATW0VkHRN0D2A6lc1EOE4m91uxtmNKIlNBi9iI/9Aqf7hUuJim8jqH55N/tfvT X-Gm-Message-State: AOJu0Ywvg+im3EMIYbYIdnEnJK+dHncmaOFcQgXS8rQxFx1vEtM7fpfK mt/rhfkZiWcPaqkXvvu7IRC6BPXVRTNN9iyoD/Bm7X7iUDe5ZE8v3dOA5fDMNOY= X-Received: by 2002:a17:906:3553:b0:a5a:893a:ad3d with SMTP id a640c23a62f3a-a5a893aae74mr1306089766b.7.1716293184252; Tue, 21 May 2024 05:06:24 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a179c7d14sm1605454566b.130.2024.05.21.05.06.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 05:06:21 -0700 (PDT) Date: Tue, 21 May 2024 14:06:19 +0200 From: Daniel Vetter To: John Stultz Cc: Maxime Ripard , Rob Herring , Saravana Kannan , Sumit Semwal , Benjamin Gaignard , Brian Starkey , "T.J. Mercier" , Christian =?iso-8859-1?Q?K=F6nig?= , Mattijs Korpershoek , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH 0/8] dma-buf: heaps: Support carved-out heaps and ECC related-flags Message-ID: Mail-Followup-To: John Stultz , Maxime Ripard , Rob Herring , Saravana Kannan , Sumit Semwal , Benjamin Gaignard , Brian Starkey , "T.J. Mercier" , Christian =?iso-8859-1?Q?K=F6nig?= , Mattijs Korpershoek , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org References: <20240515-dma-buf-ecc-heap-v1-0-54cbbd049511@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: Linux phenom 6.8.9-amd64 On Thu, May 16, 2024 at 09:51:35AM -0700, John Stultz wrote: > On Thu, May 16, 2024 at 3:56 AM Daniel Vetter wrote: > > On Wed, May 15, 2024 at 11:42:58AM -0700, John Stultz wrote: > > > But it makes me a little nervous to add a new generic allocation flag > > > for a feature most hardware doesn't support (yet, at least). So it's > > > hard to weigh how common the actual usage will be across all the > > > heaps. > > > > > > I apologize as my worry is mostly born out of seeing vendors really > > > push opaque feature flags in their old ion heaps, so in providing a > > > flags argument, it was mostly intended as an escape hatch for > > > obviously common attributes. So having the first be something that > > > seems reasonable, but isn't actually that common makes me fret some. > > > > > > So again, not an objection, just something for folks to stew on to > > > make sure this is really the right approach. > > > > Another good reason to go with full heap names instead of opaque flags on > > existing heaps is that with the former we can use symlinks in sysfs to > > specify heaps, with the latter we need a new idea. We haven't yet gotten > > around to implement this anywhere, but it's been in the dma-buf/heap todo > > since forever, and I like it as a design approach. So would be a good idea > > to not toss it. With that display would have symlinks to cma-ecc and cma, > > and rendering maybe cma-ecc, shmem, cma heaps (in priority order) for a > > SoC where the display needs contig memory for scanout. > > So indeed that is a good point to keep in mind, but I also think it > might re-inforce the choice of having ECC as a flag here. > > Since my understanding of the sysfs symlinks to heaps idea is about > being able to figure out a common heap from a collection of devices, > it's really about the ability for the driver to access the type of > memory. If ECC is just an attribute of the type of memory (as in this > patch series), it being on or off won't necessarily affect > compatibility of the buffer with the device. Similarly "uncached" > seems more of an attribute of memory type and not a type itself. > Hardware that can access non-contiguous "system" buffers can access > uncached system buffers. Yeah, but in graphics there's a wide band where "shit performance" is defacto "not useable (as intended at least)". So if we limit the symlink idea to just making sure zero-copy access is possible, then we might not actually solve the real world problem we need to solve. And so the symlinks become somewhat useless, and we need to somewhere encode which flags you need to use with each symlink. But I also see the argument that there's a bit a combinatorial explosion possible. So I guess the question is where we want to handle it ... Also wondering whether we should get the symlink/allocator idea off the ground first, but given that that hasn't moved in a decade it might be too much. But then the question is, what userspace are we going to use for all these new heaps (or heaps with new flags)? Cheers, Sima -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch