mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Boris Brezillon <boris.brezillon@collabora.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>
Cc: Pedro Demarchi Gomes <pedrodemargomes@gmail.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] drm/shmem-helper: Fix Map huge page mapping in fault handler
Date: Mon, 16 Mar 2026 11:12:45 +0100	[thread overview]
Message-ID: <f162dafb-4282-41db-a696-b993de875736@suse.de> (raw)
In-Reply-To: <20260316102810.7b26c5ec@fedora>

Hi

Am 16.03.26 um 10:28 schrieb Boris Brezillon:
[...]
>>> -static vm_fault_t drm_gem_shmem_fault(struct vm_fault *vmf)
>>> +static vm_fault_t drm_gem_shmem_any_fault(struct vm_fault *vmf, bool try_pmd)
>> Please write two functions. One for huge pages and one for regular page
>> faults.
> That's actually what the first version of the patch was doing, and I
> strongly disagree with that. In my opinion, it's more error-prone to
> have two distinct implementations duplicating most of the logic
> (locking, bookkeeping, ...) than having both handled in the same
> function and have dummy wrappers to decide the kind of vmf_insert_pfn
> to do (_pmd vs regular). Think about the folio_mark_accessed() you
> recently added, and how easy it would have been to add it to
> drm_gem_shmem_fault() and forget it in the huge_fault handler.

But that would be a _simple_ one-time fix.  All these branching any 
parameterization will stay for _all_ later changes to that code.

There's little to be gained from cramming things into single functions. 
I'd say that we have two distinct fault callbacks for huge pages and 
regular ones already support this point.

Best regards
Thomas


-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



  reply	other threads:[~2026-03-16 10:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16  0:26 Pedro Demarchi Gomes
2026-03-16  9:14 ` Thomas Zimmermann
2026-03-16  9:28   ` Boris Brezillon
2026-03-16 10:12     ` Thomas Zimmermann [this message]
2026-03-16 10:42       ` Boris Brezillon
2026-03-16  9:50 ` Boris Brezillon
2026-03-16 10:14   ` Thomas Zimmermann
2026-03-16 10:36     ` Boris Brezillon
2026-03-16 12:10       ` Thomas Zimmermann
2026-03-16 13:20         ` Boris Brezillon
2026-03-16 10:03 ` Boris Brezillon
2026-03-16 14:21 ` Boris Brezillon
2026-03-17 17:30   ` Boris Brezillon
2026-03-18 10:16     ` Boris Brezillon
2026-03-18 11:14       ` Pedro Demarchi Gomes
2026-03-18 11:45         ` Boris Brezillon

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=f162dafb-4282-41db-a696-b993de875736@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=pedrodemargomes@gmail.com \
    --cc=simona@ffwll.ch \
    /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®