From patchwork Tue Oct 3 07:44:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kasireddy, Vivek" X-Patchwork-Id: 13407074 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6CD02E75433 for ; Tue, 3 Oct 2023 08:05:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE2E710E259; Tue, 3 Oct 2023 08:05:27 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 313D710E23C for ; Tue, 3 Oct 2023 08:05:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696320326; x=1727856326; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=OmFHTqOSa59ciYTjUMSks5D1AhH7iwG4dRqZ8ggdYrc=; b=MCgrVpOgWM8TcPhled8HsLOq8mhf2GmVDkER/z1D5BugIQsdX3Nw11AA 8wC01HsDy5L36se8klKlemlMd5ald9gH3R2fC7OJP044lJXY0t7OHOpPD I1guX9Lr4vn0pFFHEMcHUtwqXQOSPvPK8d8Y7F+SCfBH8rPV386bxuKCZ MyoMDc+9N5WktZUQzpaVmfjJ0XjndAdDGBnBg4kt/6dmKJhDU4LZ7N/9m fHh6F7xI8rc/njK4jdmgrr4fBY9hBjuEEa6io0XHRlgkh8vMJZzFQ8XlI Emk3J2EdxMMyj+NLrFws/kpRUWhkW03VzyeUFbl4D5L4qX9JIxefQWKXi Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="449306978" X-IronPort-AV: E=Sophos;i="6.03,196,1694761200"; d="scan'208";a="449306978" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 01:05:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="700615282" X-IronPort-AV: E=Sophos;i="6.03,196,1694761200"; d="scan'208";a="700615282" Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 01:05:24 -0700 From: Vivek Kasireddy To: dri-devel@lists.freedesktop.org, linux-mm@kvack.org Subject: [PATCH v1 0/3] mm/gup: Introduce pin_user_pages_fd() for pinning shmem/hugetlbfs file pages Date: Tue, 3 Oct 2023 00:44:44 -0700 Message-Id: <20231003074447.3245729-1-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dongwon Kim , David Hildenbrand , Daniel Vetter , Hugh Dickins , Vivek Kasireddy , Peter Xu , Gerd Hoffmann , Jason Gunthorpe , Junxiao Chang , Mike Kravetz Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The first patch introduces pin_user_pages_fd() API and the second patch shows how the udmabuf driver can use it to longterm-pin the the pages. The last patch adds two new udmabuf selftests to verify data coherency after page migration. Cc: David Hildenbrand Cc: Daniel Vetter Cc: Mike Kravetz Cc: Hugh Dickins Cc: Peter Xu Cc: Jason Gunthorpe Cc: Gerd Hoffmann Cc: Dongwon Kim Cc: Junxiao Chang Vivek Kasireddy (3): mm/gup: Introduce pin_user_pages_fd() for pinning shmem/hugetlbfs file pages udmabuf: Pin the pages using pin_user_pages_fd() API selftests/dma-buf/udmabuf: Add tests to verify data after page migration drivers/dma-buf/udmabuf.c | 82 +++++++--- include/linux/mm.h | 2 + mm/gup.c | 87 ++++++++++ .../selftests/drivers/dma-buf/udmabuf.c | 151 +++++++++++++++++- 4 files changed, 297 insertions(+), 25 deletions(-)