From nobody Mon Feb 9 06:25:31 2026 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 5A50D296D3F for ; Mon, 12 May 2025 17:40:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747071655; cv=none; b=aG6wHtt57y9qz+anxJe7DmaC/I+FBNNoF29cRsVxLlzbHbzXff5xtUmwPIpP1tY5RLSa8CuNp89OZ4qcYpNFVUuFTDioamiOEUXz3C+8aSRcMp+IbvHz7HPhupHhNbm5nvVrKJzrdVSgWTgRgyxhhfkMclwcxPcS5WQeYOrx3Ow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747071655; c=relaxed/simple; bh=Af5UIWE0qy22f6c2JL3nAMlI/7xnmUsXK/UfA5VmQlA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=tcKwgqXzr/wnzVc6v+uMlXIJTuVO1VF2SfoVQWmO0J4W/ik2a6LA52kZhWtW0BLm4tQ3PPD06ni4zbyq9+PrmKJryBXUembR2mGIiwN2C/HbEvb0melHHa7AYLiCkU3+oaOZd24dL22nFNRhcfMyoBek4Eb/e4OX9bnWrs8QjrM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--tjmercier.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=xUKH2PtK; arc=none smtp.client-ip=209.85.216.73 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=flex--tjmercier.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="xUKH2PtK" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-30ad9303655so7439471a91.2 for ; Mon, 12 May 2025 10:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1747071654; x=1747676454; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=SCXgFCr4xFu2oZbXQwI8tdtBERd+L0LdxpvvyzEsoGU=; b=xUKH2PtKVRCbSSxBX3u+LqucX1d7mx5xFxpIkehZB6j1NSkj9Xkox6vxDuTjbeCaRH dpRBNbqvKGHRi2tHcjLUsoicdJTSt+0sQVRPyLhHSl3mohhC9Onf5/BrAoHgLzkRRRhj M8pkxPjxtmHXQTK0y0L5vrHQOqr+pAXqf0ul0gsvt0XdNeubotc5Z3l4KILIWewYBULv OHgEjBoNmcXRN0WhXQ7uPRsGDgZWRRyI3rZXL8cypXAKCnMUvunjtIPa+/Y6pW6gT3U1 19xEjGPSM24XxgHv6FRhC+NMhHy9+VV3zj+yzP9t74oxOKCD4RxDyhkyx0WlvYE6D/9c 6iEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747071654; x=1747676454; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=SCXgFCr4xFu2oZbXQwI8tdtBERd+L0LdxpvvyzEsoGU=; b=cF2zg4Y41JMc8+0uwW02Qy4j/DwfWAegbJIpCJziF+H9IxhhN2yKtITRQZXPnrKhg+ Z8PxXecnprlFo6F625EZ0v0rX2i3BMGf1YJESdWmDQQyrJ2ET9bCEXYo9WCVy0HN0xA6 tf9KCoqcuyFgKLOIf+v/l8eOllTJ+2MajhMo7LKvTE38yzmhvwXClJKCU9zVDjUWsyGI Wphte2gKvDbQtUY4gikrnRe2+PdvjQFkyEImsm8VIfulZ+PhA/xa/LN1LOEDdTnjWxgJ dw7pZqVz1/HdPo/AfeSY9eo4yM5dVWu2ZXbfOfesurtmgpUhgCWl7HD8bQ7yJvzR5n6k sTmA== X-Gm-Message-State: AOJu0YyqnUYkwnIQVDkKcF7DOWYLtC2gzCum5Fr0IEXuqZYiNaT/oF4L T2cIowKYAsk2cym+wb46zxvjzMPQHBXZLtWYjfgc9Ol4SWA7rgw3Qi/dB0Jj3/qUCfULRSZeslw Mv74eshJRAUk7iQ== X-Google-Smtp-Source: AGHT+IF+K6tr0ALF03p76hnqtxjQG6z4jM2ZpShKDCGXLdx2mjPqO4XOd82ZqZJQpw8W2LdE/0X1xEUeMkQ1hsU= X-Received: from pjbpm17.prod.google.com ([2002:a17:90b:3c51:b0:30a:a05c:6e7d]) (user=tjmercier job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4c8e:b0:2fa:1851:a023 with SMTP id 98e67ed59e1d1-30c3d657026mr21415976a91.35.1747071653565; Mon, 12 May 2025 10:40:53 -0700 (PDT) Date: Mon, 12 May 2025 17:40:32 +0000 In-Reply-To: <20250512174036.266796-1-tjmercier@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250512174036.266796-1-tjmercier@google.com> X-Mailer: git-send-email 2.49.0.1045.g170613ef41-goog Message-ID: <20250512174036.266796-2-tjmercier@google.com> Subject: [PATCH bpf-next v5 1/5] dma-buf: Rename debugfs symbols From: "T.J. Mercier" To: sumit.semwal@linaro.org, christian.koenig@amd.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, skhan@linuxfoundation.org, alexei.starovoitov@gmail.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, android-mm@google.com, simona@ffwll.ch, eddyz87@gmail.com, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me, jolsa@kernel.org, mykolal@fb.com, shuah@kernel.org, song@kernel.org, "T.J. Mercier" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Rename the debugfs list and mutex so it's clear they are now usable without the need for CONFIG_DEBUG_FS. The list will always be populated to support the creation of a BPF iterator for dmabufs. Signed-off-by: T.J. Mercier Reviewed-by: Christian K=C3=B6nig Acked-by: Song Liu --- drivers/dma-buf/dma-buf.c | 40 +++++++++++++++------------------------ include/linux/dma-buf.h | 2 -- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 5baa83b85515..8d151784e302 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -35,35 +35,25 @@ =20 static inline int is_dma_buf_file(struct file *); =20 -#if IS_ENABLED(CONFIG_DEBUG_FS) -static DEFINE_MUTEX(debugfs_list_mutex); -static LIST_HEAD(debugfs_list); +static DEFINE_MUTEX(dmabuf_list_mutex); +static LIST_HEAD(dmabuf_list); =20 -static void __dma_buf_debugfs_list_add(struct dma_buf *dmabuf) +static void __dma_buf_list_add(struct dma_buf *dmabuf) { - mutex_lock(&debugfs_list_mutex); - list_add(&dmabuf->list_node, &debugfs_list); - mutex_unlock(&debugfs_list_mutex); + mutex_lock(&dmabuf_list_mutex); + list_add(&dmabuf->list_node, &dmabuf_list); + mutex_unlock(&dmabuf_list_mutex); } =20 -static void __dma_buf_debugfs_list_del(struct dma_buf *dmabuf) +static void __dma_buf_list_del(struct dma_buf *dmabuf) { if (!dmabuf) return; =20 - mutex_lock(&debugfs_list_mutex); + mutex_lock(&dmabuf_list_mutex); list_del(&dmabuf->list_node); - mutex_unlock(&debugfs_list_mutex); + mutex_unlock(&dmabuf_list_mutex); } -#else -static void __dma_buf_debugfs_list_add(struct dma_buf *dmabuf) -{ -} - -static void __dma_buf_debugfs_list_del(struct dma_buf *dmabuf) -{ -} -#endif =20 static char *dmabuffs_dname(struct dentry *dentry, char *buffer, int bufle= n) { @@ -115,7 +105,7 @@ static int dma_buf_file_release(struct inode *inode, st= ruct file *file) if (!is_dma_buf_file(file)) return -EINVAL; =20 - __dma_buf_debugfs_list_del(file->private_data); + __dma_buf_list_del(file->private_data); =20 return 0; } @@ -689,7 +679,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_exp= ort_info *exp_info) file->f_path.dentry->d_fsdata =3D dmabuf; dmabuf->file =3D file; =20 - __dma_buf_debugfs_list_add(dmabuf); + __dma_buf_list_add(dmabuf); =20 return dmabuf; =20 @@ -1630,7 +1620,7 @@ static int dma_buf_debug_show(struct seq_file *s, voi= d *unused) size_t size =3D 0; int ret; =20 - ret =3D mutex_lock_interruptible(&debugfs_list_mutex); + ret =3D mutex_lock_interruptible(&dmabuf_list_mutex); =20 if (ret) return ret; @@ -1639,7 +1629,7 @@ static int dma_buf_debug_show(struct seq_file *s, voi= d *unused) seq_printf(s, "%-8s\t%-8s\t%-8s\t%-8s\texp_name\t%-8s\tname\n", "size", "flags", "mode", "count", "ino"); =20 - list_for_each_entry(buf_obj, &debugfs_list, list_node) { + list_for_each_entry(buf_obj, &dmabuf_list, list_node) { =20 ret =3D dma_resv_lock_interruptible(buf_obj->resv, NULL); if (ret) @@ -1676,11 +1666,11 @@ static int dma_buf_debug_show(struct seq_file *s, v= oid *unused) =20 seq_printf(s, "\nTotal %d objects, %zu bytes\n", count, size); =20 - mutex_unlock(&debugfs_list_mutex); + mutex_unlock(&dmabuf_list_mutex); return 0; =20 error_unlock: - mutex_unlock(&debugfs_list_mutex); + mutex_unlock(&dmabuf_list_mutex); return ret; } =20 diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index 36216d28d8bd..8ff4add71f88 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h @@ -370,10 +370,8 @@ struct dma_buf { */ struct module *owner; =20 -#if IS_ENABLED(CONFIG_DEBUG_FS) /** @list_node: node for dma_buf accounting and debugging. */ struct list_head list_node; -#endif =20 /** @priv: exporter specific private data for this buffer object. */ void *priv; --=20 2.49.0.1045.g170613ef41-goog