Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp200224lqo; Thu, 16 May 2024 03:56:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWSZrtBVUQ5dizVWC7PiHEjfRsc3Zr6erC/lVrEYBy2BOcpPZWs1A5NucMRg1Rz8Xm5Q3pWmzJ/HknJnHNY80AH2Wp5ULIwcRb6GaPZgA== X-Google-Smtp-Source: AGHT+IGGQ3pF+3FCg8P/e5fpUgv/J9nfVp7OlVKOITT9NHPa9LW34exVLNTV/LtN0/SDiQEJmi4h X-Received: by 2002:a05:622a:181c:b0:439:f5f0:ac86 with SMTP id d75a77b69052e-43dfdad012amr246000801cf.17.1715857007334; Thu, 16 May 2024 03:56:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715857007; cv=pass; d=google.com; s=arc-20160816; b=Yp2JDPkHsxQbpxcnhvgagEAP/7IyseCeoMKSuabr8jZvGDOGUes/XTtioLheYpwN38 D2oVsiLATGm9OITSxbvSmPcRVOtod2bl8urkHMBZGXXuNhnRQB5oKf6DW4ws8G/q5Vxx w+4sa2faGE0wm8hbkFQCk/rLMSNF8AdN034qGba2uMq5Mv3SxZpN57/cgiOua3N/1oKl knNYMaxEVVlhnvRfcVnVjX/BEDMP8Oxmlg9p7oc1RhX1d9ZEnl710fKnFXwAZBKhNVih zKLdiVKbufokRIOCaKsD3QHRgclFwZqxP9QSy67Oo/UzopFjpY7vem4bNrwdFn4FZand VeNg== 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=CYCaZIYD32X8OWqTmuj/FbQa01MUdFxdF5XvoFGLFW0=; fh=d7cq/jUIqJJsxm4z2NDckKUdE48WSCfcecFRUY6jcGo=; b=o0UqcX9sTFoUilzS+4DCRq4rL5HKkEGrg976mXT5gqvMBvI2gf62tJZyDGpklBcqQy rEb4PJ6ApqKG2w876cUc2aQ2ScDvwv1ozyH9xWZri414qqtX7wGl3d/FXr728mW2P8vH EG39fqlLnYQ2m5CpNwqE9xRSPDtb8VMwQcgNSX2IpXOc71hKEnnMf6id7MUTQ//Ne69E 5g1XlF6+mX56DrFjnpIGuegyEt9vqr0riqRCThgQGY3WZKNjnoHzsSBd2JX9gR3rBHX9 ZSw2GLCKysbQX3ca1QzJ8ks1GMKOn7oN/61rOQdFJDTKKvPQLBW5n9kliH+5m7a7l/a2 IGxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b="Fz/smocq"; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-180924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180924-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df566f7e1si159668781cf.375.2024.05.16.03.56.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 03:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b="Fz/smocq"; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-180924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180924-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 21CA71C21DDD for ; Thu, 16 May 2024 10:56:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EE9F143898; Thu, 16 May 2024 10:56:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Fz/smocq" Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 808DB145339 for ; Thu, 16 May 2024 10:56:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715856994; cv=none; b=QpSAggK+9F7R4fXB7i7FQOkrhRNTEFLvZFaF0+UxjvyJVb0H1czZAh1W0ElG+8k9V9AeC7R1AJ3QF6Yv5o6DdSHoqDSxUyktfral9pzr/vWskAmLySYk3BKD2HAyPmMtRabXpM40I3kj3fLloOa1kf+trmEvxvi1CJKmdiRts6A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715856994; c=relaxed/simple; bh=BsLbCZn+JhmXnJxcv1qH56cu7tkHuVfRZhl7UEiWLEY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Z7A6llBkbYXimA4kCAgK0dMXG4a/bw81Ja0ihM8S9X0YvyPgaJQEL0t6nuteJ0zauyihnmrDY9bHmhtAjwfeJnX2w9f0+c0EVARkIQGpweXiv9YDx4Yi5DV78L6t/s5ztIXYmLu4k/BSE5SEjAAdMKeVXdxNaX8npig2DsmiCAs= 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=Fz/smocq; arc=none smtp.client-ip=209.85.208.172 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-lj1-f172.google.com with SMTP id 38308e7fff4ca-2e381f7c9c4so14821fa.3 for ; Thu, 16 May 2024 03:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1715856990; x=1716461790; 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=CYCaZIYD32X8OWqTmuj/FbQa01MUdFxdF5XvoFGLFW0=; b=Fz/smocqGZqvipuDuJ5GR6bdGTERMK1Tq5TyxPLD9dJVMnK0ANHuWKWjfXeDvUYH2O f8sJcJJc5Ru6hniW49DaMvZl9Oy/5jAIrwXyydOIuglZ+BJkcs6ayC5dX7fjZup4RCwb AD122Vh1lt9tdDezNiNNvx3SlhhpsnenfDcJs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715856990; x=1716461790; 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=CYCaZIYD32X8OWqTmuj/FbQa01MUdFxdF5XvoFGLFW0=; b=OIX4enOSUgz8NYMyxIHeZsKGWArkiCqUUkY6u9viyq90vsSqc/fZEC/ofv05WDwdca 2wM62WhlXP4KZDUmc1JvZqI4weYOr6dljuzaP6TFV5XNCOgsKYHX3nY9gLL95dkGRB3Z r0WHexLCnHh4wN7vf4jg46fZPR0km1nFIKQmiZm0+n3kpdMk8QHJlZQTfk+lk09UtXRD /kuLrs7DajQCqgxvpycoUF1h4rd7Y6F5HUOhdC5NAS0o+P1WSY9DYMxF0Bt23PR9XNeT 8Qob5UYZSJLWYAU4UvUELbCoWnWG1ORnG9Z98hpavBgbjRnKDPyl6I1XB2K/a1BKjdov f9og== X-Forwarded-Encrypted: i=1; AJvYcCWC8cFeEVSnz9fnmM7OAiFxm+dTwcZAaF+mfDfeN9H8MUqmeDaoGdLaqaiIsZsxVamrumdxCj+k+Vn2agxlGY4CkooqQMHRNLlmyRTV X-Gm-Message-State: AOJu0YyzyisYZ/sESOrIe6jEJAazMQRQ5KOVHPIgxc2oNNotcWt1QoOp qim1ZLVPDnt7lsJNrQCJbylFSltNUk50KTlSdyTeSYQFlSEX65qmuYCL4ZZ7QbQ= X-Received: by 2002:a2e:9b8b:0:b0:2e2:1647:8308 with SMTP id 38308e7fff4ca-2e51fd4b33emr121987831fa.2.1715856990407; Thu, 16 May 2024 03:56:30 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-351c6f295e2sm6725490f8f.39.2024.05.16.03.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 03:56:29 -0700 (PDT) Date: Thu, 16 May 2024 12:56:27 +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.6.15-amd64 On Wed, May 15, 2024 at 11:42:58AM -0700, John Stultz wrote: > On Wed, May 15, 2024 at 6:57 AM Maxime Ripard wrote: > > This series is the follow-up of the discussion that John and I had a few > > months ago here: > > > > https://lore.kernel.org/all/CANDhNCquJn6bH3KxKf65BWiTYLVqSd9892-xtFDHHqqyrroCMQ@mail.gmail.com/ > > > > The initial problem we were discussing was that I'm currently working on > > a platform which has a memory layout with ECC enabled. However, enabling > > the ECC has a number of drawbacks on that platform: lower performance, > > increased memory usage, etc. So for things like framebuffers, the > > trade-off isn't great and thus there's a memory region with ECC disabled > > to allocate from for such use cases. > > > > After a suggestion from John, I chose to start using heap allocations > > flags to allow for userspace to ask for a particular ECC setup. This is > > then backed by a new heap type that runs from reserved memory chunks > > flagged as such, and the existing DT properties to specify the ECC > > properties. > > > > We could also easily extend this mechanism to support more flags, or > > through a new ioctl to discover which flags a given heap supports. > > Hey! Thanks for sending this along! I'm eager to see more heap related > work being done upstream. > > The only thing that makes me a bit hesitant, is the introduction of > allocation flags (as opposed to a uniquely specified/named "ecc" > heap). > > We did talk about this earlier, and my earlier press that only if the > ECC flag was general enough to apply to the majority of heaps then it > makes sense as a flag, and your patch here does apply it to all the > heaps. So I don't have an objection. > > 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. > Another thing to discuss, that I didn't see in your mail: Do we have > an open-source user of this new flag? I think one option might be to just start using these internally, but not sure the dma-api would understand a fallback cadence of allocators (afaik you can specify specific cma regions already, but that doesn't really covere the case where you can fall back to pages and iommu to remap to contig dma space) ... And I don't think abandonding the dma-api for allocating cma buffers is going to be a popular proposal. -Sima -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch