Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9184350rwd; Wed, 21 Jun 2023 04:18:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ycJE3TyWlOvP+ZmRNxAIkoSa5iX5VndBUP8q9RGG7Egx9Oa29El1ib9Vq6PglGW3xoeew X-Received: by 2002:a17:902:db10:b0:1b6:7f96:42ca with SMTP id m16-20020a170902db1000b001b67f9642camr4351377plx.66.1687346331490; Wed, 21 Jun 2023 04:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687346331; cv=none; d=google.com; s=arc-20160816; b=dzfg6QRltu7quTFyVi7frM/WdqMCCIplrlM+OW0AMGG6VQ45MoHlRFINODBgBHu0q7 Ce/gSDjVrLuvBb9kqjRjMf82nfxFzMLLELA0Pcxz2p/KRDDcBjHrmHO3/RjIaw03YGd0 FK/87qRFzfWZG+Xx7vfl3sMK9qgUCm3+Lt39ILkrMvFrsqKPB+FHeMX7lTCfuEdEycrQ j+px+PzH3L0bn1GCHy+g6caA88jAiLDqM7ZzIhZnbg+EJW3LENMAK5VsGPMczfImsJgT rOIgvMng2Rn3qkzM7C1mgVpz2byBlI4/HpRiq1uxskatH86VLu5NmaRCeEhUN0XPnzlV Y4Iw== 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:dkim-signature; bh=pnziWqeIZNrvl2O+xZ1w8A8qnxuxPCpJZgtJgpYEvPU=; b=jG7+Of1sPcLJdLB0YXZTttfq0jMjqqOJNXSJYjc/v3jAw1eckc2nufHpsIitjni3Tz lmI7IoQG7XC/0OlXntvEmiVULOHr37GS+yHsIsPEtgBs9dU+EXg8X/87Lfd4/YzPrEH0 Rjdt0BElRzVsjxiP1BZ90s/oHpqqy4E91qQPTYRuldWyvowrsy55uypIqjAlguP28CdC SOEGmmOiTrm+XrXjJnsgtaSH22iIN/fl9iUGVUjOcct9Ng/3mz9TSrFpkuQRNNp0gjuG 0lFZlyECxggvRYHB7vuyJ9wThjMxNczxQgzTP2co6dNATims0+dbw+9PmDjiN6dXnT6X Mb5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Adb4Tgac; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="EthIC3W/"; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jn22-20020a170903051600b001b5497b0030si3853691plb.97.2023.06.21.04.18.27; Wed, 21 Jun 2023 04:18:51 -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=@suse.de header.s=susede2_rsa header.b=Adb4Tgac; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="EthIC3W/"; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231867AbjFULCh (ORCPT + 99 others); Wed, 21 Jun 2023 07:02:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjFULCf (ORCPT ); Wed, 21 Jun 2023 07:02:35 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E7BBBC; Wed, 21 Jun 2023 04:02:34 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 297B01FD6A; Wed, 21 Jun 2023 11:02:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687345353; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pnziWqeIZNrvl2O+xZ1w8A8qnxuxPCpJZgtJgpYEvPU=; b=Adb4Tgacrd4bHVu9MkzkWN+QTgjcjTbEFFwPNjYONgsefwqitUgPD1ytt2T6caVvkj3Fdw hiUw2rsfQilqCdwW8FPWoymED3AJCvWXDjUebGmVTBsrRj/kXKbDGZfWbcVyM2MfVZq55O WGTQ3o0S3ud8xZaOsahm9OexgHg8XYc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687345353; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pnziWqeIZNrvl2O+xZ1w8A8qnxuxPCpJZgtJgpYEvPU=; b=EthIC3W/BETDoJ0qFd58aXLAEe6J6/tyoI3oud+epXosaZbJS4OnTDNuExvY52kNt+f1PJ Bqwubvsd0gJ7KkBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 13EF9134B1; Wed, 21 Jun 2023 11:02:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sCJfBMnYkmTMHgAAMHmgww (envelope-from ); Wed, 21 Jun 2023 11:02:33 +0000 Message-ID: <58279efe-141b-5d6b-b319-7bd1a0d5347d@suse.de> Date: Wed, 21 Jun 2023 13:02:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [RFC 3/4] block: set mapping order for the block cache in set_init_blocksize Content-Language: en-US To: Pankaj Raghav , willy@infradead.org, david@fromorbit.com Cc: gost.dev@samsung.com, mcgrof@kernel.org, hch@lst.de, jwong@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230621083823.1724337-1-p.raghav@samsung.com> <20230621083823.1724337-4-p.raghav@samsung.com> From: Hannes Reinecke In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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/21/23 12:42, Pankaj Raghav wrote: >>>       bdev->bd_inode->i_blkbits = blksize_bits(bsize); >>> +    order = bdev->bd_inode->i_blkbits - PAGE_SHIFT; >>> +    folio_order = mapping_min_folio_order(bdev->bd_inode->i_mapping); >>> + >>> +    if (!IS_ENABLED(CONFIG_BUFFER_HEAD)) { >>> +        /* Do not allow changing the folio order after it is set */ >>> +        WARN_ON_ONCE(folio_order && (folio_order != order)); >>> +        mapping_set_folio_orders(bdev->bd_inode->i_mapping, order, 31); >>> +    } >>>   } >>>     int set_blocksize(struct block_device *bdev, int size) >> This really has nothing to do with buffer heads. >> >> In fact, I've got a patchset to make it work _with_ buffer heads. >> >> So please, don't make it conditional on CONFIG_BUFFER_HEAD. >> >> And we should be calling into 'mapping_set_folio_order()' only if the 'order' argument is larger >> than PAGE_ORDER, otherwise we end up enabling >> large folio support for _every_ block device. >> Which I doubt we want. >> > > Hmm, which aops are you using for the block device? If you are using the old aops, then we will be > using helpers from buffer.c and mpage.c which do not support large folios. I am getting a BUG_ON > when I don't use iomap based aops for the block device: > I know. I haven't said that mpage.c / buffer.c support large folios _now_. All I'm saying is that I have a patchset enabling it to support large folios :-) Cheers, Hannes