From: Mike Rapoport <rppt@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 1/2] usb: host: ohci-dbg: use kmalloc() for print buffer
Date: Wed, 1 Jul 2026 17:02:11 +0300 [thread overview]
Message-ID: <akUd4xYXowxLEd5s@kernel.org> (raw)
In-Reply-To: <4aa114fd-ec0e-4e7c-ab9c-6e9a327b3cfa@rowland.harvard.edu>
On Wed, Jul 01, 2026 at 09:52:42AM -0400, Alan Stern wrote:
> On Wed, Jul 01, 2026 at 12:41:50PM +0300, Mike Rapoport (Microsoft) wrote:
> > ochi-dbg allocates buffers for formatting of various dump outputs.
> >
> > These buffers can be allocated with kmalloc() as there's nothing special
> > about them to go directly to the page allocator.
> >
> > 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_zeroed_page() with kzalloc() and free_page() with
> > kfree().
> >
> > While on it, drop the NULL checks in debug_close(). buf is never NULL
> > here because all the open handlers return -ENOMEM when alloc_buffer()
> > fails, and kfree() can handle a NULL buf->page.
> >
> > Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
> > Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> > ---
>
> Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Thanks!
> Incidentally, I filtered it out of my reply this time, but on this and
> previous submissions you have a CC: entry that says <rpppt@kernel.org>,
> which is an invalid address (three 'p's instead of two). Is there a
> typo in one of your scripts or settings? It's a little surprising that
> you aren't constantly getting email error messages every time you send
> something out.
I'm gradually switching to b4 send and this looks like off-by-one in my
manual editing of the addresses.
> Alan Stern
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2026-07-01 14:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 9:41 [PATCH v2 0/2] USB: replace __get_free_pages() with kmalloc() Mike Rapoport (Microsoft)
2026-07-01 9:41 ` [PATCH v2 1/2] usb: host: ohci-dbg: use kmalloc() for print buffer Mike Rapoport (Microsoft)
2026-07-01 13:52 ` Alan Stern
2026-07-01 14:02 ` Mike Rapoport [this message]
2026-07-01 9:41 ` [PATCH v2 2/2] usb: core: devices: use kmalloc() to allocate dump buffer Mike Rapoport (Microsoft)
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=akUd4xYXowxLEd5s@kernel.org \
--to=rppt@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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