From: Thomas Zimmermann <tzimmermann@suse.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-fbdev@vger.kernel.org, deller@gmx.de,
linux-staging@lists.linux.dev, bernie@plugable.com,
dri-devel@lists.freedesktop.org, javierm@redhat.com,
noralf@tronnes.org, andriy.shevchenko@linux.intel.com,
jayalk@intworks.biz
Subject: Re: [PATCH 2/2] fbdev: Don't sort deferred-I/O pages by default
Date: Mon, 14 Feb 2022 14:29:46 +0100 [thread overview]
Message-ID: <4a0697de-52db-97e7-d528-c7e2fe000e66@suse.de> (raw)
In-Reply-To: <CAMuHMdWPw8UcTVown3Zghxn11-WuqSBNCWKpP3T5NUxxZmntcA@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2520 bytes --]
Hi
Am 14.02.22 um 10:05 schrieb Geert Uytterhoeven:
> Hi Thomas,
>
> On Mon, Feb 14, 2022 at 9:28 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>> Am 14.02.22 um 09:05 schrieb Geert Uytterhoeven:
>>> On Thu, Feb 10, 2022 at 4:24 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>>> Fbdev's deferred I/O sorts all dirty pages by default, which incurs a
>>>> significant overhead. Make the sorting step optional and update the few
>>>> drivers that require it. Use a FIFO list by default.
>>>>
>>>> Sorting pages by memory offset for deferred I/O performs an implicit
>>>> bubble-sort step on the list of dirty pages. The algorithm goes through
>>>> the list of dirty pages and inserts each new page according to its
>>>> index field. Even worse, list traversal always starts at the first
>>>> entry. As video memory is most likely updated scanline by scanline, the
>>>> algorithm traverses through the complete list for each updated page.
>>>>
>>>> For example, with 1024x768x32bpp a page covers exactly one scanline.
>>>> Writing a single screen update from top to bottom requires updating
>>>> 768 pages. With an average list length of 384 entries, a screen update
>>>> creates (768 * 384 =) 294912 compare operation.
>>>
>>> What about using folios?
>>> If consecutive pages are merged into a single entry, there's much less
>>> (or nothing in the example above) to sort.
>>
>> How would the code know that? Calls to page_mkwrite happen
>> pagefault-by-pagefault in any order AFAICT.
>
> fb_deferred_io_mkwrite() would still be called for a page, but an
> adjacent page can be merged with an existing entry while adding it
> to the list.
I still don't understand how we'd use it to our advantage. Most drivers
don't need sorted pages at all. A folio has strong alignment
requirements for size and offset AFAICT. We might end up flushing way
too much of the display memory.
Best regards
Thomas
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
prev parent reply other threads:[~2022-02-14 13:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-10 14:11 [PATCH 0/2] fbdev: Significantly improve performance of fbdefio mmap Thomas Zimmermann
2022-02-10 14:11 ` [PATCH 1/2] fbdev/defio: Early-out if page is already enlisted Thomas Zimmermann
2022-02-10 21:00 ` Sam Ravnborg
2022-02-11 9:12 ` Thomas Zimmermann
2022-02-10 14:11 ` [PATCH 2/2] fbdev: Don't sort deferred-I/O pages by default Thomas Zimmermann
2022-02-10 16:15 ` Andy Shevchenko
2022-02-10 21:16 ` Sam Ravnborg
2022-02-11 7:58 ` Dan Carpenter
2022-02-11 8:25 ` Thomas Zimmermann
2022-02-11 8:21 ` Thomas Zimmermann
2022-02-14 8:05 ` Geert Uytterhoeven
2022-02-14 8:28 ` Thomas Zimmermann
2022-02-14 9:05 ` Geert Uytterhoeven
2022-02-14 13:29 ` Thomas Zimmermann [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=4a0697de-52db-97e7-d528-c7e2fe000e66@suse.de \
--to=tzimmermann@suse.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bernie@plugable.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
--cc=javierm@redhat.com \
--cc=jayalk@intworks.biz \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=noralf@tronnes.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;
as well as URLs for NNTP newsgroup(s).