Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3388172rwb; Mon, 16 Jan 2023 07:24:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXvdEenSC40ZTDiDjrEXnojc4O/sLJAI9oW/yUYKKL4mqMR63/b1twb3K22B8Jrv457VPKHn X-Received: by 2002:a05:6a20:c103:b0:b8:5a85:632c with SMTP id bh3-20020a056a20c10300b000b85a85632cmr7472001pzb.60.1673882652009; Mon, 16 Jan 2023 07:24:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673882651; cv=none; d=google.com; s=arc-20160816; b=fVC1pJ3XINN16iLv7qGKP65lh0b1KH4ab5D4WOFZLudgIg2NOhDKV6QlBq4/dTMF5+ KWs1+uj1VHJGgm3QkUE4dpQnA41vh7zrnWL909egI6kg2WD9Nxp6BdjbTnowEmu4sa9U CEhwfRTzOouknp70L9kpJhzX4L7uI6k1FpZB6ODo2g7vYoNnjp1jw3vOmiZ83dmzOFAa ywtKxjJHV9osijiPVNzbvokg1T2yAxngXxUF2cD2dtbUuFco0NzZ8VFn5w+FtfFKgdAc DV9DI8RtFCAwinWIfeS8v7Ad6F2O222+rv+2unicWQH6Bt1Ip7ICF1L2BFPgsd/iJ9P5 Rs0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=147jSvlJn5xlSD2sUs0kYKU5A8XzMbwpiBCjTNuI7UQ=; b=r0SdML99D8UOEcAeV6ek4fWsYr6yNyQJSwCK9TMeI02K1xtgtdhi+bc+TcjdbWCIht yqiPMQVXNj+rGETgTLd2ALA9+JEpIXJmfFTcGW/iWvamcdjr+AQ+RrRlGRVuHAQBs+gN qxxNTXotrcukaNq/vSBOzdotYSRwCXYHTuHnlfjuByhK+4ATN6gpOT1q9iX420WFS+Tl P2yVcupix7HGHE5WiDurBeZgCvSJ3nJiPTVloMDfg6bk6FzZIrq9wIHSwcTIVy5cO3Xc 2v+Nr9eb/jaSgFO3OCg1Ixl4w1L+fDGoWR1NT/8hCIRvo9L9b3hBnVmr3jbiss7NzAxz Ci6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=RJAFWHju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m11-20020a6545cb000000b0044601bb2f90si31133956pgr.530.2023.01.16.07.24.05; Mon, 16 Jan 2023 07:24:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=RJAFWHju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231465AbjAPN6V (ORCPT + 50 others); Mon, 16 Jan 2023 08:58:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229982AbjAPN5n (ORCPT ); Mon, 16 Jan 2023 08:57:43 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF86422785 for ; Mon, 16 Jan 2023 05:55:22 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id v23so25492516plo.1 for ; Mon, 16 Jan 2023 05:55:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=147jSvlJn5xlSD2sUs0kYKU5A8XzMbwpiBCjTNuI7UQ=; b=RJAFWHjuvZK/dAbe6GnD6KJxIkse2okjfKOmy0E0QmeeTYuRgtpe5HYs9Z6UnS9Mf2 cbBM6Riu6PuvpQO+ovTAbQRyUGDSiXB03qZtzQHu+cdvbtYanb1ERT7LFng2Z7nl8tz8 ZTGUU0wpHVIw8/vNoZ5gKPDvnM0yFkIrUbifnhV5ynDfzBVXiuRAy+Q8ISWHN6WVYXzK pKG3Q+zeA0Sbg1A/qPe+DL8OsEyLbjhDyoxpFTsVHtvnafoGcIqxxXZMaO0Wd9i6BDRy HjmgJoAGOapftq5GBQI03vrGwPq6618OLSUIbkh2J732odRmWORQsH/CRgys8R339uBa C+0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=147jSvlJn5xlSD2sUs0kYKU5A8XzMbwpiBCjTNuI7UQ=; b=xle5LGswR88O2NlMjcNWMrnXesthukgPlTBDvRidFEcpq53+WqX4Cj5IhyvcGXtuGt OWm1G3di/cWYt+kp7Z6UP0YjXZoagSUGc49GUEkJ/OQY0F2K/bp2YjMs3ZEIgLsx3C66 IVmD1Kb+HFoEpOJkR9syz9zQqVn/f8rayBKUi7FDRnObE+9FuaJqZrwVmLY3M7dx2VF8 q21MFWmempjuJ0k9P6lNflPrHVndViwe4iSzl6zgtcFRjO9HHkeC9Hr5Hn3E7vUllftl nv1F57BnHih2l9bheZ86mkPxdlo070ywSYzPFTiy/h94B0VS3mmiSZ0Pc+hyZL/KksoT 2fkg== X-Gm-Message-State: AFqh2kpvzlfPoytF2xmNN//WQ/jEMmxmA/nYxJ58bF93dqp3xELwkqq/ m4wvb+ipU/5wYorx6ygpCx+FMg== X-Received: by 2002:a05:6a20:3a9e:b0:9d:efc1:116c with SMTP id d30-20020a056a203a9e00b0009defc1116cmr21242624pzh.6.1673877322173; Mon, 16 Jan 2023 05:55:22 -0800 (PST) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id c10-20020a63d14a000000b004468cb97c01sm15901902pgj.56.2023.01.16.05.55.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Jan 2023 05:55:21 -0800 (PST) Message-ID: Date: Mon, 16 Jan 2023 06:55:20 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 2/2] io_uring: Split io_issue_def struct Content-Language: en-US To: Breno Leitao , Gabriel Krisman Bertazi Cc: asml.silence@gmail.com, dylany@meta.com, io-uring@vger.kernel.org, leit@fb.com, linux-kernel@vger.kernel.org References: <20230112144411.2624698-1-leitao@debian.org> <20230112144411.2624698-2-leitao@debian.org> <87v8lbcwz9.fsf@suse.de> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/16/23 3:52 AM, Breno Leitao wrote: > On Thu, Jan 12, 2023 at 05:35:22PM -0300, Gabriel Krisman Bertazi wrote: >> Breno Leitao writes: >> >>> This patch removes some "cold" fields from `struct io_issue_def`. >>> >>> The plan is to keep only highly used fields into `struct io_issue_def`, so, >>> it may be hot in the cache. The hot fields are basically all the bitfields >>> and the callback functions for .issue and .prep. >>> >>> The other less frequently used fields are now located in a secondary and >>> cold struct, called `io_cold_def`. >>> >>> This is the size for the structs: >>> >>> Before: io_issue_def = 56 bytes >>> After: io_issue_def = 24 bytes; io_cold_def = 40 bytes >> >> Does this change have an observable impact in run time? Did it show >> a significant decrease of dcache misses? > > I haven't tested it. I expect it might be hard to came up with such test. > > A possible test might be running io_uring heavy tests, while adding > enough memory pressure. Doing this in two different instant (A/B test), > might be a unpredicable and the error deviation might hide the benefit. I think what you'd want is two (or more) io_uring ops being really busy and measuring dcache pressure while running that test. I don't think this is very feasible to accurately measure, and I also don't think that is an issue. The split into hot/cold parts of the op definitions is obviously a good idea. For ideal setups, we'll never be using the cold part at all, and having a smaller op definition for the fast path is always going to be helpful. -- Jens Axboe