Hi Am 14.02.22 um 09:05 schrieb Geert Uytterhoeven:
Hi Thomas, On Thu, Feb 10, 2022 at 4:24 PM Thomas Zimmermann <tzimmermann@xxxxxxx> 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.
Best regards Thomas[1] https://elixir.bootlin.com/linux/v5.16.9/source/include/linux/mm_types.h#L258
Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx 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:
OpenPGP_signature
Description: OpenPGP digital signature