Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp398217ybt; Fri, 19 Jun 2020 04:40:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9piz9vUFQCcR3mKyFWzOJq6941irTkHdNDi29fEMZo8nqoay0PkqubC1I4FmGa+aSQSfM X-Received: by 2002:a17:906:851:: with SMTP id f17mr3071049ejd.396.1592566802819; Fri, 19 Jun 2020 04:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592566802; cv=none; d=google.com; s=arc-20160816; b=ilr077GQqznytxiccVVxyPft4nuHASyUsB7pTLQtPDq+z5nFoe9mPnoPY2c/mj3tPg MSZS64wMVTVBGzpb6r9m8RcVFJW7Ki4kPVNhjFEoHduxd80zJlNgsMdOSgna2yoD4+gC qY/5v414W2TCFALsxRJb1/TWDL6IWFUWpOKtYi8rAlaou89UcyjtZq+5f+0Fimtm3n2J EobvWvoIQruoKLaZGBgH0OQr2nOCXQD4zwGt3Oi7rF1hJazE+AbQ5ZPkroqp0i6TBS/f SdZO0jPqrSV9W3QEHPfUiVHc/1jllMTvE9yLlDi6S+UVq8tHAZByImNZl38VoqzhdUYi v9jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :mime-version:message-id:subject:cc:to:from:date:dkim-signature :dkim-filter; bh=PLuLOAyQS6GaPUTrSfpe9L/E6wCKGkltfo+WP36l8Fg=; b=SNftnGC6UFHhyE3R5Z+1XcjvsLvWxTIfXMkLf6WQnins9JzHVAU5M3kdMsb0YwTY8h 5R7DPThF+gBrcBMJIX0xvONQk6pbg2uKPfGtW+jUMYYd4+SPwuEU46pgwD10xC5ziMWU K5UCumhHwtNKKtsb5dSRaQ8uvp3gbbA5fyuui7vIr90wLEB/0948YGkNiWrgCSA9OVC7 2HTMKmgaomqRc7qAMW1lhXgovj8L4VZeucCEaMoccr7VMpKFt08CaKeDIWEXM5lysg6W HByY5KwVwn/vU+OpBEmaplzGZnrV8rAkI0YWmExjrba6jo3YrhTzPuJuigmwp6oWG1fb zvRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=JsHM7gpQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si3999415edr.605.2020.06.19.04.39.38; Fri, 19 Jun 2020 04:40:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=JsHM7gpQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731794AbgFSJl4 (ORCPT + 99 others); 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 XCSmXPeEuFpY4tXxLVAfyEicntzDAmIzC2R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17vgQ4wCHIxKPLwvQl7HCbEm 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_--