Linux kernel staging patches
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Sumitra Sharma <sumitraartsy@gmail.com>,
	Forest Bond <forest@alittletooquiet.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<linux-staging@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Cc: Ira Weiny <ira.weiny@intel.com>, Fabio <fmdefrancesco@gmail.com>,
	"Deepak R Varma" <drv@mailo.com>,
	Sumitra Sharma <sumitraartsy@gmail.com>
Subject: Re: [PATCH] drivers/target: Call page_address() on page acquired with GFP_KERNEL flag
Date: Mon, 26 Jun 2023 13:22:22 -0700	[thread overview]
Message-ID: <6499f37e43ec9_75179294c3@iweiny-mobl.notmuch> (raw)
In-Reply-To: <20230614164454.GA390511@sumitra.com>

Sumitra Sharma wrote:
> rd_allocate_sgl_table() acquires a page with alloc_pages(GFP_KERNEL, 0).
> Pages allocated with GFP_KERNEL cannot come from Highmem. This is why
> there is no need to call kmap() on them.
> 
> Therefore, use a plain page_address() on that page.
> 
> Signed-off-by: Sumitra Sharma <sumitraartsy@gmail.com>

LGTM:

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  drivers/target/target_core_rd.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
> index 6648c1c90e19..d8ea6aff39a2 100644
> --- a/drivers/target/target_core_rd.c
> +++ b/drivers/target/target_core_rd.c
> @@ -159,9 +159,8 @@ static int rd_allocate_sgl_table(struct rd_dev *rd_dev, struct rd_dev_sg_table *
>  			sg_assign_page(&sg[j], pg);
>  			sg[j].length = PAGE_SIZE;
>  
> -			p = kmap(pg);
> +			p = page_address(pg);
>  			memset(p, init_payload, PAGE_SIZE);
> -			kunmap(pg);
>  		}
>  
>  		page_offset += sg_per_table;
> -- 
> 2.25.1
> 



      reply	other threads:[~2023-06-26 20:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14 16:44 [PATCH] drivers/target: Call page_address() on page acquired with GFP_KERNEL flag Sumitra Sharma
2023-06-26 20:22 ` Ira Weiny [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=6499f37e43ec9_75179294c3@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=drv@mailo.com \
    --cc=fmdefrancesco@gmail.com \
    --cc=forest@alittletooquiet.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=sumitraartsy@gmail.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