From: mhkelley58@gmail.com
To: jayalk@intworks.biz, simona@ffwll.ch, deller@gmx.de,
haiyangz@microsoft.com, kys@microsoft.com, wei.liu@kernel.org,
decui@microsoft.com, akpm@linux-foundation.org
Cc: weh@microsoft.com, tzimmermann@suse.de, hch@lst.de,
dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-mm@kvack.org
Subject: [PATCH 0/3] fbdev: Add deferred I/O support for contiguous kernel memory framebuffers
Date: Tue, 8 Apr 2025 11:36:43 -0700 [thread overview]
Message-ID: <20250408183646.1410-1-mhklinux@outlook.com> (raw)
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 2.
Patch 2 is the changes to the fbdev deferred I/O code. More details
are in the commit message of Patch 2.
Patch 3 updates the hyperv_fb driver to use the new functionality
from Patch 2.
Michael Kelley (3):
mm: Export vmf_insert_mixed_mkwrite()
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 | 126 +++++++++++++++++++++++-----
drivers/video/fbdev/hyperv_fb.c | 1 +
include/linux/fb.h | 1 +
mm/memory.c | 1 +
4 files changed, 109 insertions(+), 20 deletions(-)
--
2.25.1
next reply other threads:[~2025-04-08 18:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 18:36 mhkelley58 [this message]
2025-04-08 18:36 ` [PATCH 1/3] mm: Export vmf_insert_mixed_mkwrite() mhkelley58
2025-04-09 10:49 ` Christoph Hellwig
2025-04-09 14:10 ` Michael Kelley
2025-04-10 7:42 ` Christoph Hellwig
2025-04-11 3:40 ` Michael Kelley
2025-04-08 18:36 ` [PATCH 2/3] fbdev/deferred-io: Support contiguous kernel memory framebuffers mhkelley58
2025-04-09 10:50 ` Christoph Hellwig
2025-04-08 18:36 ` [PATCH 3/3] fbdev: hyperv_fb: Fix mmap of framebuffers allocated using alloc_pages() mhkelley58
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=20250408183646.1410-1-mhklinux@outlook.com \
--to=mhkelley58@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=decui@microsoft.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=haiyangz@microsoft.com \
--cc=hch@lst.de \
--cc=jayalk@intworks.biz \
--cc=kys@microsoft.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhklinux@outlook.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=weh@microsoft.com \
--cc=wei.liu@kernel.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