From: Baoquan He <bhe@redhat.com>
To: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Matthew Wilcox <willy@infradead.org>,
Ira Weiny <ira.weiny@intel.com>
Subject: Re: [PATCH] mm/highmem: Delete memmove_page()
Date: Mon, 6 Jun 2022 22:43:06 +0800 [thread overview]
Message-ID: <Yp4SepU4T5FehMsy@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20220606141533.555-1-fmdefrancesco@gmail.com>
On 06/06/22 at 04:15pm, Fabio M. De Francesco wrote:
> Matthew Wilcox reported that, while he was looking at memmove_page(), he
> realized that it can't actually work.
>
> The reasons are hidden in its implementation, which makes use of
> memmove() on logical addresses provided by kmap_local_page(). memmove()
> does the wrong thing when it tests "if (dest <= src)".
>
> Therefore, delete memmove_page().
>
> No need to change any other code because we have no call sites of
> memmove_page() across the whole kernel.
Nice clean up.
Reviewed-by: Baoquan He <bhe@redhat.com>
>
> Reported-by: Matthew Wilcox <willy@infradead.org>
> Cc: Ira Weiny <ira.weiny@intel.com>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
> include/linux/highmem.h | 13 -------------
> 1 file changed, 13 deletions(-)
>
> diff --git a/include/linux/highmem.h b/include/linux/highmem.h
> index 3af34de54330..fee9835e3793 100644
> --- a/include/linux/highmem.h
> +++ b/include/linux/highmem.h
> @@ -336,19 +336,6 @@ static inline void memcpy_page(struct page *dst_page, size_t dst_off,
> kunmap_local(dst);
> }
>
> -static inline void memmove_page(struct page *dst_page, size_t dst_off,
> - struct page *src_page, size_t src_off,
> - size_t len)
> -{
> - char *dst = kmap_local_page(dst_page);
> - char *src = kmap_local_page(src_page);
> -
> - VM_BUG_ON(dst_off + len > PAGE_SIZE || src_off + len > PAGE_SIZE);
> - memmove(dst + dst_off, src + src_off, len);
> - kunmap_local(src);
> - kunmap_local(dst);
> -}
> -
> static inline void memset_page(struct page *page, size_t offset, int val,
> size_t len)
> {
> --
> 2.36.1
>
>
next prev parent reply other threads:[~2022-06-06 14:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-06 14:15 Fabio M. De Francesco
2022-06-06 14:43 ` Baoquan He [this message]
2022-06-06 14:58 ` Ira Weiny
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=Yp4SepU4T5FehMsy@MiWiFi-R3L-srv \
--to=bhe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=fmdefrancesco@gmail.com \
--cc=ira.weiny@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
/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