All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	jyescas@google.com, Ming Lei <ming.lei@redhat.com>,
	Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH v5 3/9] block: Support configuring limits below the page size
Date: Sat, 27 May 2023 09:20:30 -0700	[thread overview]
Message-ID: <62e672ad-be3a-2ce8-ee11-c9682ab7d21d@acm.org> (raw)
In-Reply-To: <ZHF2Hbv5qBJl9CZl@bombadil.infradead.org>

On 5/26/23 20:16, Luis Chamberlain wrote:
> So I see this as a critical fix too. And it gets me wondering what has
> happened for 512 byte controllers on 4K PAGE_SIZE?

What is a "512 byte controller"? Most storage controllers I'm familiar 
with support DMA segments well above 4 KiB.

>> @@ -126,6 +173,11 @@ void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_secto
>>   	unsigned int min_max_hw_sectors = PAGE_SIZE >> SECTOR_SHIFT;
>>   	unsigned int max_sectors;
>>   
>> +	if (max_hw_sectors < min_max_hw_sectors) {
>> +		blk_enable_sub_page_limits(limits);
>> +		min_max_hw_sectors = 1;
>> +	}
>> +
>>   	if (max_hw_sectors < min_max_hw_sectors) {
>>   		max_hw_sectors = min_max_hw_sectors;
>>   		pr_info("%s: set to minimum %u\n", __func__, max_hw_sectors);
> 
> It would seem like max_dev_sectors would have saved the day too,
> but that is said to be set by the "disk" on the documentation.
> I see scsi/sd.c and drivers/s390/block/dasd_*.c set this too,
> is that a layering violation, or was that to help perhaps with
> similar problems? If not could stroage controller have used this
> for this issue as well?

min_not_zero(max_hw_sectors, max_dev_sectors) is the maximum transfer 
size used by the block layer. max_hw_sectors typically represents the 
transfer limit of the DMA controller and max_dev_sectors typically 
represents the transfer limit of the storage device. If e.g. a RAID 
controller exists between the host and the storage devices these limits 
can be different.

> Could the documentation for blk_queue_max_hw_sectors() be enhanced to
> clarify this?

I will look into this.

> The way I'm thinking about this is, if this is a fix for stable too,
> what would a minimum safe stable fix be like? And then after whatever
> we need to make it better (non stable fixes).

Hmm ... doesn't the "upstream first" rule apply to stable kernels? 
Shouldn't only patches land in stable kernels that are already upstream 
instead of applying different patches on stable kernels?

Thanks,

Bart.

  reply	other threads:[~2023-05-27 16:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22 22:25 [PATCH v5 0/9] Support limits below the page size Bart Van Assche
2023-05-22 22:25 ` [PATCH v5 1/9] block: Use pr_info() instead of printk(KERN_INFO ...) Bart Van Assche
2023-05-22 23:10   ` Luis Chamberlain
2023-05-27 16:09     ` Bart Van Assche
2023-05-22 22:25 ` [PATCH v5 2/9] block: Prepare for supporting sub-page limits Bart Van Assche
2023-05-22 23:26   ` Luis Chamberlain
2023-05-22 22:25 ` [PATCH v5 3/9] block: Support configuring limits below the page size Bart Van Assche
2023-05-27  3:16   ` Luis Chamberlain
2023-05-27 16:20     ` Bart Van Assche [this message]
2023-05-28 20:33       ` Luis Chamberlain
2023-05-28 22:32         ` Bart Van Assche
2023-05-31  5:40           ` Luis Chamberlain
2023-05-22 22:25 ` [PATCH v5 4/9] block: Make sub_page_limit_queues available in debugfs Bart Van Assche
2023-05-27  3:17   ` Luis Chamberlain
2023-05-22 22:25 ` [PATCH v5 5/9] block: Support submitting passthrough requests with small segments Bart Van Assche
2023-05-22 22:25 ` [PATCH v5 6/9] block: Add support for filesystem requests and " Bart Van Assche
2023-05-22 22:25 ` [PATCH v5 7/9] block: Add support for small segments in blk_rq_map_user_iov() Bart Van Assche
2023-05-22 22:25 ` [PATCH v5 8/9] scsi_debug: Support configuring the maximum segment size Bart Van Assche
2023-05-24 20:50   ` Douglas Gilbert
2023-05-22 22:25 ` [PATCH v5 9/9] null_blk: " Bart Van Assche
2023-06-09 17:14 ` [PATCH v5 0/9] Support limits below the page size Sandeep Dhavale
2023-06-12 18:15   ` Bart Van Assche
2023-06-12 18:34     ` Sandeep Dhavale

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=62e672ad-be3a-2ce8-ee11-c9682ab7d21d@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=jyescas@google.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=ming.lei@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.