linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Kexin Sun <kexinsun@smail.nju.edu.cn>
Cc: kees@kernel.org, tony.luck@intel.com, gpiccoli@igalia.com,
	urezki@gmail.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, julia.lawall@inria.fr, xutong.ma@inria.fr,
	yunbolyu@smu.edu.sg, ratnadiraw@smu.edu.sg
Subject: Re: [PATCH] mm: vmalloc: update outdated comment for renamed vread()
Date: Thu, 26 Mar 2026 23:32:22 -0700	[thread overview]
Message-ID: <20260326233222.a74ea3c13fce2acfa1d37e37@linux-foundation.org> (raw)
In-Reply-To: <20260321105820.7134-1-kexinsun@smail.nju.edu.cn>

On Sat, 21 Mar 2026 18:58:20 +0800 Kexin Sun <kexinsun@smail.nju.edu.cn> wrote:

> The function vread() was renamed to vread_iter() in commit
> 4c91c07c93bb ("mm: vmalloc: convert vread() to vread_iter()"),
> converting from a buffer-based to an iterator-based interface.
> 
> Update the kdoc of vread_iter() to reflect the new interface:
> replace references to @buf with @iter, drop the stale "kernel's
> buffer" requirement, and update the self-reference from vread()
> to vread_iter().
> 
> Also update the stale vread() reference in pstore's ram_core.c.
> 

LGTM, thanks.

> 
> diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
> index ed97494abf60..738283a85ea2 100644
> --- a/fs/pstore/ram_core.c
> +++ b/fs/pstore/ram_core.c
> @@ -450,7 +450,7 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size,
>  		pages[i] = pfn_to_page(addr >> PAGE_SHIFT);
>  	}
>  	/*
> -	 * VM_IOREMAP used here to bypass this region during vread()
> +	 * VM_IOREMAP used here to bypass this region during vread_iter()
>  	 * and kmap_atomic() (i.e. kcore) to avoid __va() failures.
>  	 */
>  	vaddr = vmap(pages, page_count, VM_MAP | VM_IOREMAP, prot);
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 61caa55a4402..9ee256884f78 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -4575,20 +4575,20 @@ static size_t vmap_ram_vread_iter(struct iov_iter *iter, const char *addr,
>   * @count:        number of bytes to be read.
>   *
>   * This function checks that addr is a valid vmalloc'ed area, and
> - * copy data from that area to a given buffer. If the given memory range
> + * copy data from that area to a given iterator. If the given memory range

I'll sneak-edit this to read "copies data".

>   * of [addr...addr+count) includes some valid address, data is copied to
> - * proper area of @buf. If there are memory holes, they'll be zero-filled.
> + * proper area of @iter. If there are memory holes, they'll be zero-filled.
>   * IOREMAP area is treated as memory hole and no copy is done.
>   *
>   * If [addr...addr+count) doesn't includes any intersects with alive
> - * vm_struct area, returns 0. @buf should be kernel's buffer.
> + * vm_struct area, returns 0.
>   *
> - * Note: In usual ops, vread() is never necessary because the caller
> + * Note: In usual ops, vread_iter() is never necessary because the caller
>   * should know vmalloc() area is valid and can use memcpy().
>   * This is for routines which have to access vmalloc area without
>   * any information, as /proc/kcore.
>   *
> - * Return: number of bytes for which addr and buf should be increased
> + * Return: number of bytes for which addr and iter should be advanced
>   * (same number as @count) or %0 if [addr...addr+count) doesn't
>   * include any intersection with valid vmalloc area
>   */

Things like `addr' and `count' should be `@addr' and `@count', but
that's a differnt patch.  And we probably make this mistake in a
zillion other places.



      reply	other threads:[~2026-03-27  6:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-21 10:58 Kexin Sun
2026-03-27  6:32 ` Andrew Morton [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=20260326233222.a74ea3c13fce2acfa1d37e37@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=gpiccoli@igalia.com \
    --cc=julia.lawall@inria.fr \
    --cc=kees@kernel.org \
    --cc=kexinsun@smail.nju.edu.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ratnadiraw@smu.edu.sg \
    --cc=tony.luck@intel.com \
    --cc=urezki@gmail.com \
    --cc=xutong.ma@inria.fr \
    --cc=yunbolyu@smu.edu.sg \
    /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