From patchwork Fri Jan 31 00:18:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vishal Moola (Oracle)" X-Patchwork-Id: 13955033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DAAFC0218A for ; Fri, 31 Jan 2025 00:19:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C63B6B0144; Thu, 30 Jan 2025 19:19:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 14F286B0148; Thu, 30 Jan 2025 19:19:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE3392800DC; Thu, 30 Jan 2025 19:19:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id BACCF6B0144 for ; Thu, 30 Jan 2025 19:19:04 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 76D991C7165 for ; Fri, 31 Jan 2025 00:19:04 +0000 (UTC) X-FDA: 83065837008.21.08D8747 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by imf01.hostedemail.com (Postfix) with ESMTP id B225D40004 for ; Fri, 31 Jan 2025 00:19:02 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IPBRRkks; spf=pass (imf01.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.180 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738282742; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=oWUAukKm+Ulg4aVVFfRO1Ki73t1eOXCR15qhPHxZ7oQ=; b=Ks5VAUWn79iLruRh55eTrhct57L8lfnMtcAEIXwd+NZUNYcrTzY3OMBIBhM2ymclcAZGzX 3Z72NQSj+iZDqySLVwFQ7P3Ut0FXqUp80WTxQx5vsD8FaDG02263/Sn6LV9Z5UiUCLGp2i /5730/qd5/zT4ZjrXsnzYGmf8XLKpE0= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IPBRRkks; spf=pass (imf01.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.180 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738282742; a=rsa-sha256; cv=none; b=lC0uz2In2jOgkIDFGMt5F6W5RKy2xJe55hLOTiUPJ67E/qWSYxXiRV4Z/0FNd5wrNWfeMo hAZE9/pNh8jAXi96C00w7SF4YvGi05KMM7sZiPefK2y7D4MndX/lbDWPN8JsxpSD2hYHeR k5VNZbMRuXunCdMjvO62nUxxCcdkHyc= Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2165448243fso14329935ad.1 for ; Thu, 30 Jan 2025 16:19:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738282741; x=1738887541; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oWUAukKm+Ulg4aVVFfRO1Ki73t1eOXCR15qhPHxZ7oQ=; b=IPBRRkks87S72655byo4Xg7fUE+Zr2JXfH8JWZWNJDcU2d1skCUgZpDjtVH3jWo/Qm 9T52AZaey5VquZuevJ6pFwcz5C/ID9FVHe/+QIVj+cxoTvrk8l/I/wGa2df2IDw3Jo0H 1TlivJBuUYDbQnIJ4xueVNlRD0uJ2bypOcFhhUoU4OUXhJkbMbffkRR7pJBGChS9k+Yu MyD/bkvF700szF6RtrNqYJGz9mGG4usYfosBucgqQAIPz8jIM1EJkWfXYrCnw3nV+Jez YPk9SF+a109U7vkijD7DF3Uc8LiUYnIGCQI/GtW5zrCAFGX1WVd2OM+thybZYvFjNHPj 2VHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738282741; x=1738887541; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oWUAukKm+Ulg4aVVFfRO1Ki73t1eOXCR15qhPHxZ7oQ=; b=xB1cj6kQ6OBDDG8H2X2kUT2eVCug88HVDtq1sJiYF5oitHNXJBu3Ol+VXBePv0u1NG /rOYsETj80Tnar/a7dYj1zDXuKJ8/WQA0Z4aa7VZ2bNh9jyANO96+eh46i0ACcsCOMVM KhAHC6MgG4x9x3TKT4/n892nnMiB5OxPpRdEghG/M42ylLRo4mxxb2kFpW0IDdDbZI8A 8dbEVSPW+HzH/a1bsdsh6HUy+EOO+sB9PDfCHFaC3GDbWO+md9JG5Euj63Sjkg8uXck4 yZloVaUGODIjvbStV4WMwoFtwd/CbZzp9SW1j7hA+4Gp3JahciUiZswh+jtztoUqGO5J jE7A== X-Gm-Message-State: AOJu0YxyPIIWqDhBeUrzYqbBDIgKUZPrft3MmTM7XRddDS9fHoEYjosz K9LlcASqe0S4oC2e+cqheksoNne7lsTl8lYWBpBV08vzzgXOVSjzXYnSSw== X-Gm-Gg: ASbGncutlG9mTgdGCGWRH/Zb+6QMOtd45Px7fq83jllA3P8FO/F39QMZ2krwA2okzSZ 97AmmaBrvPeJtODbGde2NsiAITjSgq0rgCZY/Sg2bC4HPbs7cLwU+WjMRV2asYxt/dW/RVlo0OF jOozmRpo7LORzvnvO2EGAb7e2k6xLOaudHAD+N8PlKfEcgbAZX869jetBAAmj0VAw1I7jU8Eu+1 Qt5zqHIAdxjMB0H+izqwhLo5aNLtHa9iz/H562rdJ31Vgq+0X/Xw4pBlbXAKZA8GKll1XD7JZ2Y +vLprjAEt6DXiR+MLCMf7ixOSAfbyR1BnOjCcaLu5jaVgIjwTw== X-Google-Smtp-Source: AGHT+IHQVlYS6aYq8WW++lgxdknQoz1+xqr0lH079FezTgl/uti7NF7HLDu0SbDJ75R5kv5gMEBdhQ== X-Received: by 2002:a05:6a20:d503:b0:1eb:3482:9d27 with SMTP id adf61e73a8af0-1ed7a5d53ecmr16566389637.32.1738282741172; Thu, 30 Jan 2025 16:19:01 -0800 (PST) Received: from fedora.. (c-67-164-59-41.hsd1.ca.comcast.net. [67.164.59.41]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-72fe6429218sm2148234b3a.66.2025.01.30.16.19.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jan 2025 16:19:00 -0800 (PST) From: "Vishal Moola (Oracle)" To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, hch@infradead.org, urezki@gmail.com, intel-gfx@lists.freedesktop.org, "Vishal Moola (Oracle)" Subject: [PATCH 0/2] vmalloc: Introduce vmap_file() Date: Thu, 30 Jan 2025 16:18:04 -0800 Message-ID: <20250131001806.92349-1-vishal.moola@gmail.com> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: B225D40004 X-Stat-Signature: u39i4w6wcjjcrbb7apwhtzwmkd1xnor9 X-HE-Tag: 1738282742-731009 X-HE-Meta: U2FsdGVkX1++fvgtdDqSHoybHEI6DMAvN57IyieOWELkdMUPoCgIshXfKrlQGwy63jdCduFtXiB1WPrhggoRxUQUGRwhB1RG4Jx6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YodiR9hrv3vViAf7lL7W8CBbIx4kRA/MaVULsZsEsEASaBnFTTE8IlA0sl5DV/21GptEvs1O7bmPbvovaUonyAfAG2sDJaeNmpecM3V28PB0fVS6T9tazNg1CfyoWK5KdSbJ3Duh1gZXos/WnY2AbmH+pN5j3WlZv9Gg+pLVrzNjuPGnwT+id2c798+l8JyYQidOR6b+0s4im2enJ36SXxhklVVPAML5ePv++SEKBB4TNrUyWKRcZ7lmgbZy59y+pP36wO1q7KCqSYdWI/NK2+3AoVJ8SFQP4olBz4arx2pu1AH2wqsq6eG9CnA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000018, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Currently, users have to call vmap() or vmap_pfn() to map pages to kernel virtual space. vmap() requires the page references, and vmap_pfn() requires page pfns. If we have a file but no page references, we have to do extra work to map them. Create a function, vmap_file(), to map a specified range of a given file to kernel virtual space. Also convert a user that benefits from vmap_file(). Vishal Moola (Oracle) (2): mm/vmalloc: Introduce vmap_file() drm: Use vmap_file() in shmem_pin_map() drivers/gpu/drm/i915/gt/shmem_utils.c | 23 +------ include/linux/vmalloc.h | 2 + mm/vmalloc.c | 97 +++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 20 deletions(-)