From patchwork Thu Aug 17 06:49:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kasireddy, Vivek" X-Patchwork-Id: 13356029 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 B8126EB64DD for ; Thu, 17 Aug 2023 07:10:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B302810E1B1; Thu, 17 Aug 2023 07:10:21 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8EC1110E1BB for ; Thu, 17 Aug 2023 07:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692256220; x=1723792220; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+78dlvA/51d4wBsy1EIEYrq6opiEqB7AJeBx2sGkqW8=; b=GObZAgsA2qRA4YSd8Xqp1n7L6n2U1TnwBHLSzwBlechBjvgSSdobs+gk 4i8txq29Va2osVnEc8WotfCgQJD5H3nX8QXxTanoTX5hJEDkkxRxdWxna RlLtaY9oc19Z/MJ1v5OtY6h4vgPpn41enAv4JeH4P3J7CG6hqdVUN92w6 dFshQIUF44WOChBtBhnHMh4uuTtZt3bL7845iuQNkIouHkhn1rGRkZxrP ZOkoUoARTB8b02YmQfDOE2Pntkt6+VbRGtvPywgAm6W3dh9QScwmGqGVf 7M0EpESR3YMEK+64fU5XR20txQlta8+3t476fxcGAtCB/tITtZm1qbRM8 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="370200878" X-IronPort-AV: E=Sophos;i="6.01,179,1684825200"; d="scan'208";a="370200878" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2023 00:10:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="1065142179" X-IronPort-AV: E=Sophos;i="6.01,179,1684825200"; d="scan'208";a="1065142179" Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2023 00:10:18 -0700 From: Vivek Kasireddy To: dri-devel@lists.freedesktop.org, linux-mm@kvack.org Subject: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA Date: Wed, 16 Aug 2023 23:49:31 -0700 Message-Id: <20230817064934.3424431-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" This patch series adds support for migrating pages associated with a udmabuf out of the movable zone or CMA to avoid breaking features such as memory hotunplug. The first patch exports check_and_migrate_movable_pages() function out of GUP so that the udmabuf driver can leverage it for page migration that is done as part of the second patch. 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: Export check_and_migrate_movable_pages() udmabuf: Add support for page migration out of movable zone or CMA selftests/dma-buf/udmabuf: Add tests to verify data after page migration drivers/dma-buf/udmabuf.c | 106 +++++++++++- include/linux/mm.h | 2 + mm/gup.c | 9 +- .../selftests/drivers/dma-buf/udmabuf.c | 151 +++++++++++++++++- 4 files changed, 254 insertions(+), 14 deletions(-)