public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: Bart Van Assche <bvanassche@acm.org>,
	"yohan.joung@sk.com" <yohan.joung@sk.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Avri Altman <avri.altman@wdc.com>, Bean Huo <beanhuo@micron.com>,
	Stanley Chu <stanley.chu@mediatek.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Matthias Brugger <matthias.bgg@gmail.com>
Subject: Re: [PATCH v3] scsi: ufs: Increase the maximum data buffer size
Date: Thu, 15 Sep 2022 12:56:53 +0200	[thread overview]
Message-ID: <cf7cc030524bc25be4a69df7508f79f76d0ba052.camel@gmail.com> (raw)
In-Reply-To: <5a293aef-80da-1130-b11d-d556828a6bf8@acm.org>

On Tue, 2022-09-06 at 11:04 -0700, Bart Van Assche wrote:
> 
> Hi Bean,
> 
> It seems to me that the block layer only uses the optimal transfer
> size 
> (io_opt) to determine how much data to read ahead during sequential 
> reads? See also disk_update_readahead().
> 

Bart,
Sorry for later reply, Didn't notice a question here. 

In the upstream standard Linux kernel, if the device supports a valid
VPD, I think, your this change will also not change the read-ahead
window.

....

sdkp->opt_xfer_blocks = get_unaligned_be32(&vpd->data[12]);


sd_revalidate_disk() {

...
 if (sd_validate_opt_xfer_size(sdkp, dev_max)) {
     q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks);
     rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks);
 }	
...
}


device_add_disk()
	 disk_update_readahead(disk) {
		disk->bdi->ra_pages =
		max(queue_io_opt(q) * 2 / PAGE_SIZE,
VM_READAHEAD_PAGES); 
	}

e.g., if device reports opt 512KB, and the maximum transfer length will
be 512KB, and readahead window will be 1MB.


Kind regards,
Bean


      reply	other threads:[~2022-09-15 10:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 22:52 [PATCH v3] scsi: ufs: Increase the maximum data buffer size Bart Van Assche
2022-07-27  5:06 ` Avri Altman
2022-08-01 23:28 ` Martin K. Petersen
2022-08-02 23:40 ` 정요한(JOUNG YOHAN) Mobile SE
2022-08-03 16:23   ` Bart Van Assche
2022-08-04  1:50     ` 정요한(JOUNG YOHAN) Mobile SE
2022-08-04 17:48       ` Bart Van Assche
2022-08-05  1:54         ` 정요한(JOUNG YOHAN) Mobile SE
2022-09-02 14:52     ` Bean Huo
2022-09-06 18:04       ` Bart Van Assche
2022-09-15 10:56         ` Bean Huo [this message]

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=cf7cc030524bc25be4a69df7508f79f76d0ba052.camel@gmail.com \
    --to=huobean@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=jaegeuk@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=stanley.chu@mediatek.com \
    --cc=yohan.joung@sk.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox