Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5936983rwd; Mon, 5 Jun 2023 10:28:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5i7JSrgMVIhCHy8clgwdTTtcSSth+pd5VnvPJHzo/YNoeLvXX4AnnI3KiYVaxoHcZwHgr5 X-Received: by 2002:a05:6a20:c19d:b0:110:d78f:813e with SMTP id bg29-20020a056a20c19d00b00110d78f813emr7280043pzb.40.1685986112354; Mon, 05 Jun 2023 10:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685986112; cv=none; d=google.com; s=arc-20160816; b=i2oCFm4pUggiukeSknlRe9wjqTyGTuhVm1q/payfUPu31uUI1ORpq4IGiv+prDRHGH wrQhc5NCANa6hHdf1RpznwnFfbFGrXypjLhQ+B48+Xs+T0Uqzgyo/cPBTK9I/89axuYS f5WtyRDVptT5bo64raO2wwugGLjDaJbokoCEWpG9uJP2Bf8iBJ25vHJBiPZMVL1MQpQk IyJ9zKcnPuvM/alF05knnxgkvbU41JmD0bAy9o6PUrRT2OvivicFcijxbL/sE54ZyymL gOcYPAoA/dAn/rOiDlu0GOH8klNkfTS1n5vwinsWRz0pXY0vrB1itwi1olwSsyinaVKy Qpmw== 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=vDRJgVE5cH04MV15lyuR8QwAmByzpL4hoF/MQxP+aCo=; b=LJiEifE/Rnv5lOaRhZwAUKHixGFwQruWAMDsdykfXtl0FcQ2yuEIK7UKIP6loFoymF N192sLGKRCiA1wAbWYpf7kAMKr6+Q0a/F+S4P07WZH6enG0dnuXFyuIJxT41RAhGBeMS stHKNzBKYDEIBuacQUf/2Go1Zvg1/6rQm12rlFBhd/Sjredu5vkPOr2qQO98LAJtG56C ZoPx5J7xEkeAjXBrmbGNUhPCNHK7Eg6zuj+ZdlkG+Q0/dLJ7S5WeuR0hA1g1WS4simiX i94B+iDZY/kWa9+Gu+oEMhl2A1DBnkbWxfs9D2b13LA3xJpwdg6Td7t+i9brxissn386 w8kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b="Ei/LRpe8"; 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 a18-20020aa794b2000000b0064cce871b49si4212646pfl.137.2023.06.05.10.28.19; Mon, 05 Jun 2023 10:28:32 -0700 (PDT) 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.20221208.gappssmtp.com header.s=20221208 header.b="Ei/LRpe8"; 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 S234818AbjFEQtv (ORCPT + 99 others); Mon, 5 Jun 2023 12:49:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234807AbjFEQtn (ORCPT ); Mon, 5 Jun 2023 12:49:43 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 123EBE6 for ; Mon, 5 Jun 2023 09:49:39 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6584553892cso401416b3a.0 for ; Mon, 05 Jun 2023 09:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1685983779; x=1688575779; 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=vDRJgVE5cH04MV15lyuR8QwAmByzpL4hoF/MQxP+aCo=; b=Ei/LRpe8k3OFfTc/VkSB/xDKar7hPdfukU8UV74asVwDhnlUFq6MoQI77JP70KYzqT VwpJl9HpmDuXDVX1DG5iZIqF/6J0ErGIY41R19KPoHLnjeF8Gi/FH+8ghj3XB7T03WtI VbLYFEUH+p2Nzqh1DTfqkDDmh9kocKybhx0WRy0HA3aWOsXcDYaCCXp4LYMtUQeiTQtK orgN2Q+rMlNc3hqMCgoH+0O7l62JNW3r+LaORs4nvGiuhPO4WFjgX1qrLHxZZ1AaVx5K KZzSB9g5huWomew3qr9ttRdjb7Gs9g0f0THUtsddtKNSSubwcD1aRda+VpW2odzfxL/L j0IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685983779; x=1688575779; 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=vDRJgVE5cH04MV15lyuR8QwAmByzpL4hoF/MQxP+aCo=; b=fudQrGp2apQBH+LJUg41gkL+Z2WBOIsaC0XtDYX2/1lqzDUNUSU/zUkVwtv1qr7396 upNRRSRWgfJ3wKTlGlVwhfyQ7vT+ekw2u5wAPckNMt5EdyYzrRtl7oojF6YyH1Jc4fP8 QzMLuJ8ltskqbPuON20Li2tXeLIXgNIBSEsYZ4ZckL0p7HWrhCU5ryHebShclUKiGqTY Km1+4N74EfsP6qX6qNd6Pgc8m405ZQM3I5rCNeW+RWzp/GH+nO3XTlxvyJ/4A59nAXi7 DyEibd2PNdX2o3xYCHYaOB1elmr95bo0qnhlSVSaNRBij6seETn0yLCRcy7KQhFjMDcE vEBQ== X-Gm-Message-State: AC+VfDwp3+lS6Y3w1ZSuEt8opRltMC0vZW2tY68k7C44ry3W6FZhdLWZ ECQ4LmC0qKBVn0SuQetzMer0ug== X-Received: by 2002:a05:6a20:4425:b0:116:1cc7:ada with SMTP id ce37-20020a056a20442500b001161cc70adamr4482199pzb.6.1685983779369; Mon, 05 Jun 2023 09:49:39 -0700 (PDT) Received: from ?IPV6:2600:380:c01c:32f0:eff8:7692:bf8a:abc6? ([2600:380:c01c:32f0:eff8:7692:bf8a:abc6]) by smtp.gmail.com with ESMTPSA id x24-20020aa784d8000000b0064fd8b3dd14sm5404414pfn.124.2023.06.05.09.49.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jun 2023 09:49:38 -0700 (PDT) Message-ID: Date: Mon, 5 Jun 2023 10:49:37 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 0/7] block layer patches for bcachefs Content-Language: en-US To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20230525214822.2725616-1-kent.overstreet@linux.dev> <8e874109-db4a-82e3-4020-0596eeabbadf@kernel.dk> <2a56b6d4-5f24-9738-ec83-cefb20998c8c@kernel.dk> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 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 6/4/23 5:38?PM, Kent Overstreet wrote: > On Tue, May 30, 2023 at 10:50:55AM -0600, Jens Axboe wrote: >> Sorry typo, I meant text. Just checked stack and it looks identical, but >> things like blk-map grows ~6% more text, and bio ~3%. Didn't check all >> of them, but at least those two are consistent across x86-64 and >> aarch64. Ditto on the data front. Need to take a closer look at where >> exactly that is coming from, and what that looks like. > > A good chunk of that is because I added warnings and assertions for > e.g. running past the end of the bvec array. These bugs are rare and > shouldn't happen with normal iterator usage (e.g. the bio_for_each_* > macros), but I'd like to keep them as a debug mode thing. > > But we don't yet have CONFIG_BLOCK_DEBUG - perhaps we should. Let's split those out then, especially as we don't have a BLOCK_DEBUG option right now. > With those out, I see a code size decrease in bio.c, which makes sense - > gcc ought to be able to generate slightly better code when it's dealing > with pure values, provided everything is inlined and there's no aliasing > considerations. > > Onto blk-map.c: > > bio_copy_kern_endio_read() increases in code size, but if I change > memcpy_from_bvec() to take the bvec by val instead of by ref it's > basically the same code size. There's no disadvantage to changing > memcpy_from_bvec() to pass by val. > > bio_copy_(to|from)_iter() is a wtf, though - gcc is now spilling the > constructed bvec to the stack; my best guess is it's a register pressure > thing (but we shouldn't be short registers here!). > > So, since the fastpath stuff in bio.c gets smaller and blk-map.c is not > exactly fastpath stuff I'm not inclined to fight with gcc on this one - > let me know if that works for you. > > Branch is updated - I split out the new assertions into a separate patch > that adds CONFIG_BLK_DEBUG, and another patch for mempcy_(to|from)_bio() > for a small code size decrease. > > https://evilpiepirate.org/git/bcachefs.git/log/?h=block-for-bcachefs > or > git pull http://evilpiepirate.org/git/bcachefs.git block-for-bcachefs Cn you resend just the iterator changes in their current form? The various re-exports are a separate discussion, I think we should focus on the iterator bits first. -- Jens Axboe