Linux-fbdev Archive mirror
 help / color / mirror / Atom feed
From: Nam Cao <namcao@linutronix.de>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jaya Kumar <jayalk@intworks.biz>, Daniel Vetter <daniel@ffwll.ch>,
	Helge Deller <deller@gmx.de>,
	Javier Martinez Canillas <javierm@redhat.com>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, tiwai@suse.de,
	bigeasy@linutronix.de, patrik.r.jakobsson@gmail.com,
	Vegard Nossum <vegard.nossum@oracle.com>,
	George Kennedy <george.kennedy@oracle.com>,
	Darren Kenny <darren.kenny@oracle.com>,
	chuansheng.liu@intel.com,
	Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] fbdev: fix incorrect address computation in deferred IO
Date: Tue, 23 Apr 2024 13:39:33 +0200	[thread overview]
Message-ID: <20240423113933.IpMjHGw7@linutronix.de> (raw)
In-Reply-To: <64c1585d-70e0-47d4-9d78-405b483b433c@suse.de>

On Tue, Apr 23, 2024 at 01:27:09PM +0200, Thomas Zimmermann wrote:
> Am 23.04.24 um 11:55 schrieb Nam Cao:
...
> > > The page-fault handler at [1] use vm_fault.pgoff to retrieve the page
> > > structure. Can we do the same here and avoid that computation?
> > Yes, thanks for the suggestion.
> > 
> > It will change things a bit: offset will not be the exact value anymore,
> > but will be rounded down to multiple of PAGE_SIZE. But that doesn't matter,
> > because it will only be used to calculate the page offset later on.
> > 
> > We can clean this up and rename this "offset" to "pg_offset". But that's
> > for another day.
> 
> But can't we use struct vm_fault.pgoff directly? The page-fault handler has
> used it since forever. The look-up code for the pageref should probably do
> the same, because there's a 1:1 connection between the page and the pageref.
> The pageref structure only exists because we cannot store its data in struct
> page directly.
> 
> AFAICT pgoff is exactly the value want to compute. See [1] and  the
> calculation at [2].

Completely agree. I just wanted to point out that the value inside the
variable "offset" won't be the same as before, but it's still correct.

I just tested the patch on real hardware, will send it shortly.

Best regards,
Nam

      reply	other threads:[~2024-04-23 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 19:00 [PATCH] fbdev: fix incorrect address computation in deferred IO Nam Cao
2024-04-23  8:37 ` Thomas Zimmermann
2024-04-23  9:55   ` Nam Cao
2024-04-23 11:27     ` Thomas Zimmermann
2024-04-23 11:39       ` Nam Cao [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=20240423113933.IpMjHGw7@linutronix.de \
    --to=namcao@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=chuansheng.liu@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=darren.kenny@oracle.com \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=george.kennedy@oracle.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=javierm@redhat.com \
    --cc=jayalk@intworks.biz \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patrik.r.jakobsson@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.de \
    --cc=tzimmermann@suse.de \
    --cc=vegard.nossum@oracle.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).