Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3424846rwo; Mon, 24 Jul 2023 10:46:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlFp+s4Er28a4H1x2UDJ5UArmTAPB39MtFQ8PYiIGdrCgIN1uFKdAosUidD3Oacn6juiJpBS X-Received: by 2002:a17:902:f68d:b0:1b5:1787:d23f with SMTP id l13-20020a170902f68d00b001b51787d23fmr8474408plg.5.1690220785725; Mon, 24 Jul 2023 10:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690220785; cv=none; d=google.com; s=arc-20160816; b=NcSjSGH7nxCZ9p9IJWwSyJPmRnUwRj3KGcdQDgqtKRBYqG1hTCpJHpAjBwYzG9UHJ/ R5ZanE923EULYlzJXVVqxIGCyaYp5BFMd8ZiyEeuf7xejnjkg5iajysesIF13yEA5uS4 NcoWvp+msBIDREkR76XC/u+4wjFj2Fy60fAysWKMvv+10QosxquXLG1eL+NHj1GldD8S NVSsElZ0hUM0p8VbjaciY1lqoNxrdjp2/jASSMMPsqRa0XsLbYrMn07WxuOhyjXzA3Il X0xAQspDfoDMj9N9sXJHYBD+p3IsF2k4+bOuSrBmTLtt+JL7Q0INDsOjJYykcLKfIDes lZUw== 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:date:dkim-signature; bh=1RR7SJ5J9bSabO2nn8ri1D3skM02qsCIJVqOYYsqxxM=; fh=aCfv/2dVpyL4kSuUQ8TL6niOmOLHOjwMk6xjS3gQkF0=; b=JAcDNjDQCwpXhtXFtKRtUBVlRDCe8rHB+eh7asPRAIP3PGXmvRO8VZqYCP/QAjwgeE n2520QMBoudVlTjN6jwHMEHqac/XE03FtnupQfTpRvK3FkIwFKtvLtXnes8UotHJCf/3 Ktz9V9kHPaaTw02OWf5enOR5PWwg35QxXWmA12PAd67GSP5AgduoaSysrpk9fK4vsoZ6 +mi73MVCkGedX6Vutc7vH4z9+tG2htBib7s/9C2/qNRHn0EIDm0162auNASC8qVDtdK9 +j6XD2reft6gMjhO/7aQZWpIlFl1CO2mQELkmjxagUqQ08hkNCIISll6DGEzJ8TapX/C LNzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="ObOKjtJ/"; 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 n15-20020a170902f60f00b001b3eeaad177si9806631plg.99.2023.07.24.10.46.13; Mon, 24 Jul 2023 10:46:25 -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=@infradead.org header.s=bombadil.20210309 header.b="ObOKjtJ/"; 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 S230470AbjGXReW (ORCPT + 99 others); Mon, 24 Jul 2023 13:34:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbjGXReV (ORCPT ); Mon, 24 Jul 2023 13:34:21 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01113188; Mon, 24 Jul 2023 10:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=1RR7SJ5J9bSabO2nn8ri1D3skM02qsCIJVqOYYsqxxM=; b=ObOKjtJ/THa+xqWvy7oYFf9v1F T1jW7wp0gQh1KChroWUqIsXM2WD6qHEjUlVhy1EXQn+y2hxVI8iF1zCbTv5liX9EwkOvfd9uLZ1DE nfqrtlYWV/MYoJGOC4jhjB/XXMW4MCdMEL3h2i0H7Z/ifAXtYbbpLBh9QI24+qa8H0q7Vk8QNRtGS OAYzoUDt/quatb9MyXKQmfXwj7s0rSuPymo08nhQ5qY4AA+hIQIy4VU7sbfUwGrrrxL104Es3d1rR 0k3G7Y+VKToa54/y+PSAsQ9Qcw9vZ2rSma6Kpw4etEox2eXO1JuPbFqd6nOhUydeAjpQ7s6TVAz2q AsmhqVuA==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qNzRs-0054IL-2J; Mon, 24 Jul 2023 17:34:20 +0000 Date: Mon, 24 Jul 2023 10:34:20 -0700 From: Christoph Hellwig To: Kent Overstreet Cc: linux-bcachefs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , linux-block@vger.kernel.org Subject: Re: [PATCH 05/20] block: Allow bio_iov_iter_get_pages() with bio->bi_bdev unset Message-ID: References: <20230712211115.2174650-1-kent.overstreet@linux.dev> <20230712211115.2174650-6-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230712211115.2174650-6-kent.overstreet@linux.dev> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 Wed, Jul 12, 2023 at 05:11:00PM -0400, Kent Overstreet wrote: > bio_iov_iter_get_pages() trims the IO based on the block size of the > block device the IO will be issued to. > > However, bcachefs is a multi device filesystem; when we're creating the > bio we don't yet know which block device the bio will be submitted to - > we have to handle the alignment checks elsewhere. So, we've been trying really hard to always make sure to pass a bdev to anything that allocates a bio, mostly due due the fact that we actually derive information like the blk-cgroup associations from it. The whole blk-cgroup stuff is actually a problem for non-trivial multi-device setups. XFS gets away fine because each file just sits on either the main or RT device and no user I/O goes to the log device, and btrfs papers over it in a weird way by always associating with the last added device, which is in many ways gross and wrong, but at least satisfies the assumptions made in blk-cgroup. How do you plan to deal with this? Because I really don't want folks just to go ahead and ignore the issues, we need to actually sort this out.