Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3914321rwo; Mon, 24 Jul 2023 20:01:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlEeBvHaFbG35HaOGcH0hgteYrt2BGgGvtpwbyYT35Wqs7XvunHp2Wbc3UkHaRjc5vdr9cQ2 X-Received: by 2002:a17:907:2e0b:b0:96b:e93:3aa8 with SMTP id ig11-20020a1709072e0b00b0096b0e933aa8mr10590032ejc.21.1690254065901; Mon, 24 Jul 2023 20:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690254065; cv=none; d=google.com; s=arc-20160816; b=BRlSqtRjNnBUNyqHwKZJbrb5G3U46sLY9MLQBg3JAGj6BQugr4rspP9tOdOG9s0g/f RUO+7c5cPMCr5hB4dhm8B+6acVxmTrL7cWxAKCzVosXCHc5HLOkc7XaKnm8XRyuqTPTx QVKRsm4C6QgLHgD38eZL6Ympb1kkh9ncEhbYX5x1spoEw7hBOf/SRdqziRXQvPxYuWb1 k5dvHLI50rdSiGyLkDrKfPzSFdT9yCe6rmN7rBxyy4zaFAfmqJmrT5L/HnOz6i0XDyZ9 wQ+P4hIqIQz+d6+yKf347hXtMU9voEm1XVUFmSIVcjxWc8gkDD7MhPtt2uzdbL2g0bHl fndA== 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=zRlrLYqhm+DPWxs7qL0A08DMpLwzB/CFij0sa/3sknc=; fh=7gvr3PZTJbYwX2F35Hck8vHqEy0l6XwJAyI4KbTuj8I=; b=yc7A4sIy9TmP5EQCB3yuMOmTcpTU34lksAk6mqyyImsRIzLCjSAMxoDZPv/LDMb7+3 1x6azbFGGPNhDgyTmeLX77j5k5kkGaB3V6YxHYpMz3BibSHLgqmH9NOYuUT9I49fSnfl NFh1X36CUpe96GqLIkBvtlULEdRvXKrXzqg9EB+Nex7Cp4w5bQe6opIb+QoR5OzYTsdR C6TrVTM/Ak91NO5DehUMl+nLp5qLjLOXhjhqXyG6jEzOsEBCo2jOHumHJIMYTfvitUEv duneQ0VvxHIPw2rEnZYkpCAK0j/hQo9Crxt+N/TCjPGBa/rZtRWlOpafPQj/zBiPnUvz D/mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=VSIgW8uv; 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 l6-20020a1709061c4600b009929566f00asi7324154ejg.467.2023.07.24.20.00.41; Mon, 24 Jul 2023 20:01:05 -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=VSIgW8uv; 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 S231187AbjGYCo5 (ORCPT + 99 others); Mon, 24 Jul 2023 22:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230502AbjGYCo4 (ORCPT ); Mon, 24 Jul 2023 22:44:56 -0400 Received: from out-56.mta1.migadu.com (out-56.mta1.migadu.com [IPv6:2001:41d0:203:375::38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 226FB1999 for ; Mon, 24 Jul 2023 19:44:25 -0700 (PDT) Date: Mon, 24 Jul 2023 22:43:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1690252995; 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=zRlrLYqhm+DPWxs7qL0A08DMpLwzB/CFij0sa/3sknc=; b=VSIgW8uv8ZpGeForKyxp5LXrl5qslkkkhEn9qNjeG9qTCU4POVXOOYUylXGypZcMWWZmvn SdaODHDbZ5GG80ZkjdvF7HKp5q/RI24bsVi1BIh0WuEQjtnIo8Rs++eMnE9lKrB3BUaLoT OtPtHX4794EPxbB++CXEbjcq6hzLpD4= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Christoph Hellwig 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: <20230725024312.alq7df33ckede2gb@moria.home.lan> 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: 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 Mon, Jul 24, 2023 at 10:34:20AM -0700, Christoph Hellwig wrote: > 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. Doing the blk-cgroup association at bio alloc time sounds broken to me, because of stacking block devices - why was the association not done at generic_make_request() time?