From: "Jürgen Groß" <jgross@suse.com>
To: "Mike Rapoport (Microsoft)" <rppt@kernel.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: David Hildenbrand <david@kernel.org>,
Vlastimil Babka <vbabka@kernel.org>,
linux-mm@kvack.org, xen-devel@lists.xenproject.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] xen/events: replace page allocator calls with k[mz]alloc()
Date: Tue, 10 Nov 2026 08:25:59 +0100 [thread overview]
Message-ID: <b67abdc3-f234-49ce-b463-1e06e87eccf8@suse.com> (raw)
In-Reply-To: <20261110-b4-xen-v2-1-21ece28be7d4@kernel.org>
[-- Attachment #1.1: Type: text/plain, Size: 1394 bytes --]
On 10.11.26 08:14, Mike Rapoport (Microsoft) wrote:
> set_evtchn_to_irq() allocates a page for the event channel to IRQ
> number software lookup table and xen_init_IRQ() allocates the PIRQ EOI
> bitmap that is registered with the hypervisor in PV domains.
>
> These buffers can be allocated with kmalloc() as there's nothing special
> about them to go directly to the page allocator. The PIRQ EOI bitmap is
> passed to the hypervisor by its frame number and must occupy a whole
> page, which is guaranteed for a PAGE_SIZE kmalloc() allocation as it is
> naturally aligned.
>
> kmalloc() provides a better API that does not require ugly casts and
> kfree() does not need to know the size of the freed object.
>
> Performance difference between kmalloc() and __get_free_pages() is not
> measurable as both allocators take an object/page from a per-CPU list for
> fast path allocations.
>
> For the slow path the performance is anyway determined by the amount of
> reclaim involved rather than by what allocator is used.
>
> Replace use of __get_free_pages() with kmalloc(), __get_free_page() with
> __GFP_ZERO with kzalloc() and free_page[s]() with kfree().
>
> Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Juergen
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
prev parent reply other threads:[~2026-11-10 7:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 7:14 Mike Rapoport (Microsoft)
2026-11-10 7:25 ` Jürgen Groß [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=b67abdc3-f234-49ce-b463-1e06e87eccf8@suse.com \
--to=jgross@suse.com \
--cc=david@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=oleksandr_tyshchenko@epam.com \
--cc=rppt@kernel.org \
--cc=sstabellini@kernel.org \
--cc=vbabka@kernel.org \
--cc=xen-devel@lists.xenproject.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
all inboxes | Powered by JetHome®