From: Brendan Shephard <bshephar@bne-home.net>
To: Danilo Krummrich <dakr@kernel.org>
Cc: acourbot@nvidia.com, aliceryhl@google.com, joelagnelf@nvidia.com,
airlied@redhat.com, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v5] drm/nova: Align GEM memory allocation to system page size
Date: Wed, 24 Dec 2025 11:58:02 +1000 [thread overview]
Message-ID: <aUtIqv1UfXbh7qQ4@fedora> (raw)
In-Reply-To: <DF5VBOI4LSTZ.5O2XJRIFMK3S@kernel.org>
On Tue, Dec 23, 2025 at 09:11:36PM +0100, Danilo Krummrich wrote:
> On Tue Dec 23, 2025 at 2:59 PM CET, Brendan Shephard wrote:
> > @@ -31,14 +28,12 @@ fn new(_dev: &NovaDevice, _size: usize) -> impl PinInit<Self, Error> {
> > impl NovaObject {
> > /// Create a new DRM GEM object.
> > pub(crate) fn new(dev: &NovaDevice, size: usize) -> Result<ARef<gem::Object<Self>>> {
> > - // Check for 0 size or potential usize overflow before calling page_align
> > - if size == 0 || size > usize::MAX - PAGE_SIZE + 1 {
> > + if size == 0 {
> > return Err(EINVAL);
> > }
> > -
> > - let aligned_size = page_align(size);
> > -
> > - gem::Object::new(dev, aligned_size)
> > + page_align(size)
> > + .ok_or(EINVAL)
> > + .and_then(|size| gem::Object::new(dev, size))
> > }
> >
> > /// Look up a GEM object handle for a `File` and return an `ObjectRef` for it.
> >
> > base-commit: b927546677c876e26eba308550207c2ddf812a43
> > prerequisite-patch-id: 7154ef17c3e40275152c90eff07bffcb5ef5e5cb
>
> This looks like this is an incremental patch on top of some previous version of
> this one.
>
> However, in this case I don't think there is a need to resend, since I prefer v4
> over this one. Eventually we will need to use size (or aligned_size) outside of
> the closure for further calculations.
>
> I will pick up v4 of this patch, no need to resend, thanks!
>
Hey Danilo,
Thanks, no worries, happy for you to take v4. I did build it
against your repo as well and there were no conflicts at the time. Just
the prereq patch to page_align and it was nice and clean.
Have a great holiday mate!
Brendan
prev parent reply other threads:[~2025-12-24 1:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 13:59 [PATCH v5] drm/nova: Align GEM memory allocation to system page size Brendan Shephard
2025-12-23 20:11 ` Danilo Krummrich
2025-12-24 1:58 ` Brendan Shephard [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=aUtIqv1UfXbh7qQ4@fedora \
--to=bshephar@bne-home.net \
--cc=acourbot@nvidia.com \
--cc=airlied@redhat.com \
--cc=aliceryhl@google.com \
--cc=dakr@kernel.org \
--cc=joelagnelf@nvidia.com \
--cc=rust-for-linux@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.