From patchwork Mon Sep 30 18:13:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kanchan Joshi X-Patchwork-Id: 13816830 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) (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 490AF1991D8 for ; Mon, 30 Sep 2024 18:20:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.24 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727720461; cv=none; b=grESVF0hpqvALyXFMhoi4rMLI71EbYmQxj/K8F++558pu9vUqZA3C8mX+1jpJ3ErBE3UVLSIFY3baT/vneJbX7CqwuONsVzQwNs0sdxugrvjEBdkc7jmr84yzOfjO1eVe3muQaEk3vDJENrZH0aQyWpAUmAUfISH08EV1BhQLZ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727720461; c=relaxed/simple; bh=NJhNSEWfQuicmoWnOXbPshrUmZB5Ti5qi6HbF/7gcdQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: References; b=g1P8k3b2hH9u1TVvqWkt4YMQNAzyyg0Z3WL6mEBT/iGMQINm5AksNwjsDdhlLGPT3asXXmmUMw6Hf18UeZD76sqhu98FnFRvpS1EyMiDGzQrBmwpmaRIm7tip8amzn5D/lGzCXgKvYk7S5Qk/9evcTOjdW3f7/Mo9nwQuY+IVZc= 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=PDIWA60H; arc=none smtp.client-ip=203.254.224.24 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="PDIWA60H" Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20240930182056epoutp01b7811ebfdd7dd90ffbcf75c119f898e4~6GJnfYEau1696916969epoutp01U for ; Mon, 30 Sep 2024 18:20:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20240930182056epoutp01b7811ebfdd7dd90ffbcf75c119f898e4~6GJnfYEau1696916969epoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1727720456; bh=4LBDHSJVU1H97AxnvlyhnVRQZzY6KCoCAgte1h6Y9Ng=; h=From:To:Cc:Subject:Date:References:From; b=PDIWA60HsX66Yl+6XwMQcuV3CMKnrJla0HRWBvwhf4xdjjAzMLLAFTTHV6HAVDsES XM5grzbVxVObCatYW2KVmn13bfWdUaorWL0HmOWQL0yOf2CUo+AZCR01BpCZlxNQrm 4xo9hvZh9WIKE2rdr83ydHlDnyL9g5XLv10wS1cU= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20240930182055epcas5p1846d3252efb056c9fe61062565594212~6GJmjkRcY1760617606epcas5p17; Mon, 30 Sep 2024 18:20:55 +0000 (GMT) Received: from epsmges5p1new.samsung.com (unknown [182.195.38.178]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4XHTsK3WZsz4x9Pp; Mon, 30 Sep 2024 18:20:53 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id BB.C9.09420.50CEAF66; Tue, 1 Oct 2024 03:20:53 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20240930182052epcas5p37edefa7556b87c3fbb543275756ac736~6GJkcXrLq2353623536epcas5p3t; Mon, 30 Sep 2024 18:20:52 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240930182052epsmtrp2c5610fcd20805f353e1d082217316a9e~6GJkbaWbv2734327343epsmtrp2g; Mon, 30 Sep 2024 18:20:52 +0000 (GMT) X-AuditID: b6c32a49-0d5ff700000024cc-38-66faec05defa Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 4C.79.18937.40CEAF66; Tue, 1 Oct 2024 03:20:52 +0900 (KST) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240930182049epsmtip23462ac72f0fbc210f05d50b83d060b98~6GJhYF2Fl2298222982epsmtip23; Mon, 30 Sep 2024 18:20:49 +0000 (GMT) From: Kanchan Joshi To: axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, hare@suse.de, sagi@grimberg.me, martin.petersen@oracle.com, brauner@kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, jaegeuk@kernel.org, bcrl@kvack.org, dhowells@redhat.com, bvanassche@acm.org, asml.silence@gmail.com Cc: linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, linux-block@vger.kernel.org, linux-aio@kvack.org, gost.dev@samsung.com, vishak.g@samsung.com, javier.gonz@samsung.com, Kanchan Joshi Subject: [PATCH v7 0/3] FDP and per-io hints Date: Mon, 30 Sep 2024 23:43:02 +0530 Message-Id: <20240930181305.17286-1-joshi.k@samsung.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01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7 2xZzIeH/kuBT+u/+X7N4IBPm4XM3stP6gvzpO/cOXP273NTS4NeEU6WzX5yKaAq5bZ29P6Wp p/+8wbmQkr7UxZ+bn7Mpvf9c91eofuILF8uVyYtnH2p5zOs2tceJLXOmgFu8+waJf00N5kt3 bfr92sX88QIGHpco+X3SrOw+2snrU1bs4C6I2PPqOv+D2uRrqb9+NYe+NF6XIvTXbPaDkvOa /SXsRj4LuEXTJ9/8mHBc+0JKU+U23nN/7HbMY5Hd789xMKJ534VXtu8vXl6f08Roybqn/MuW AztarOxXBkesm1C45e8G19nrl7QKFBu4mt6TWnsosOOX60y9lh6Z3ysMlViKMxINtZiLihMB v38qDjwDAAA= X-CMS-MailID: 20240930182052epcas5p37edefa7556b87c3fbb543275756ac736 X-Msg-Generator: CA CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240930182052epcas5p37edefa7556b87c3fbb543275756ac736 References: Another spin to incorporate the feedback from LPC and previous iterations. The series adds two capabilities: - FDP support at NVMe level (patch #1) - Per-io hinting via io_uring (patch #3) Patch #2 is needed to do per-io hints. The motivation and interface details are present in the commit descriptions. Testing: Done with fcntl and liburing based custom applications. On raw block device, ext4, xfs, btrfs and F2FS. Checked that no regression occurs for application that use per-inode hints. Checked that per-io hints, when passed, take the precedence over per-inode hints. Changes since v6: - Change io_uring interface to pass hints as SQE metadata (Pavel, Hannes) Changes since v5: - Drop placement hints - Add per-io hint interface Changes since v4: - Retain the size/type checking on the enum (Bart) - Use the name "*_lifetime_hint" rather than "*_life_hint" (Bart) Changes since v3: - 4 new patches to introduce placement hints - Make nvme patch use the placement hints rather than lifetime hints Changes since v2: - Base it on nvme-6.11 and resolve a merge conflict Changes since v1: - Reduce the fetched plids from 128 to 6 (Keith) - Use struct_size for a calculation (Keith) - Handle robot/sparse warning Kanchan Joshi (3): nvme: enable FDP support block, fs: restore kiocb based write hint processing io_uring: enable per-io hinting capability Kanchan Joshi (3): nvme: enable FDP support block, fs: restore kiocb based write hint processing io_uring: enable per-io hinting capability block/fops.c | 6 +-- drivers/nvme/host/core.c | 70 +++++++++++++++++++++++++++++++++++ drivers/nvme/host/nvme.h | 4 ++ fs/aio.c | 1 + fs/cachefiles/io.c | 1 + fs/direct-io.c | 2 +- fs/fcntl.c | 22 ----------- fs/iomap/direct-io.c | 2 +- include/linux/fs.h | 8 ++++ include/linux/nvme.h | 19 ++++++++++ include/linux/rw_hint.h | 24 ++++++++++++ include/uapi/linux/io_uring.h | 19 ++++++++++ io_uring/rw.c | 24 ++++++++++++ 13 files changed, 175 insertions(+), 27 deletions(-)