From: Jiri Slaby <jirislaby@kernel.org>
To: Mike Rapoport <rppt@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Brendan Jackman <jackmanb@google.com>,
David Hildenbrand <david@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Julia Lawall <Julia.Lawall@inria.fr>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Michal Hocko <mhocko@suse.com>,
Suren Baghdasaryan <surenb@google.com>,
Vlastimil Babka <vbabka@suse.cz>, Zi Yan <ziy@nvidia.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/3] mm, vc_screen: move __free() handler that frees a page to a common header
Date: Sat, 18 Oct 2025 19:59:38 +0200 [thread overview]
Message-ID: <e0d09eb8-a53f-4dce-a858-8852cf8695d2@kernel.org> (raw)
In-Reply-To: <20251018093002.3660549-2-rppt@kernel.org>
On 18. 10. 25, 11:30, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
>
> vc_screen defines __free() handler that frees a page using free_page().
> Move that definition to include/linux/gfp.h next to free_page() and
> rename it from free_page_ptr to free_page.
>
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> drivers/tty/vt/vc_screen.c | 6 ++----
> include/linux/gfp.h | 2 ++
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
> index c814644ef4ee..d2029f029de6 100644
> --- a/drivers/tty/vt/vc_screen.c
> +++ b/drivers/tty/vt/vc_screen.c
> @@ -53,8 +53,6 @@
> #define HEADER_SIZE 4u
> #define CON_BUF_SIZE (IS_ENABLED(CONFIG_BASE_SMALL) ? 256 : PAGE_SIZE)
>
> -DEFINE_FREE(free_page_ptr, void *, if (_T) free_page((unsigned long)_T));
> -
> /*
> * Our minor space:
> *
> @@ -371,7 +369,7 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
> loff_t pos;
> bool viewed, attr, uni_mode;
>
> - char *con_buf __free(free_page_ptr) = (char *)__get_free_page(GFP_KERNEL);
> + char *con_buf __free(free_page) = (char *)__get_free_page(GFP_KERNEL);
> if (!con_buf)
> return -ENOMEM;
>
> @@ -596,7 +594,7 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
> if (use_unicode(inode))
> return -EOPNOTSUPP;
>
> - char *con_buf __free(free_page_ptr) = (char *)__get_free_page(GFP_KERNEL);
> + char *con_buf __free(free_page) = (char *)__get_free_page(GFP_KERNEL);
> if (!con_buf)
> return -ENOMEM;
>
> diff --git a/include/linux/gfp.h b/include/linux/gfp.h
> index f46b066c7661..ee3f27046667 100644
> --- a/include/linux/gfp.h
> +++ b/include/linux/gfp.h
> @@ -385,6 +385,8 @@ extern void free_pages(unsigned long addr, unsigned int order);
> #define __free_page(page) __free_pages((page), 0)
> #define free_page(addr) free_pages((addr), 0)
>
> +DEFINE_FREE(free_page, unsigned long, if (!IS_ERR_OR_NULL(_T)) free_page(_T));
This IMO breaks the build at this point, right? Makes sense after 3/3,
though.
--
js
suse labs
next prev parent reply other threads:[~2025-10-18 17:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-18 9:29 [PATCH 0/3] mm: treewide: make get_free_pages() and return void * Mike Rapoport
2025-10-18 9:30 ` [PATCH 1/3] mm, vc_screen: move __free() handler that frees a page to a common header Mike Rapoport
2025-10-18 17:59 ` Jiri Slaby [this message]
2025-10-18 9:30 ` [PATCH 2/3] mm, treewide: make get_free_pages() and friends return void * Mike Rapoport
2025-10-18 9:30 ` [PATCH 3/3] mm, treewide: make addr parameter of free_pages() " Mike Rapoport
2025-10-19 0:30 ` [PATCH 0/3] mm: treewide: make get_free_pages() and return " Matthew Wilcox
2025-10-19 14:25 ` Mike Rapoport
2025-10-20 8:54 ` Vlastimil Babka
2025-10-20 9:04 ` Jiri Slaby
2025-10-20 14:22 ` Mike Rapoport
2025-10-20 9:06 ` David Hildenbrand
2025-10-20 14:20 ` Mike Rapoport
2025-10-20 6:58 ` Jiri Slaby
2025-10-20 7:06 ` Jiri Slaby
2025-10-20 9:02 ` David Hildenbrand
2025-10-20 9:08 ` Jiri Slaby
2025-10-20 9:13 ` David Hildenbrand
2025-10-20 10:31 ` Vlastimil Babka
2025-10-20 11:21 ` David Hildenbrand
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=e0d09eb8-a53f-4dce-a858-8852cf8695d2@kernel.org \
--to=jirislaby@kernel.org \
--cc=Julia.Lawall@inria.fr \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=ziy@nvidia.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