Message ID | 20250502040525.822075-1-mhklinux@outlook.com |
---|---|
Headers | show
Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A881211C; Fri, 2 May 2025 04:05:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746158736; cv=none; b=OcnDUO61wR3WB1AolLPmpJbdRbkW2a9wq7+tCCyUofsi2BrKBKa3Y4eT0W6RKmcEwzajxiuj6trQBKdJ0BG/yzwF+MtDXLPhNAIHfizEdeEllNhmho8Vzm0GTzWNr8jBgHAb/0VpZZHd+1CLeCiAxa+r2JWYY31jqoJJO2yo3ds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746158736; c=relaxed/simple; bh=TL3f3BW2tAyt74rHrlzhrwreyDMYGP3h4muuCeK4s9M=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=JnG4/bnJi2bXRYKVJJImDLa8ninkpcLlI7SouOe42Y+g+Y9HQsgAW6+YJLj3musQlvv5GNiy3Rb0CWNbLr5wWKKwY6JFxK14VJY2AryDmnkcCJDKH594zV2jbqEDD1c2e3M4IfUrD/BBzDXpxXghn5icPigapZ5wJkrP6p42fAo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bMyDlUiV; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bMyDlUiV" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-22c33ac23edso18897395ad.0; Thu, 01 May 2025 21:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746158734; x=1746763534; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=dSub1wuh8nlEkm+pKUMg5wgv6Gx8ymFTnPqus5nWjls=; b=bMyDlUiV4rmO8HYRRQIewfeHukRR4oHohPjqAcQw9nEOPCqc46kQ5onbA5hgwDlNXL YvXiSuAznY34iMdWWrLKOO8Agx3LRcFI1um70yrJcufa+MzY66gxFF4zmROvA+MBHJ2q Ko0KcoNB+PcOcF1Uk8xSx8GGg70UZDcFzaDwrPKIPeMahpSe3K5+pnWaRlNla1GEp8LF vxutwd5sK0FbnG3My596w/cIN9zNqLBpZbHPPn4TC89BThqXxq1RdizySiiHOnn0jh/T DRwQ/ajxTe1hH6k99iioJGTQa3VizJKXvODyasmDo39vi/LiaEa4Bh09EIhl+z7f+fEC /0mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746158734; x=1746763534; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dSub1wuh8nlEkm+pKUMg5wgv6Gx8ymFTnPqus5nWjls=; b=BgCGkvSy6NUSe69edhHr1uVkJEjL3M5XvgTonXG1KjaVAu5WsY8g7MsnCv0oYBT2ek YRdqnj6eURONhVIqsbwj3nuh3xSypm9b0rm1GKYTW5de60DEAEMFMaoBAulSekzBGLL7 5Xp+fwdmdkAzKKPSoChr+xwT0bMDPMJt/vCM0Q5zl6zeEhfw7ISpm83lp+2NdlNvmgbi ZFewIZ8KaEe3Adao7Swexmo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-Received: by 2002:a17:902:ef0b:b0:223:6657:5003 with SMTP id d9443c01a7336-22e103899d1mr22760535ad.32.1746158734054; Thu, 01 May 2025 21:05:34 -0700 (PDT) Received: from localhost.localdomain (c-67-160-120-253.hsd1.wa.comcast.net. [67.160.120.253]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22e108fb836sm4510635ad.141.2025.05.01.21.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 May 2025 21:05:33 -0700 (PDT) From: mhkelley58@gmail.com X-Google-Original-From: mhklinux@outlook.com To: 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 v2 0/3] fbdev: Add deferred I/O support for contiguous kernel memory framebuffers Date: Thu, 1 May 2025 21:05:22 -0700 Message-Id: <20250502040525.822075-1-mhklinux@outlook.com> X-Mailer: git-send-email 2.25.1 Reply-To: mhklinux@outlook.com Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: <linux-fbdev.vger.kernel.org> List-Subscribe: <mailto:linux-fbdev+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-fbdev+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit |
Series |
fbdev: Add deferred I/O support for contiguous kernel memory framebuffers
|
expand
|
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 | 128 +++++++++++++++++++++++----- drivers/video/fbdev/hyperv_fb.c | 1 + include/linux/fb.h | 1 + mm/memory.c | 1 + 4 files changed, 111 insertions(+), 20 deletions(-)