Re: [RFC 3/4] block: set mapping order for the block cache in set_init_blocksize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux