mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: daejun7.park@samsung.com,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"asutoshd@codeaurora.org" <asutoshd@codeaurora.org>,
	"beanhuo@micron.com" <beanhuo@micron.com>,
	"stanley.chu@mediatek.com" <stanley.chu@mediatek.com>,
	"cang@codeaurora.org" <cang@codeaurora.org>,
	"tomas.winkler@intel.com" <tomas.winkler@intel.com>,
	ALIM AKHTAR <alim.akhtar@samsung.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Sang-yoon Oh <sangyoon.oh@samsung.com>,
	Sung-Jun Park <sungjun07.park@samsung.com>,
	yongmyung lee <ymhungry.lee@samsung.com>,
	Jinyoung CHOI <j-young.choi@samsung.com>,
	Adel Choi <adel.choi@samsung.com>,
	BoRam Shin <boram.shin@samsung.com>
Subject: Re: [PATCH v9 3/4] scsi: ufs: L2P map management for HPB read
Date: Sat, 29 Aug 2020 16:48:19 -0700	[thread overview]
Message-ID: <5587cf86-eeec-2c70-a47c-57149f00eb95@acm.org> (raw)
In-Reply-To: <1210830415.21598601302480.JavaMail.epsvc@epcpadp1>

On 2020-08-28 00:19, Daejun Park wrote:
> +static unsigned int ufshpb_host_map_kbytes = 1024;

A comment that explains where this value comes from would be welcome.

> +static struct ufshpb_req *ufshpb_get_map_req(struct ufshpb_lu *hpb,
> +					     struct ufshpb_subregion *srgn)
> +{
> +	struct ufshpb_req *map_req;
> +	struct request *req;
> +	struct bio *bio;
> +
> +	map_req = kmem_cache_alloc(hpb->map_req_cache, GFP_KERNEL);
> +	if (!map_req)
> +		return NULL;
> +
> +	req = blk_get_request(hpb->sdev_ufs_lu->request_queue,
> +			      REQ_OP_SCSI_IN, BLK_MQ_REQ_PREEMPT);

Why BLK_MQ_REQ_PREEMPT? Since this code is only executed while medium access
commands are processed and since none of these commands have the PREEMPT flag
set I think that the PREEMPT flag should be left out. Otherwise there probably
will be weird interactions with runtime suspended devices.

Is it acceptable that the above blk_get_request() call blocks if a UFS device
has been runtime suspended? If not, consider using the flag BLK_MQ_REQ_NOWAIT
instead.

> +	bio = bio_alloc(GFP_KERNEL, hpb->pages_per_srgn);
> +	if (!bio) {
> +		blk_put_request(req);
> +		goto free_map_req;
> +	}

If the blk_get_request() would be modified such that it doesn't wait, this
call may have to be modified too (GFP_NOWAIT?).

> +	if (rgn->rgn_state == HPB_RGN_INACTIVE) {
> +		if (atomic_read(&lru_info->active_cnt)
> +		    == lru_info->max_lru_active_cnt) {

When splitting a line, please put comparison operators at the end of the line
instead of at the start, e.g. as follows:

		if (atomic_read(&lru_info->active_cnt) ==
		    lru_info->max_lru_active_cnt) {

> +	pool_size = DIV_ROUND_UP(ufshpb_host_map_kbytes * 1024, PAGE_SIZE);

Please use PAGE_ALIGN() to align to the next page boundary.

Thanks,

Bart.

  reply	other threads:[~2020-08-29 23:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200828070950epcms2p5470bd43374be18d184dd802da09e73c8@epcms2p5>
2020-08-28  7:09 ` [PATCH v9 0/4] scsi: ufs: Add Host Performance Booster Support Daejun Park
     [not found]   ` <CGME20200828070950epcms2p5470bd43374be18d184dd802da09e73c8@epcms2p2>
2020-08-28  7:18     ` [PATCH v9 2/4] scsi: ufs: Introduce HPB feature Daejun Park
2020-08-29 22:58       ` Bart Van Assche
     [not found]       ` <CGME20200828070950epcms2p5470bd43374be18d184dd802da09e73c8@epcms2p3>
2020-09-01  0:24         ` Daejun Park
     [not found]   ` <CGME20200828070950epcms2p5470bd43374be18d184dd802da09e73c8@epcms2p6>
2020-08-28  7:17     ` [PATCH v9 1/4] scsi: ufs: Add HPB feature related parameters Daejun Park
2020-08-29 23:11       ` Bart Van Assche
2020-08-28  7:19     ` [PATCH v9 3/4] scsi: ufs: L2P map management for HPB read Daejun Park
2020-08-29 23:48       ` Bart Van Assche [this message]
2020-08-28  7:19     ` [PATCH v9 4/4] scsi: ufs: Prepare HPB read for cached sub-region Daejun Park
2020-08-29 23:54       ` Bart Van Assche
2020-09-01  0:21 ` [PATCH v9 3/4] scsi: ufs: L2P map management for HPB read Daejun Park

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=5587cf86-eeec-2c70-a47c-57149f00eb95@acm.org \
    --to=bvanassche@acm.org \
    --cc=adel.choi@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=boram.shin@samsung.com \
    --cc=cang@codeaurora.org \
    --cc=daejun7.park@samsung.com \
    --cc=j-young.choi@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sangyoon.oh@samsung.com \
    --cc=stanley.chu@mediatek.com \
    --cc=sungjun07.park@samsung.com \
    --cc=tomas.winkler@intel.com \
    --cc=ymhungry.lee@samsung.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

all inboxes | Powered by JetHome®