Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4759575rwd; Tue, 30 May 2023 09:27:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ73H5ZwbvGOHYNWEElIuVzNMWef1BN0K9YHLBP5hJEZDYJU0KFNEEVMGfz0mlPnm0eJma11 X-Received: by 2002:a05:6a20:938d:b0:106:9266:4448 with SMTP id x13-20020a056a20938d00b0010692664448mr3280095pzh.16.1685464059781; Tue, 30 May 2023 09:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685464059; cv=none; d=google.com; s=arc-20160816; b=gPa0cpOyhRSsvauLcvN3/fEpwPiSJ+NCWVGjxbyVthpnj8qndi2JMAGL6vzMWnP379 CuDUxgRETpsUCfr/It57G4VUuK0FRDyh+re/Huk9LglSLVmca1q46gRSVXezs8Uh+ivm Zwu8JozUcYpnbFtBuBq2g2NXh2rx1GGwQ8fE99yP6468bB9Nq/hiBDroUrx8OQQNCvAD 9R5dZI3OR41WFqZjSs/bxEmSqTvrpufomFY/owM0VWcAeXJCrQ3pJdYhyj7YpKNiHk5X CTvhmTlx+wC/dokOcP3+CS1yttUj0fmtVAOXBTGC1D6pOuYV489pGm53gKlt3vg54wNs cG+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=GvzDBLaFoADOumJHcj6o4wathgB48XH/zOUCBfWh1rI=; b=1EjSkT7UXhwiF70f5CqUAQc+H7qaYpo9/snPHbzMDpgmlIIkPXB8AfxrYpkyWmMVOu vDwmeebJKJVwvYpr0b8pIIckYQcd3wqDRJEW5i/acxXZOgzQxuTjv/xjdZdE6as2oQny QeDVbHhj1nv4q8RwaiIQTl8EMwPV4FophOCRiCG5xUaGYIFdu/uJrYT8vIyb4iiHJAyt kZUeCehEp1qHt4TqNHwbgMl7XshYtSRMgkWjR1KP92th5fNv1NhNg1ujANkXYt6qmJpU WWUn3EYUlX536aidI7Zz/7EZhkwA1IYWCJWExOJHBrcFopeaeldApANpvkG6XzBg0Wr0 vuLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="sy7Fwk/k"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 201-20020a6302d2000000b0052872c32995si11040350pgc.724.2023.05.30.09.27.23; Tue, 30 May 2023 09:27:39 -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=@linux.dev header.s=key1 header.b="sy7Fwk/k"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233325AbjE3QH0 (ORCPT + 99 others); Tue, 30 May 2023 12:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233281AbjE3QHN (ORCPT ); Tue, 30 May 2023 12:07:13 -0400 Received: from out-37.mta1.migadu.com (out-37.mta1.migadu.com [95.215.58.37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 955F211B for ; Tue, 30 May 2023 09:07:00 -0700 (PDT) Date: Tue, 30 May 2023 12:06:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1685462818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GvzDBLaFoADOumJHcj6o4wathgB48XH/zOUCBfWh1rI=; b=sy7Fwk/kgvokmeLr0X9kOdkzIshmz3RIjnrrzA/Q5pwbmqQc5EKb47hfIQJddkEkTXT/qF N5qMsH6OoZcTKHOXD4mh38mYq+Qkw0vb6xhb2K2mzIN38Sl8V2TiggGBWUVtydQngHKQTi ML9bOGFfq2i0evMAHiRrTLfgOfmzqoM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Jens Axboe Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 0/7] block layer patches for bcachefs Message-ID: References: <20230525214822.2725616-1-kent.overstreet@linux.dev> <8e874109-db4a-82e3-4020-0596eeabbadf@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8e874109-db4a-82e3-4020-0596eeabbadf@kernel.dk> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 Tue, May 30, 2023 at 08:22:50AM -0600, Jens Axboe wrote: > On 5/26/23 2:44?PM, Kent Overstreet wrote: > > On Fri, May 26, 2023 at 08:35:23AM -0600, Jens Axboe wrote: > >> On 5/25/23 3:48?PM, Kent Overstreet wrote: > >>> Jens, here's the full series of block layer patches needed for bcachefs: > >>> > >>> Some of these (added exports, zero_fill_bio_iter?) can probably go with > >>> the bcachefs pull and I'm just including here for completeness. The main > >>> ones are the bio_iter patches, and the __invalidate_super() patch. > >>> > >>> The bio_iter series has a new documentation patch. > >>> > >>> I would still like the __invalidate_super() patch to get some review > >>> (from VFS people? unclear who owns this). > >> > >> I wanted to check the code generation for patches 4 and 5, but the > >> series doesn't seem to apply to current -git nor my for-6.5/block. > >> There's no base commit in this cover letter either, so what is this > >> against? > >> > >> Please send one that applies to for-6.5/block so it's a bit easier > >> to take a closer look at this. > > > > Here you go: > > git pull https://evilpiepirate.org/git/bcachefs.git block-for-bcachefs > > Thanks > > The re-exporting of helpers is somewhat odd - why is bcachefs special > here and needs these, while others do not? It's not iomap based. > But the main issue for me are the iterator changes, which mostly just > seems like unnecessary churn. What's the justification for these? The > commit messages don;t really have any. Doesn't seem like much of a > simplification, and in fact it's more code than before and obviously > more stack usage as well. I need bio_for_each_folio(). The approach taken by the bcachefs IO paths is to first build up bios, then walk the extents btree to determine where to send them, splitting as needed. For reading into the page cache we additionally need to initialize our private state based on what we're reading from that says what's on disk (unallocated, reservation, or normal allocation) and how many replicas. This is used for both i_blocks accounting and for deciding when we need to get a disk reservation. Since we're doing this post split, it needs bio_for_each_folio, not the _all variant. Yes, the iterator changes are a bit more code - but it's split up into better helpers now, the pointer arithmetic before was a bit dense; I found the result to be more readable. I'm surprised at more stack usage; I would have expected _less_ for bio_for_each_page_all() since it gets rid of a pointer into the bvec_iter_all. How did you measure that?