From patchwork Mon Aug 26 17:06:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kanchan Joshi X-Patchwork-Id: 822617 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (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 0E3CE18D64D for ; Mon, 26 Aug 2024 17:14:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724692458; cv=none; b=Kzr3EXZ5X1004X9IgfqbnvjsnWSZou22cxKkVr+/UVhKt4cPjdvmaxjc3we8j+SVcoTu6ktQNdl7LswTNYLC/bVLyuc1vhnXyv2QqdF3klgi/7kqQJYPpKwImYr8BoaBzxOSrzvXhMRC4kMLl7I+vy70StgGfVMkrKwo+P+MfCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724692458; c=relaxed/simple; bh=kal5xydGPETFQwQvqncim45a19u2XhkRTCYUkp7F6HA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: References; b=pTQv6AeX9WrhtGjVAh/BI8U4N2yeIuBngckUvXpJ1Rzo5nE7ya6n1HV8ohm8+HgA6xrmkzjoliFQDI8WCNTZSvLkiG4lJy/dMw2QnRi//Z5IDtX7lHl5nMTSrfwM3E14DBE05q1m7rrgb7j4jThg22H7asjJbXYkTAatNNcuUBw= 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=kACi0uut; arc=none smtp.client-ip=203.254.224.25 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="kACi0uut" Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20240826171412epoutp028e542a82842056c7ceb3dea1d141a554~vVqXoi22m2048020480epoutp02o for ; Mon, 26 Aug 2024 17:14:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20240826171412epoutp028e542a82842056c7ceb3dea1d141a554~vVqXoi22m2048020480epoutp02o DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1724692452; bh=Po2gU7Tj1IXZMxwPWnpQrOZ+vFEA/kofumpkR30jMIU=; h=From:To:Cc:Subject:Date:References:From; b=kACi0uutz/JVECZ5teosHI8WGM9SKa0OHvbP5bdqcnS1XsN5DvIQH7gv/VushIqJo fXe0I076oDp1ZjrTkUMy9dq0vVHHdqcwahrhEx8Yl9jDOon1H9PqRTzow2XXug8ynU msRrbYBTgssUDczi3ZNyDeVvEHKoVogvD5q5c6hc= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20240826171412epcas5p3131af6d126d29e121f88274b259a5d35~vVqW6MHli2946129461epcas5p3h; Mon, 26 Aug 2024 17:14:12 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.178]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4Wsy2V308wz4x9Pt; Mon, 26 Aug 2024 17:14:10 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 0D.A3.09642.2E7BCC66; Tue, 27 Aug 2024 02:14:10 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20240826171409epcas5p306ba210a9815e202556778a4c105b440~vVqUt5c6C2946129461epcas5p3f; Mon, 26 Aug 2024 17:14:09 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240826171409epsmtrp21dff6590920e7f62967e1b0cd6fa8b5f~vVqUs0lps3048030480epsmtrp2V; Mon, 26 Aug 2024 17:14:09 +0000 (GMT) X-AuditID: b6c32a4b-613ff700000025aa-42-66ccb7e27d64 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 95.B2.07567.1E7BCC66; Tue, 27 Aug 2024 02:14:09 +0900 (KST) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240826171405epsmtip2435567b12708596c83fb75f46f239673~vVqRFnxQu0040200402epsmtip2b; Mon, 26 Aug 2024 17:14:05 +0000 (GMT) From: Kanchan Joshi To: axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, martin.petersen@oracle.com, James.Bottomley@HansenPartnership.com, brauner@kernel.org, jack@suse.cz, jaegeuk@kernel.org, jlayton@kernel.org, chuck.lever@oracle.com, bvanassche@acm.org Cc: linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, gost.dev@samsung.com, vishak.g@samsung.com, javier.gonz@samsung.com, Kanchan Joshi Subject: [PATCH v4 0/5] Write-placement hints and FDP Date: Mon, 26 Aug 2024 22:36:01 +0530 Message-Id: <20240826170606.255718-1-joshi.k@samsung.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01TfUwTZxz2vTuuh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B6eKK79vuXHp82JAdN7fpzc 9sf+mbzlrzKpgI4SZu0djevmiTocEd67XfiIRbaerFSlbMemdYW8HzLWrNAwPKayblnpfJ7F okmz55TyiOqblz4wcdgiPX2br+RMnWmtDyq3cuTNFhd/6PxESX3uqRa5T6EvDNc+32kToLI7 QOJWUM7u+VGnKh83Hanui5E+VOQvkhq5eSu/6vtgn866PkblELf/quzsLlO8gzUO3u6dkpHq elpvReI/adbq+E/H9+lc71BiKc5INNRiLipOBADy+3UfJgMAAA== X-CMS-MailID: 20240826171409epcas5p306ba210a9815e202556778a4c105b440 X-Msg-Generator: CA CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240826171409epcas5p306ba210a9815e202556778a4c105b440 References: Current write-hint infrastructure supports 6 temperature-based data life hints. The series extends the infrastructure with a new temperature-agnostic placement-type hint. New fcntl codes F_{SET/GET}_RW_HINT_EX allow to send the hint type/value on file. See patch #3 commit description for the details. Overall this creates 128 placement hint values [*] that users can pass. Patch #5 adds the ability to map these new hint values to nvme-specific placement-identifiers. Patch #4 restricts SCSI to use only life hint values. Patch #1 and #2 are simple prep patches. [*] While the user-interface can support more, this limit is due to the in-kernel plumbing consideration of the inode size. Pahole showed 32-bit hole in the inode, but the code had this comment too: /* 32-bit hole reserved for expanding i_fsnotify_mask */ Not must, but it will be good to know if a byte (or two) can be used here. Changes since v3: - 4 new patches to introduce write-placement hints - Make nvme patch use the placement hints rather than write-life 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 (4): fs, block: refactor enum rw_hint fcntl: rename rw_hint_* to rw_life_hint_* fcntl: add F_{SET/GET}_RW_HINT_EX nvme: enable FDP support Nitesh Shetty (1): sd: limit to use write life hints drivers/nvme/host/core.c | 81 ++++++++++++++++++++++++++++++++++++++ drivers/nvme/host/nvme.h | 4 ++ drivers/scsi/sd.c | 7 ++-- fs/buffer.c | 4 +- fs/f2fs/f2fs.h | 4 +- fs/f2fs/segment.c | 4 +- fs/fcntl.c | 79 ++++++++++++++++++++++++++++++++++--- include/linux/blk-mq.h | 2 +- include/linux/blk_types.h | 2 +- include/linux/fs.h | 2 +- include/linux/nvme.h | 19 +++++++++ include/linux/rw_hint.h | 20 +++++++--- include/uapi/linux/fcntl.h | 14 +++++++ 13 files changed, 218 insertions(+), 24 deletions(-)