The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Pankaj Raghav <p.raghav@samsung.com>
To: Hannes Reinecke <hare@suse.de>, <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>
Subject: Re: [RFC 3/4] block: set mapping order for the block cache in set_init_blocksize
Date: Wed, 21 Jun 2023 12:42:45 +0200	[thread overview]
Message-ID: <d275b49a-b6be-a08f-cfd8-d213eb452dd1@samsung.com> (raw)
In-Reply-To: <a25eb5ce-b71c-2a38-d8eb-f8de8b8b449e@suse.de>

>>       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:

[   11.596239] kernel BUG at fs/buffer.c:2384!


[   11.596609] invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
[   11.597064] CPU: 3 PID: 10 Comm: kworker/u8:0 Not tainted
6.4.0-rc7-next-20230621-00010-g87171074c649-dirty #183
[   11.597934] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014


[   11.598882] Workqueue: nvme-wq nvme_scan_work [nvme_core]
[   11.599370] RIP: 0010:block_read_full_folio+0x70d/0x8f0

Let me know what you think!

> Cheers,
> 
> Hannes
> 
> 

  reply	other threads:[~2023-06-21 10:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230621083825eucas1p1b05a6d7e0bf90e7a3d8e621f6578ff0a@eucas1p1.samsung.com>
2023-06-21  8:38 ` [RFC 0/4] minimum folio order support in filemap Pankaj Raghav
2023-06-21  8:38   ` [RFC 1/4] fs: Allow fine-grained control of folio sizes Pankaj Raghav
2023-06-21  9:02     ` Hannes Reinecke
2023-06-21  8:38   ` [RFC 2/4] filemap: use minimum order while allocating folios Pankaj Raghav
2023-06-21  8:59     ` Hannes Reinecke
2023-06-21 10:25       ` Pankaj Raghav
2023-06-21  8:38   ` [RFC 3/4] block: set mapping order for the block cache in set_init_blocksize Pankaj Raghav
2023-06-21  9:05     ` Hannes Reinecke
2023-06-21 10:42       ` Pankaj Raghav [this message]
2023-06-21 11:02         ` Hannes Reinecke
2023-06-21 12:02           ` Pankaj Raghav
2023-06-24  8:35     ` kernel test robot
2023-06-21  8:38   ` [RFC 4/4] nvme: enable logical block size > PAGE_SIZE Pankaj Raghav
2023-06-21  9:07     ` Hannes Reinecke
2023-06-21 10:47       ` Pankaj Raghav
2023-06-21  9:00   ` [RFC 0/4] minimum folio order support in filemap Hannes Reinecke
2023-06-21 22:07     ` Dave Chinner
2023-06-22  5:51       ` Hannes Reinecke
2023-06-22  6:50         ` Hannes Reinecke
2023-06-22 10:20           ` Dave Chinner
2023-06-22 10:23             ` Hannes Reinecke
2023-06-22 22:33               ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d275b49a-b6be-a08f-cfd8-d213eb452dd1@samsung.com \
    --to=p.raghav@samsung.com \
    --cc=david@fromorbit.com \
    --cc=gost.dev@samsung.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jwong@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox