Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp53413ybt; Tue, 7 Jul 2020 15:52:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWga0kSxYwqIzMx3vIDI7eOzTbfnGZsq03KqvOqYwpTuaS1xjpDCjOMXd+8MVpsp2ypIQx X-Received: by 2002:a50:f08c:: with SMTP id v12mr62647845edl.119.1594162333969; Tue, 07 Jul 2020 15:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594162333; cv=none; d=google.com; s=arc-20160816; b=zG2wtLwveUJEUmJeCmgjWFx2QoQkn+xNrJ2GttSaiFEVWce3kN/elV3yPu9VJMpEYn YuZynCr+ftNVLHgy1/2EX/uLX1rfbVoRDifJ0NHkvKSIeuFXMRnt5NAGRoZYzjAtdSFu VBoJQc86DvPlz98vVXOzQdnvYpal6Z+v4uyiOFw3TFzQT8UNeeIDhPxKuphkygB+TTbQ EPJmfo73twoRv+RkRSO6rGZQ7KUw78WHwU0ghGvhKyrDGg0Lx0nBb0KhADGB/FSAKOfI SiUuTSRKCeZRnq0PZV1LAEaenIkT7pWzJPCvU/JWJCqUzLY4zyESqkDq1yz8o4BmXoI+ W3Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=ujEygxc3d5j3mD7Fz8DXKzp+VHqFRmCSAyV6TACKRqY=; b=WROg2CJWAdP2QWKzfKdfZVcR27Zxa5bEVRzUDTPiEgTYlj6Bl44Ptp84HX87EdFYp/ xT8iXVRLpaDdrKZuZA/FsMGCKrHK2llivyUw/7Y0/wfuEVC1RVefNJbVbWAhSv2aVEoQ 52/tkORKKzUAhsedBnrFk+wDRFX9VoYNLh5BnC77s9FbDM9Eu78w4Mr/M/aD5sGcqDIR kQMKr8NXD6KQut5dXZTxRcMZlFfY/jLk0wLR66l7GZIR4xz+fKIBsZsTdL4zi4vlHaVv B8o00sQYoNgZv0Suw1rpHkfye3aisXpAV3H1vK0rN7oZHHU6bUDSrZ0CDQiHX3OtLDKw QyGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=k5O7SoEu; 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 n15si12974634eje.190.2020.07.07.15.51.50; Tue, 07 Jul 2020 15:52:13 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=k5O7SoEu; 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 S1729353AbgGGWiA (ORCPT + 99 others); Tue, 7 Jul 2020 18:38:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729347AbgGGWiA (ORCPT ); Tue, 7 Jul 2020 18:38:00 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E88F7C08C5E2 for ; Tue, 7 Jul 2020 15:37:59 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id f2so17328145plr.8 for ; Tue, 07 Jul 2020 15:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ujEygxc3d5j3mD7Fz8DXKzp+VHqFRmCSAyV6TACKRqY=; b=k5O7SoEuB4v6eAKTQCGR+WdOKA3x9uxJYb+gAPfh3XvulB0NUO8KAQitfuJa9ojiSH hxKVrpKXGznJXSNUg9l/jd5QyFaTM+4Eb3lSE69M4/KL2f9OFW1/Ms8Fw7c5Z7VudOMo tCLp+SrSLpUSbbAMy+WG/OHB+odh5rndXsxAiBUnwSaS34Ahhg0rVR+db6V3tTCIu1NN eDfPa05dmlFdw9/Mb/JNujhTLFEzBBdOagseogP3GiACZ4+xPX0M877Cm544V+awZNDO BpbhGyU+kbXhZowakppxW8sAXBwZssx2nSOq1RHiXZjqDiktcfi8tcZpEBVn+DPU4bVv mENw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ujEygxc3d5j3mD7Fz8DXKzp+VHqFRmCSAyV6TACKRqY=; b=UK2F+WJpPyGVElqdJPOxPMdcBwgmH6B82vxSa/kEdOTWPga5frkwujiNX7HT5cuhLk DyPqLVvhhI95A/YecV5RAGgh9EKf950itsHFeLzNNm7VGcnSmjW12FCyPZ0KmDLMpvzQ tbf6508X+B2oV/5SJy2/BQVLF2KJPRLNdHm3wmY8f63VOB0cP46C7HRKr7d+Sdn6ANsZ WqKFAtUO0sgkPFHJKFKrvuEHlG06HH3b6v2+dg11zbQ4DiWhMECH6UWQ7pqeiLhd0NnB sP/3ZpHmjDTuO14Ug3PQ4qRpUdhrgfUm/70BGo+aVxUxe+8hk13T5cPms92N8o/1hx9y oPaw== X-Gm-Message-State: AOAM533CPPsx/FvjaF4rBmZU1rTLwHUPDzaw12gY+gvA+zGz50OR4VVv 49Yy7ITH16DbNNZbIKCf3sUy4Q== X-Received: by 2002:a17:90a:9f4a:: with SMTP id q10mr6612744pjv.139.1594161479264; Tue, 07 Jul 2020 15:37:59 -0700 (PDT) Received: from [192.168.1.182] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id e6sm15496691pfh.176.2020.07.07.15.37.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jul 2020 15:37:58 -0700 (PDT) Subject: Re: [PATCH v3 4/4] io_uring: add support for zone-append To: Matthew Wilcox 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 References: <20200705210947.GW25523@casper.infradead.org> <239ee322-9c38-c838-a5b2-216787ad2197@kernel.dk> <20200706141002.GZ25523@casper.infradead.org> <4a9bf73e-f3ee-4f06-7fad-b8f8861b0bc1@kernel.dk> <20200706143208.GA25523@casper.infradead.org> <20200707151105.GA23395@test-zns> <20200707155237.GM25523@casper.infradead.org> <20200707202342.GA28364@test-zns> <7a44d9c6-bf7d-0666-fc29-32c3cba9d1d8@kernel.dk> <20200707221812.GN25523@casper.infradead.org> From: Jens Axboe Message-ID: <145cc0ad-af86-2d6a-78b3-9ade007aae52@kernel.dk> Date: Tue, 7 Jul 2020 16:37:55 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200707221812.GN25523@casper.infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/7/20 4:18 PM, Matthew Wilcox wrote: > On Tue, Jul 07, 2020 at 02:40:06PM -0600, Jens Axboe wrote: >>>> so we have another 24 bytes before io_kiocb takes up another cacheline. >>>> If that's a serious problem, I have an idea about how to shrink struct >>>> kiocb by 8 bytes so struct io_rw would have space to store another >>>> pointer. >>> Yes, io_kiocb has room. Cache-locality wise whether that is fine or >>> it must be placed within io_rw - I'll come to know once I get to >>> implement this. Please share the idea you have, it can come handy. >> >> Except it doesn't, I'm not interested in adding per-request type fields >> to the generic part of it. Before we know it, we'll blow past the next >> cacheline. >> >> If we can find space in the kiocb, that'd be much better. Note that once >> the async buffered bits go in for 5.9, then there's no longer a 4-byte >> hole in struct kiocb. > > Well, poot, I was planning on using that. OK, how about this: Figured you might have had your sights set on that one, which is why I wanted to bring it up upfront :-) > +#define IOCB_NO_CMPL (15 << 28) > > struct kiocb { > [...] > - void (*ki_complete)(struct kiocb *iocb, long ret, long ret2); > + loff_t __user *ki_uposp; > - int ki_flags; > + unsigned int ki_flags; > > +typedef void ki_cmpl(struct kiocb *, long ret, long ret2); > +static ki_cmpl * const ki_cmpls[15]; > > +void ki_complete(struct kiocb *iocb, long ret, long ret2) > +{ > + unsigned int id = iocb->ki_flags >> 28; > + > + if (id < 15) > + ki_cmpls[id](iocb, ret, ret2); > +} > > +int kiocb_cmpl_register(void (*cb)(struct kiocb *, long, long)) > +{ > + for (i = 0; i < 15; i++) { > + if (ki_cmpls[id]) > + continue; > + ki_cmpls[id] = cb; > + return id; > + } > + WARN(); > + return -1; > +} That could work, we don't really have a lot of different completion types in the kernel. -- Jens Axboe