linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] fbdev: Add deferred I/O support for contiguous kernel memory framebuffers
@ 2025-05-23 16:15 mhkelley58
  2025-05-23 16:15 ` [PATCH v3 1/4] mm: Export vmf_insert_mixed_mkwrite() mhkelley58
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: mhkelley58 @ 2025-05-23 16:15 UTC (permalink / raw)
  To: simona, deller, haiyangz, kys, wei.liu, decui, akpm
  Cc: weh, tzimmermann, hch, dri-devel, linux-fbdev, linux-kernel,
	linux-hyperv, linux-mm

From: Michael Kelley <mhklinux@outlook.com>

Current deferred I/O code works only for framebuffer memory that is
allocated with vmalloc(). The code assumes that the underlying page
refcount can be used by the mm subsystem to manage each framebuffer
page's lifecycle, which is consistent with vmalloc'ed memory, but not
with contiguous kernel memory from alloc_pages() or similar. When used
with contiguous kernel memory, current deferred I/O code eventually
causes the memory free lists to be scrambled, and a kernel panic ensues.
The problem is seen with the hyperv_fb driver when mmap'ing the
framebuffer into user space, as that driver uses alloc_pages() for the
framebuffer in some configurations. This patch set fixes the problem
by supporting contiguous kernel memory framebuffers with deferred I/O.

Patch 1 exports a 'mm' subsystem function needed by Patch 3.

Pathc 2 defines the FBINFO_KMEMFB flag for use by Patches 3 and 4.

Patch 3 is the changes to the fbdev deferred I/O code. More details
are in the commit message of Patch 3.

Patch 4 updates the hyperv_fb driver to use the new functionality
from Patch 3.

Michael Kelley (4):
  mm: Export vmf_insert_mixed_mkwrite()
  fbdev: Add flag indicating framebuffer is allocated from kernel memory
  fbdev/deferred-io: Support contiguous kernel memory framebuffers
  fbdev: hyperv_fb: Fix mmap of framebuffers allocated using
    alloc_pages()

 drivers/video/fbdev/core/fb_defio.c | 128 +++++++++++++++++++++++-----
 drivers/video/fbdev/hyperv_fb.c     |   1 +
 include/linux/fb.h                  |   1 +
 mm/memory.c                         |   1 +
 4 files changed, 111 insertions(+), 20 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2025-06-12  7:25 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23 16:15 [PATCH v3 0/4] fbdev: Add deferred I/O support for contiguous kernel memory framebuffers mhkelley58
2025-05-23 16:15 ` [PATCH v3 1/4] mm: Export vmf_insert_mixed_mkwrite() mhkelley58
2025-05-23 16:15 ` [PATCH v3 2/4] fbdev: Add flag indicating framebuffer is allocated from kernel memory mhkelley58
2025-05-23 16:15 ` [PATCH v3 3/4] fbdev/deferred-io: Support contiguous kernel memory framebuffers mhkelley58
2025-05-24  7:28   ` kernel test robot
2025-05-26  6:54   ` Christoph Hellwig
2025-06-02  9:47   ` David Hildenbrand
2025-06-03  1:49     ` Michael Kelley
2025-06-03  6:25       ` Thomas Zimmermann
2025-06-03 17:50         ` Michael Kelley
2025-06-04  8:12           ` Thomas Zimmermann
2025-06-04 14:45             ` Simona Vetter
2025-06-04 21:43               ` Michael Kelley
2025-06-05  7:55                 ` Thomas Zimmermann
2025-06-05 15:35                 ` Thomas Zimmermann
2025-06-05 17:38                   ` Michael Kelley
2025-06-06  7:05                     ` Thomas Zimmermann
2025-06-11 23:18                     ` Michael Kelley
2025-06-12  7:25                       ` Thomas Zimmermann
2025-06-03  7:55       ` David Hildenbrand
2025-06-03 17:24         ` Michael Kelley
2025-06-04 21:58           ` Michael Kelley
2025-06-05  8:10             ` David Hildenbrand
2025-05-23 16:15 ` [PATCH v3 4/4] fbdev: hyperv_fb: Fix mmap of framebuffers allocated using alloc_pages() mhkelley58

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).