Received: by 2002:ac8:678b:0:b0:405:464a:c27a with SMTP id b11csp19943qtp; Tue, 1 Aug 2023 12:26:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlH/h9pMxhjfbpsEpGKwY8zRis3udCwbZrNlrGmHQAsHCGO5Fa8L4HdHCmnmq5iVppEfJTdV X-Received: by 2002:a05:6a21:790a:b0:134:2e3c:9845 with SMTP id bg10-20020a056a21790a00b001342e3c9845mr13281337pzc.22.1690918008091; Tue, 01 Aug 2023 12:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690918008; cv=none; d=google.com; s=arc-20160816; b=Z9bNdJD6ZYXeJw8S7Oehil04ZuCcKpH1e8ALv5qtaLOXkc5FzNJaamHqdTH5gteoc0 UP4biwxr1bTn29NrRHPHVGgO695u9nl1CQXhB26qhbzFsoJEg5AZcTjW3dZOIwmr4x0R c8sFGsn6WVEygxRq8wiwxiPrKLy3ngGqLPeDPWGb91AewBQCpns0utSg4/yHMkPtGwI3 ZwdyjxF6fXpOYLtZAb1brkLtZ2F96ka0hI5M4Oz8ZiF58f98C3r0NoBqXkTy15iaQgxo 3A0go+MD7qRryAhw7Hkmdsk+cpXn7uQ2fVFdGBOVqqi3xVWZvapR5jsA70CQQCSvE9+z 8/PA== 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=jfWGV5dMuNA+1k/g0x2HPi2H3e0sQoZ0G+P7Z3UTKNQ=; fh=7gvr3PZTJbYwX2F35Hck8vHqEy0l6XwJAyI4KbTuj8I=; b=q8F58q+51lwO1gusHjR0K4mmzyxHWAjkPTgir/mYnHTZZnTAiLqul4/cREQ42QF+Ek M1ye94KMEOIqAZ/MZ/COWXVWhcadsJJQAybFWC5SHFQoDimyg5Zgk6N5HTOegUcfMuH2 D2Dx4S8tak29xFrxAOjG0lelDe3IkLSH+6wQxGdbqrT3IqRr5zGQ++epsZ9oZykHL8v/ IsPA1yEcBSeC06C36Plfg5GjIIsl5xFMfDRYuwIIwHDOMAUS9JjYJ3KvY1xSRkoWo9NF I8UBMxkBLiw87iNW0A2yhNaLbgXGP4uVLll/Eup0rh6d9CPZL/4J1Bnhuphs63yHYbcq Ymnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QQrRaj1a; 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 c22-20020aa78e16000000b006826f3512ffsi7667056pfr.234.2023.08.01.12.26.35; Tue, 01 Aug 2023 12:26:48 -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=QQrRaj1a; 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 S232122AbjHATE7 (ORCPT + 99 others); Tue, 1 Aug 2023 15:04:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231576AbjHATE5 (ORCPT ); Tue, 1 Aug 2023 15:04:57 -0400 Received: from out-104.mta0.migadu.com (out-104.mta0.migadu.com [91.218.175.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 058D3115 for ; Tue, 1 Aug 2023 12:04:54 -0700 (PDT) Date: Tue, 1 Aug 2023 15:04:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1690916693; 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=jfWGV5dMuNA+1k/g0x2HPi2H3e0sQoZ0G+P7Z3UTKNQ=; b=QQrRaj1ammrSYgVJVT6ObcpMXwgOV38s9kvPJfy82b5gHdJMp1WAsVtgLGKa65gpyvlcag WTqlG597lqZ+dZnqsaAGv3dUX4pFNtyr1eKaQyX/U5G9WR9ZUOPM6Ex+UFnw08PMzAzCLM kSbNMBV/jcYfsAtS0ja5nm2uT1jxcqQ= 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: <20230801190450.3lbr2hjdi7t52anx@moria.home.lan> References: <20230712211115.2174650-1-kent.overstreet@linux.dev> <20230712211115.2174650-6-kent.overstreet@linux.dev> <20230725024312.alq7df33ckede2gb@moria.home.lan> 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,RCVD_IN_DNSWL_BLOCKED, 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 Wed, Jul 26, 2023 at 06:23:05AM -0700, Christoph Hellwig wrote: > On Mon, Jul 24, 2023 at 10:43:12PM -0400, Kent Overstreet wrote: > > 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? > > Because blk-cgroup not only works at the lowest level in the stack, > but also for stackable block devices. It's not a design decision I > particularly agree with, but it's been there forever. You're setting the association only to the highest block device in the stack - how on earth is it supposed to work with anything lower? And looking at bio_associate_blkg(), this code looks completely broken. It's checking bio->bi_blkg, but that's just been set to NULL in bio_init(). And this is your code, so I think you need to go over this again. Anyways, bio_associate_blkg() is also called by bio_set_dev(), which means passing the block device to bio_init() was a completely pointless change. bcachefs uses bio_set_dev(), so everything is fine.