Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B59311C2335 for ; Tue, 29 Jul 2025 14:53:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753800820; cv=none; b=RHKs7RpYkwY0KvYjQhU+ZsKWG23lAoMQrn31VvQJLocf7qGDRdF4h7eqHoU9FPNjg7TB7y3xkoRVzGNWHpXiAj5EnGzO4LukfVWpJI0fgoW7HcnBMh3md8PpFz1draChSzxgW9k7CD994PGKqQ/7wnkaTBpMX1AHis9lq9L8nT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753800820; c=relaxed/simple; bh=+7M8rXzY4+16SzboMc6aY9+0dHMT2VddmDaI4CFvnrQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: References; b=sct9wOA9aD5KpczG1ldNLpZGhC3FJQXO8tZP8i7U/Dt5/XVJWzOocqK22+lQADSL6/s84S0nCFhNzR0ILBesSFOthackmQQDba6oO69SUj3nrHCP0uNFbZxQU9vjsz99B+kcbRcC1OFHkL3N8CkiRkLQUJzm1aZG9ETqTnUuWvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=rLQeBq3h; arc=none smtp.client-ip=203.254.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="rLQeBq3h" Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20250729145333epoutp043f2c38cf67e7ff5e45b35a8f48f1fc39~WwIxB5S_h2455324553epoutp04e for ; Tue, 29 Jul 2025 14:53:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20250729145333epoutp043f2c38cf67e7ff5e45b35a8f48f1fc39~WwIxB5S_h2455324553epoutp04e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1753800813; bh=PP+pElz2+RSofKFlT75ABJcN8YsXyQwIEv+IPUV95YA=; h=From:To:Cc:Subject:Date:References:From; b=rLQeBq3h/6wnStJ2SQcIvE2zszquk9mUfllDhSV3YyHBXMzDZXNe8P9joITG38ABS ACcgKwO4Cdbg9asul9WEQWv7MsVC0rv8MeBZbIaaovzhEIzKsoIAN9/XE2uT6VKipk H0qAzInw6l2cuFHqQ8sEUGvMGLhrwr34nRWfdfN0= Received: from epsnrtp01.localdomain (unknown [182.195.42.153]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPS id 20250729145332epcas5p180c684ef6be1ccbaba4309ff264a9731~WwIwbDcP02034720347epcas5p1m; Tue, 29 Jul 2025 14:53:32 +0000 (GMT) Received: from epcas5p2.samsung.com (unknown [182.195.38.89]) by epsnrtp01.localdomain (Postfix) with ESMTP id 4bryyh1Sdtz6B9m4; Tue, 29 Jul 2025 14:53:32 +0000 (GMT) Received: from epsmtip2.samsung.com (unknown [182.195.34.31]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20250729145331epcas5p4821f0ddedbbe425b733bf8330878cb3d~WwIvT3p4P0961609616epcas5p4v; Tue, 29 Jul 2025 14:53:31 +0000 (GMT) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20250729145330epsmtip2b14d9505165c46b5ad80306b1e008417~WwIt545I80475604756epsmtip2B; Tue, 29 Jul 2025 14:53:29 +0000 (GMT) From: Kanchan Joshi To: kbusch@kernel.org, hch@lst.de, axboe@kernel.dk, brauner@kernel.org, josef@toxicpanda.com, jack@suse.cz, jlayton@kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, Kanchan Joshi Subject: [RFC PATCH 0/5] FDP file I/O Date: Tue, 29 Jul 2025 20:21:30 +0530 Message-Id: <20250729145135.12463-1-joshi.k@samsung.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CMS-MailID: 20250729145331epcas5p4821f0ddedbbe425b733bf8330878cb3d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P cpgsPolicy: CPGSC10-542,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250729145331epcas5p4821f0ddedbbe425b733bf8330878cb3d References: 6.16 enables block I/O path for FDP, but file I/O needs further work. This was covered in LSFMM [1]; among other things, we discussed application and kernel-driven placement policies. The series shows one of the ways to enable application-driven placement, without resorting to per-FS plumbing. But filesystem can control the number of streams that applications get to use. This can be useful for fs-specific policies or for metadata (placement) about which applications have no knowledge. Application interface involves three new fcntls: - F_GET_MAX_WRITE_STREAMS: To query the number of streams that are available. - F_SET_WRITE_STREAM: To set a particular stream on a file. - F_GET_WRITE_STREAM: To know what stream is set on the file. An example program using these is attached below [2]. [1] https://lwn.net/Articles/1018642/ [2] #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #define BUF_SIZE (4096) int write_fd(int fd, int st) { char buf[BUF_SIZE]; int ret, set, get; if (fd < 0) { printf("[!]invalid fd\n"); return fd; } ret = fcntl(fd, F_GET_MAX_WRITE_STREAMS); if (ret < 0) { printf("F_GET_MAX_WRITE_STREAMS: failed (%s)\n", strerror(errno)); return ret; } if (st > ret) { printf("error in setting stream, available upto %d\n", ret); return -1; } ret = fcntl(fd, F_SET_WRITE_STREAM, st); if (ret < 0) { printf("F_SET_WRITE_STREAM: failed (%s)\n", strerror(errno)); return ret; } set = st; ret = fcntl(fd, F_GET_WRITE_STREAM); if (ret < 0) { printf("F_GET_WRITE_STREAM: failed (%s)\n", strerror(errno)); return ret; } get = ret; if (get != set) printf("unexpected, set %d but get %d\n", set, get); ret = write(fd, buf, BUF_SIZE); if (ret < BUF_SIZE) { printf("failed, wrote %d bytes (expected %d)\n", ret, BUF_SIZE); return ret; } return 0; } int main(int argc, char *argv[]) { int ret, regfd; /* two file writes, one buffered another direct */ regfd = open("/mnt/f_buffered", O_CREAT | O_RDWR, 0644); ret = write_fd(regfd, 7); close(regfd); regfd = open("/mnt/f_direct", O_CREAT | O_RDWR| O_DIRECT, 0644); ret = write_fd(regfd, 6); close(regfd); return ret; } Kanchan Joshi (5): fs: add a new user_write_streams() callback fs: add the interface to query user write streams fs: add a write stream field to the inode fs: propagate write stream fs: add set and query write stream fs/btrfs/extent_io.c | 1 + fs/buffer.c | 14 ++++++--- fs/direct-io.c | 1 + fs/ext4/page-io.c | 1 + fs/fcntl.c | 64 ++++++++++++++++++++++++++++++++++++++ fs/inode.c | 1 + fs/iomap/direct-io.c | 1 + fs/iomap/ioend.c | 1 + fs/mpage.c | 1 + include/linux/fs.h | 8 ++++- include/uapi/linux/fcntl.h | 7 +++++ 11 files changed, 94 insertions(+), 6 deletions(-) base-commit: 66639db858112bf6b0f76677f7517643d586e575 -- 2.25.1