Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1062417lqj; Mon, 3 Jun 2024 09:04:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWASjR94l7/eVoVGoaQJGJOig/SUDf8j7kD2VcjNUO92EUJhf60+miYkBecDZoiwA4YZZpK9TEnQ2jiUwoVH6rWrrCWqb37eLgKeC6rxg== X-Google-Smtp-Source: AGHT+IFl+tT/9/LAgRvQvu7nhENRB7w5SIBjdNvB886elRsGkUWLc8usXzsaId3Bx952nydlZ6oB X-Received: by 2002:a05:6a20:914d:b0:1a9:a32d:17cc with SMTP id adf61e73a8af0-1b26f141cf0mr9867750637.18.1717430674934; Mon, 03 Jun 2024 09:04:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717430674; cv=pass; d=google.com; s=arc-20160816; b=SXH4e0+WCYxKfn7z/fdc8htJX0Mj3dANpU5mOs9wy0vJM44t10YwA+xK1rBxRO9ynH Nvjj2pGbhrt7yyCzNV9v1CXoR0vNKmlp4Y5rKFkcreHtlklI+mw6NCgsZWyFo9NdfCyc 8/tmRTbFdBzYdpBzhsGro2/hRaOjsIPBhHaatGOMqXVc9s4g5imlz6Hl2m2ecnasN9wT hTW/TIRcgfgpH6rUVBWEYYuZIZdj/eEEYrvDsgxylXsoODDIm5sTlJ25Da3zyPcQD08u /gw+b6Eav/75ab/tACUVP+AmUUUYBJv/Mi3e+sQT3gn/WKbmMhaumfzCiJ+qLud3dzzB CLbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=3pPvxS6gC0j0wLGI+tY2V3qvQ3+8OtijuhMmjKJ6yQo=; fh=auChc++Nhz/8ZTkPKsDeHFZkyjFGeNoYG98kRpvniSY=; b=CvDrMvfheZ7hT5LIX/ZxkJG7lLvK1dgiU9csIaSSbus+C59TYw5EmxI83wpq0/iZdi ++6hj+CPx0exZtqZBO5IzfuPDdA2VkAO5nrYHA0qPKSpvC5WNL8vscGpzCY3s0gjNolX Dd92t8ALeSKnkro9NBS3I3Gj1MMhA/tYP/HtePgMUywjZrYpQG2ugHfpUwpfcIOn04u7 ohBbNynbjrVLlrNb1DACca0zIe7y5cvutKW9nO8GLYLzahQ8+b12oraiTAjop2qX8Bak QAK1JRRhh8ftm+pXGzzMFX6Qh6EaFAGt+77NLsEhzzstPsdREnnZ04U17z+6/H34qhA2 zzLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="p5eETr/E"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-199404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35c73c2adsi6694742a12.735.2024.06.03.09.04.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 09:04:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="p5eETr/E"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-199404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 C007A28866C for ; Mon, 3 Jun 2024 16:02:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD759135A71; Mon, 3 Jun 2024 16:02:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="p5eETr/E" Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 7B17D134409 for ; Mon, 3 Jun 2024 16:02:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717430528; cv=none; b=arcdp+gDMsgrtqBGDXqFA6/cYmRNozQZxJB0zEcpPs34sPp8kdKW4eYyihy9e1isU7CXbyhR8O75MAP3/4M1/xZd36Al16vJ6ZgHglfD4lr9zgC6kof1AyyuAAD8LRQXEDi8Xrb411r8kiBYsfm7ObdwEfk2L2ZLQo40GcEbLLc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717430528; c=relaxed/simple; bh=3pPvxS6gC0j0wLGI+tY2V3qvQ3+8OtijuhMmjKJ6yQo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RabJ3kDAqyjVNugjMnIWuM9VzAKNM1ASyOCpkte+Tbt63HCN6yuRiINNAKEMsBBs4Kk9aR6Fwao7VRB7UmkrjgGmt1g29idjgs++Dlg75Sl8z7XaXBmcfGKCBZCwIuyHLR3jgaecJBfKh1OBF+W9RjoTR4+felf6zNxsxsgX7gY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=p5eETr/E; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-57a16f4b8bfso23965a12.0 for ; Mon, 03 Jun 2024 09:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717430525; x=1718035325; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3pPvxS6gC0j0wLGI+tY2V3qvQ3+8OtijuhMmjKJ6yQo=; b=p5eETr/E07844d7vd35bqJhYdG0vUZVgUqAIwededZOWY6Vmm9gOs7PsYdk8hFYphP 6r8I+BNvRqo1Y7tMPa+PTld0bupt1nkxTh/Gi+eLh01ZeFgbh8bLw3c0WDcBLW8NB+EQ J68I0YieIvQRUw5T7GjO2CEz0D3kGAKGaIYhIjRdQo0R8V6JSX59XZjT5ORD3XvOk4D2 ZKvsLrnzcvssY8mC/Gh6h9p7K7gfogOzIXPbr1Ed8WI7RYjMoVFnyKpKhSqc0vUjUgBV AzI/21WCYBkGKUN43lmug5QJXB949K3WNDxyxybU0keTgs/zVW8JTofEV23cZyLvpmFG z/6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717430525; x=1718035325; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3pPvxS6gC0j0wLGI+tY2V3qvQ3+8OtijuhMmjKJ6yQo=; b=TSDkfOF8LmOSmS9eY3MGTvxUrfg/lGaEZmMf0eH8/nvaGIadxBTp4gjNBUpYuDG5lS BkylwfIbTB8W261WBOTSVdrSHoeKmUrIeYmXKuerHiM8IF3579oIna8jE4Ft7BIdQdI8 2g2jp4lj5GmvGISl5K8q5lsfIZgEUANZzc8k8FIOTSNbBGmSsmMGUC+kvU2EM7m35iQd pmTY3YnmCa1aFTFRey5HTxlBtkuQdRvnkedwub8KZ0fZ097EVak2bB+osf9FDzlV930P t/w9q2EccH55Oq0lGCvSCrJZYC18hyfjagYHLodq2bHF1+DBDTpw0CwEc2fhHBMZ30pg etsA== X-Forwarded-Encrypted: i=1; AJvYcCV4zx+Ez4HACpqb0HClapxi3KUGKgAWg0ZCILdOgi4+fR3XsjjqjMYab47wI0rt3voF+ngfQ7zO+lUT3ToJKJdWEcTAxFzArTB4VCkF X-Gm-Message-State: AOJu0YxsYHZCKvzibGPQrWwfDucE2MZy68Ih5JFYzlU+q54U6jjznLC5 uvLYb0kbZSIBGznjSxhSRnPc3DIAZBvb3G/+ml+dAiYSfxud4tLjc8tQA9AsiRHgR0GAQ75yejP MFQcvYmYfzGA73JNlD2g9b0vDg1L9alfl/C0= X-Received: by 2002:a05:6402:1803:b0:572:e6fb:ab07 with SMTP id 4fb4d7f45d1cf-57a49645b32mr266898a12.7.1717430524539; Mon, 03 Jun 2024 09:02:04 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240603114008.16235-1-hailong.liu@oppo.com> In-Reply-To: <20240603114008.16235-1-hailong.liu@oppo.com> From: John Stultz Date: Mon, 3 Jun 2024 09:01:52 -0700 Message-ID: Subject: Re: [RFC PATCH v1] dma-buf: heaps: move the verification of heap_flags to the corresponding heap To: hailong.liu@oppo.com Cc: Sumit Semwal , Benjamin Gaignard , Brian Starkey , "T.J. Mercier" , =?UTF-8?Q?Christian_K=C3=B6nig?= , 21cnbao@gmail.com, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jun 3, 2024 at 4:40=E2=80=AFAM wrote: > > From: "Hailong.Liu" > > This help module use heap_flags to determine the type of dma-buf, > so that some mechanisms can be used to speed up allocation, such as > memory_pool, to optimize the allocation time of dma-buf. This feels like it's trying to introduce heap specific flags, but doesn't introduce any details about what those flags might be? This seems like it would re-allow the old opaque vendor specific heap flags that we saw in the ION days, which was problematic as different userspaces would use the same interface with potentially colliding heap flags with different meanings. Resulting in no way to properly move to an upstream solution. With the dma-heaps interface, we're trying to make sure it is well defined. One can register a number of heaps with different behaviors, and the heap name is used to differentiate the behavior. Any flags introduced will need to be well defined and behaviorally consistent between heaps. That way when an upstream solution lands, if necessary we can provide backwards compatibility via symlinks. So I don't think this is a good direction to go for dma-heaps. It would be better if you were able to clarify what flag requirements you need, so we can better understand how they might apply to other heaps, and see if it was something we would want to define as a flag (see the discussion here for similar thoughts: https://lore.kernel.org/lkml/CANDhNCoOKwtpstFE2VDcUvzdXUWkZ-Zx+fz6xrdPWTyci= VXMXQ@mail.gmail.com/ ) But if your vendor heap really needs some sort of flags argument that you can't generalize, you can always implement your own dmabuf exporter driver with whatever ioctl interface you'd prefer. thanks -john