lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 29 Aug 2020 16:48:19 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     daejun7.park@...sung.com,
        "avri.altman@....com" <avri.altman@....com>,
        "jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
        "beanhuo@...ron.com" <beanhuo@...ron.com>,
        "stanley.chu@...iatek.com" <stanley.chu@...iatek.com>,
        "cang@...eaurora.org" <cang@...eaurora.org>,
        "tomas.winkler@...el.com" <tomas.winkler@...el.com>,
        ALIM AKHTAR <alim.akhtar@...sung.com>
Cc:     "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Sang-yoon Oh <sangyoon.oh@...sung.com>,
        Sung-Jun Park <sungjun07.park@...sung.com>,
        yongmyung lee <ymhungry.lee@...sung.com>,
        Jinyoung CHOI <j-young.choi@...sung.com>,
        Adel Choi <adel.choi@...sung.com>,
        BoRam Shin <boram.shin@...sung.com>
Subject: Re: [PATCH v9 3/4] scsi: ufs: L2P map management for HPB read

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.

Powered by blists - more mailing lists