Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1283691ybt; Thu, 9 Jul 2020 03:18:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfcYLXP9MhQV8f5q1VjWFrnS8+0IzSYZqlUtt48ZiTmcOpHjPidSKBOZ25qYlmv1NKspnO X-Received: by 2002:a17:906:3c42:: with SMTP id i2mr59394290ejg.14.1594289924177; Thu, 09 Jul 2020 03:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594289924; cv=none; d=google.com; s=arc-20160816; b=l8qAQCEPWjEdDB0mbOf7t2Y1YWssjzLKByu6MAeIgDjvSv0iQiVQIELxxYrwpmz+9y Yc/+4e3AVOcIo52sIulRqBDIx+dZPD/xki0OMXuZ2xEX6slBXMzp3ObLpQ7yV5DlNr+E R2+bJc0YeOPaHT2pnZbtFGOoowYa9huV21pA0CWyRaapoBzPVNFhkYTHeGv72HcQm6x/ Q81XY/Yc5GVT2C12Kged/x2yrsbw/Qb6bF9qE97owlITVJnBs/q4DRbtJ45a1ltbAAJE oeeBLhbeurT77Kb5bOOXnb8IArPGwKDiDn2wK/YIauAa/4y+2wCori4xgvyiITct1M6H 3trg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+4y1tH7JgQGg/m4Y2HPNpPcl0NpQqyVNAfEoubft9uY=; b=E/TEmxOGOmCwIxokBba9jA5CHQlqmZlJ9VHr4sFWYze3xBrjrfvZ4GrFJW6AxCwUt2 RLXjWCME43DmNg8JWC/i0eQAwqjSHLffFNWQDP1WEn+g8Z8YdkPLCClOgAmlZyXcln+n hWrK3diHM7afUSM3uMogkBHE25VEW7pCuDhYoEYfGnLxGMKZ+6Rsa6s8nyJuOfX6Y089 bnKapwZnWN1hlAnP6KF5AowI/R9U+we6XuYb96S2YvL0Oel9osMWfhUDAogM4eZLjq9w sarh7GjIhpNCVqkkSR+AJA9RsqdEzmF7mc8e87al8oGxsqhu83TgUhE8gaHP2vlfTgmM Q7Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=kfAlLVsR; 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 i26si1666654eja.98.2020.07.09.03.18.21; Thu, 09 Jul 2020 03:18:44 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b=kfAlLVsR; 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 S1726517AbgGIKQO (ORCPT + 99 others); Thu, 9 Jul 2020 06:16:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726140AbgGIKQN (ORCPT ); Thu, 9 Jul 2020 06:16:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 337FAC061A0B; Thu, 9 Jul 2020 03:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+4y1tH7JgQGg/m4Y2HPNpPcl0NpQqyVNAfEoubft9uY=; b=kfAlLVsRpqnbZQEAK40SMcQERa AJ3dkC/7hx9RCDtrf0/3gke1gSrkFxyJf+EkHzqRSG2oK+901gljldEXBKdkGbomGpYn1EapFRu6Q HtpsebXW3mT3AJ7A/iUdncW27w3voAXB1ykeDfelYyIfxvgjmF32l4dB+dqkg6GDU3HVaDCf1B3VM hl9DInOwoFkeAlr6t+Hz9maFrGkMHr+BcG6SApp1XiUze3uBczRlS9d45yOfyfdaQ8BymLq8TlYfV Bp9/pC3nrvuEJg/IaqP0CHEfyJgNA9ZAl4XPHDXNx6u58PfGJvJfsmDwELO/eD2GabcXZTwTR2gff AFhDMLkg==; Received: from [2001:4bb8:188:5f50:7053:304b:bf82:82cf] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtTax-0000ZA-F3; Thu, 09 Jul 2020 10:15:59 +0000 Date: Thu, 9 Jul 2020 12:15:59 +0200 From: Christoph Hellwig To: Jens Axboe Cc: Kanchan Joshi , viro@zeniv.linux.org.uk, bcrl@kvack.org, hch@infradead.org, Damien.LeMoal@wdc.com, asml.silence@gmail.com, linux-fsdevel@vger.kernel.org, mb@lightnvm.io, linux-kernel@vger.kernel.org, linux-aio@kvack.org, io-uring@vger.kernel.org, linux-block@vger.kernel.org, Selvakumar S , Nitesh Shetty , Javier Gonzalez Subject: Re: [PATCH v3 4/4] io_uring: add support for zone-append Message-ID: <20200709085501.GA64935@infradead.org> References: <1593974870-18919-1-git-send-email-joshi.k@samsung.com> <1593974870-18919-5-git-send-email-joshi.k@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 05, 2020 at 03:00:47PM -0600, Jens Axboe wrote: > > diff --git a/fs/io_uring.c b/fs/io_uring.c > > index 155f3d8..cbde4df 100644 > > --- a/fs/io_uring.c > > +++ b/fs/io_uring.c > > @@ -402,6 +402,8 @@ struct io_rw { > > struct kiocb kiocb; > > u64 addr; > > u64 len; > > + /* zone-relative offset for append, in sectors */ > > + u32 append_offset; > > }; > > I don't like this very much at all. As it stands, the first cacheline > of io_kiocb is set aside for request-private data. io_rw is already > exactly 64 bytes, which means that you're now growing io_rw beyond > a cacheline and increasing the size of io_kiocb as a whole. > > Maybe you can reuse io_rw->len for this, as that is only used on the > submission side of things. We don't actually need any new field at all. By the time the write returned ki_pos contains the offset after the write, and the res argument to ->ki_complete contains the amount of bytes written, which allow us to trivially derive the starting position.