From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89F73C433E0 for ; Fri, 19 Jun 2020 09:41:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63A1E2080C for ; Fri, 19 Jun 2020 09:41:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="JsHM7gpQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732106AbgFSJl4 (ORCPT ); Fri, 19 Jun 2020 05:41:56 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:60223 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731672AbgFSJlx (ORCPT ); Fri, 19 Jun 2020 05:41:53 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200619094150euoutp02c755bf1efde6c53898da23eed436e048~Z6J6CGwc82054820548euoutp02R for ; Fri, 19 Jun 2020 09:41:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200619094150euoutp02c755bf1efde6c53898da23eed436e048~Z6J6CGwc82054820548euoutp02R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1592559710; bh=PLuLOAyQS6GaPUTrSfpe9L/E6wCKGkltfo+WP36l8Fg=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=JsHM7gpQTOjafbK5l5y/6Ej3hCMrsDWuJMujPbX44Oxt+VdunkT3DSMKtxPtMTxPG 971oASn/if2//u5asEU4r/J5bxfQfbG7ow8J69Fo7PJdfiUNvxCBSCmbhmd6YBUN4G yYDS+wiF5T1dOQDTJp90lQUWidGNYiFD5VHdzFVI= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200619094150eucas1p146321d7bf58830d23c3a47dd759b277e~Z6J50BBcd2327423274eucas1p1L; Fri, 19 Jun 2020 09:41:50 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 52.06.05997.E588CEE5; Fri, 19 Jun 2020 10:41:50 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200619094150eucas1p1858cf1aec415333241db3783fa605307~Z6J5Z2F2q2312223122eucas1p1e; Fri, 19 Jun 2020 09:41:50 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200619094150eusmtrp12170cdfaeae5375f92933590b74e9873~Z6J5ZMBjB0475004750eusmtrp1R; Fri, 19 Jun 2020 09:41:50 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-ac-5eec885e81d6 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 12.43.06017.D588CEE5; Fri, 19 Jun 2020 10:41:49 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200619094149eusmtip15ea23c5fbad9d9f120ee82735e9198bc~Z6J5QuY721898318983eusmtip1r; Fri, 19 Jun 2020 09:41:49 +0000 (GMT) Received: from CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 19 Jun 2020 10:41:49 +0100 Received: from localhost (106.110.32.47) by CAMSVWEXC01.scsc.local (106.1.227.71) with Microsoft SMTP Server (TLS) id 15.0.1320.4 via Frontend Transport; Fri, 19 Jun 2020 10:41:49 +0100 Date: Fri, 19 Jun 2020 11:41:49 +0200 From: "javier.gonz@samsung.com" To: Damien Le Moal CC: Kanchan Joshi , "axboe@kernel.dk" , "viro@zeniv.linux.org.uk" , "bcrl@kvack.org" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-aio@kvack.org" , "io-uring@vger.kernel.org" , "linux-block@vger.kernel.org" , "selvakuma.s1@samsung.com" , "nj.shetty@samsung.com" Subject: Re: [PATCH 3/3] io_uring: add support for zone-append Message-ID: <20200619094149.uaorbger326s6yzz@mpHalley.local> MIME-Version: 1.0 In-Reply-To: <20200618091113.eu2xdp6zmdooy5d2@mpHalley.local> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKKsWRmVeSWpSXmKPExsWy7djP87pxHW/iDBoWyVisvtvPZtH1bwuL RWv7NyaLd63nWCymTGtitNh7S9tiz96TLBaXd81hszj/9zirA6fH5bOlHps+TWL3+LxJzqP9 QDeTx6Ynb5kCWKO4bFJSczLLUov07RK4Mp49b2EpmCpRseNXE3MD4ySRLkZODgkBE4mn3dsZ uxi5OIQEVjBKbDxyCsr5wihx//A9NgjnM6NE0+tN7DAt214eZ4ZILGeUeHD7AStc1d09P6D6 zzBK9PycCZXZC+QsW8EE0s8ioCrRvvw82Cw2oFl/T05gBbFFBLQklu17B9bALLCXRWLmqgcs XYwcHMICdhL3vtuCmLwCNhLvJ+qDlPMKCEqcnPkErIJTwFbi8iFjkE4JgUPsEj1XF7OCxCUE XCSmXPeEuFpY4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k/dxMjMNK2Hfu5ZQdj17vgQ4wCHIxKPLwvQl7HCbEm lhVX5h5ilOBgVhLhdTp7Ok6INyWxsiq1KD++qDQntfgQoynQ9xOZpUST84FJIK8k3tDU0NzC 0tDc2NzYzEJJnLdD4GCMkEB6YklqdmpqQWoRTB8TB6dUA6P08SR1FQWf6tvXd6maupxmsYj9 teSA3P3uMk+v8K9rL8r86VLJffzxYHjclUmr1T78//lru9ajma8K5k01DIp13xLMd1Rt2xTb OCapEGHzrQ8sFnPOcT6trcT2vHZJ5j0rzq0RByPebcjtu2lze/nM8MQZovdffNAxWbmQ03ha p/f1piUn5txXYinOSDTUYi4qTgQAhvhDhcoCAAA= X-CMS-MailID: 20200619094150eucas1p1858cf1aec415333241db3783fa605307 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----S-rmtJXel8VGy5BRhJETGRpDn59uh3J63auyVoMdzEU6LuX2=_d8758_" X-RootMTR: 20200617172713epcas5p352f2907a12bd4ee3c97be1c7d8e1569e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200617172713epcas5p352f2907a12bd4ee3c97be1c7d8e1569e References: <1592414619-5646-1-git-send-email-joshi.k@samsung.com> <1592414619-5646-4-git-send-email-joshi.k@samsung.com> <20200618083529.ciifu4chr4vrv2j5@mpHalley.local> <20200618091113.eu2xdp6zmdooy5d2@mpHalley.local> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ------S-rmtJXel8VGy5BRhJETGRpDn59uh3J63auyVoMdzEU6LuX2=_d8758_ Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Disposition: inline Jens, Would you have time to answer a question below in this thread? On 18.06.2020 11:11, javier.gonz@samsung.com wrote: >On 18.06.2020 08:47, Damien Le Moal wrote: >>On 2020/06/18 17:35, javier.gonz@samsung.com wrote: >>>On 18.06.2020 07:39, Damien Le Moal wrote: >>>>On 2020/06/18 2:27, Kanchan Joshi wrote: >>>>>From: Selvakumar S >>>>> >>>>>Introduce three new opcodes for zone-append - >>>>> >>>>> IORING_OP_ZONE_APPEND : non-vectord, similiar to IORING_OP_WRITE >>>>> IORING_OP_ZONE_APPENDV : vectored, similar to IORING_OP_WRITEV >>>>> IORING_OP_ZONE_APPEND_FIXED : append using fixed-buffers >>>>> >>>>>Repurpose cqe->flags to return zone-relative offset. >>>>> >>>>>Signed-off-by: SelvaKumar S >>>>>Signed-off-by: Kanchan Joshi >>>>>Signed-off-by: Nitesh Shetty >>>>>Signed-off-by: Javier Gonzalez >>>>>--- >>>>> fs/io_uring.c | 72 +++++++++++++++++++++++++++++++++++++++++-- >>>>> include/uapi/linux/io_uring.h | 8 ++++- >>>>> 2 files changed, 77 insertions(+), 3 deletions(-) >>>>> >>>>>diff --git a/fs/io_uring.c b/fs/io_uring.c >>>>>index 155f3d8..c14c873 100644 >>>>>--- a/fs/io_uring.c >>>>>+++ b/fs/io_uring.c >>>>>@@ -649,6 +649,10 @@ struct io_kiocb { >>>>> unsigned long fsize; >>>>> u64 user_data; >>>>> u32 result; >>>>>+#ifdef CONFIG_BLK_DEV_ZONED >>>>>+ /* zone-relative offset for append, in bytes */ >>>>>+ u32 append_offset; >>>> >>>>this can overflow. u64 is needed. >>> >>>We chose to do it this way to start with because struct io_uring_cqe >>>only has space for u32 when we reuse the flags. >>> >>>We can of course create a new cqe structure, but that will come with >>>larger changes to io_uring for supporting append. >>> >>>Do you believe this is a better approach? >> >>The problem is that zone size are 32 bits in the kernel, as a number of sectors. >>So any device that has a zone size smaller or equal to 2^31 512B sectors can be >>accepted. Using a zone relative offset in bytes for returning zone append result >>is OK-ish, but to match the kernel supported range of possible zone size, you >>need 31+9 bits... 32 does not cut it. > >Agree. Our initial assumption was that u32 would cover current zone size >requirements, but if this is a no-go, we will take the longer path. Converting to u64 will require a new version of io_uring_cqe, where we extend at least 32 bits. I believe this will need a whole new allocation and probably ioctl(). Is this an acceptable change for you? We will of course add support for liburing when we agree on the right way to do this. Thanks, Javier ------S-rmtJXel8VGy5BRhJETGRpDn59uh3J63auyVoMdzEU6LuX2=_d8758_ Content-Type: text/plain; charset="utf-8" ------S-rmtJXel8VGy5BRhJETGRpDn59uh3J63auyVoMdzEU6LuX2=_d8758_--