Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3190399pxb; Sun, 7 Feb 2021 00:36:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5Adt8AXZ034O0CfTl9dBsJ6R52zythXkraLZvjGFRGxPTYTpvN3lfuQfBFUR1cFy9pfHf X-Received: by 2002:a05:6402:270e:: with SMTP id y14mr11607790edd.322.1612686970788; Sun, 07 Feb 2021 00:36:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612686970; cv=none; d=google.com; s=arc-20160816; b=KDGocsxkIm9RZS81nb5cYckNtqjmCtpSyWbLITIBlGMaWsKZXUftmTPw4/72+k7NNH rUFkORcaRK/kTpXYs6P9A51XhZ5S97VBd/kgMYVCDGswcBeplB61Ds2J7bVB2eoxDBjI 49DT1P5lccfWfC5ATIecGT7BCZyJpUc497KXQjsnelfg9Tba3hwxWf1xbg0r4QkdlRNF a4ddYu4ItngidImyy/XSP6aRA5mftoNogZRPYj+vECGllUToRlUM+R81kLbB4susdUOk t5X5pqisVZABMsd6X8KDnrz5dU1mZT9Dz6rBws9qRg3XN/ouBzMaEcOfNW1V2zgmsQHZ oVcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=6cxPlrFs5vWN0mIIBLmtRwWZTm5HfJiOHGNl9zGL7mo=; b=VM7XGvR0LEEFeBju0oDZsmwNy2zv+tlXXiDUkLbAcWS5qiOjL36CRVCjXvW/q25a5S ksVyJLqP0dINDC6OOGsB/5jylEYV68aDdFVWH2Fj7F5HXQBzzJiFzS4ffX8u2UhWaer+ zgIMrT+N+8Tb5E3hiRHMVGu1vBgnMK1rBc4J+kGJ/EYanOP1ugTYIA7XrkeIbUUYWxmt cYarg0Z9YeJ5lqpT9YVgdrEA1MAZB0qRe+5VnajvWNmTu0mJEqwsqDmdy2cVdFXbLdZF YTc0DR7ZM/lfrOEvzwf/k/SOJPwlBQvdtI0Ilt/5nQY2yLIyptdX21kQErMgy0erDAY1 f3Cw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si8759955edq.140.2021.02.07.00.35.48; Sun, 07 Feb 2021 00:36:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230194AbhBGIc5 (ORCPT + 99 others); Sun, 7 Feb 2021 03:32:57 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:12474 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbhBGI1H (ORCPT ); Sun, 7 Feb 2021 03:27:07 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DYMf66cr2zjKdl; Sun, 7 Feb 2021 16:25:02 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Sun, 7 Feb 2021 16:26:15 +0800 From: Zhou Wang To: , , , , , Andrew Morton , Alexander Viro CC: , , , , , , , , Zhou Wang Subject: [RFC PATCH v3 0/2] mempinfd: Add new syscall to provide memory pin Date: Sun, 7 Feb 2021 16:18:02 +0800 Message-ID: <1612685884-19514-1-git-send-email-wangzhou1@hisilicon.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds a new mempinfd syscall to offer a common way to pin/unpin memory. Patch 1/2 is about mempinfd codes. Patch 2/2 adds a simple test tool about mempinfd. Change logs: ------------ v2 -> v3: - Follow suggestions from Greg and Kevin, add a new syscall. - Add input check. - Use xa_insert to replace xa_store. - Add lock to pretect pin and xa_insert. v1 -> v2: - Some tiny fixes. - Follow Greg's suggestion to get mm-list and iommu-list involved. Links: ------ - v2: https://www.spinics.net/lists/kernel/msg3808926.html - v1: https://www.spinics.net/lists/kernel/msg3805205.html Zhou Wang (2): mempinfd: Add new syscall to provide memory pin selftests/vm: add mempinfd test arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 2 + fs/Makefile | 1 + fs/mempinfd.c | 199 ++++++++++++++++++++++++++++++++++ include/linux/syscalls.h | 1 + include/uapi/asm-generic/unistd.h | 4 +- include/uapi/linux/mempinfd.h | 23 ++++ init/Kconfig | 6 + tools/testing/selftests/vm/Makefile | 1 + tools/testing/selftests/vm/mempinfd.c | 131 ++++++++++++++++++++++ 10 files changed, 368 insertions(+), 2 deletions(-) create mode 100644 fs/mempinfd.c create mode 100644 include/uapi/linux/mempinfd.h create mode 100644 tools/testing/selftests/vm/mempinfd.c -- 2.8.1