From patchwork Wed Nov 1 17:47:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Vagin X-Patchwork-Id: 10036827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8BA326032D for ; Wed, 1 Nov 2017 17:47:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 777CD26223 for ; Wed, 1 Nov 2017 17:47:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B77728C2C; Wed, 1 Nov 2017 17:47:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54C3B26223 for ; Wed, 1 Nov 2017 17:47:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754490AbdKARr1 (ORCPT ); Wed, 1 Nov 2017 13:47:27 -0400 Received: from mail-ve1eur01on0131.outbound.protection.outlook.com ([104.47.1.131]:27776 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751347AbdKARrZ (ORCPT ); Wed, 1 Nov 2017 13:47:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=MJIHBtyXhtogL23uDLXqtOqEt+XCAmDbzPwjzsctWtE=; b=TW5DQZaFqIXDWuTdoB8bGynWog7f29eGeQizCShzxuQpOf1VUwnHVGhTzj1PwbJC0z+HyxxWWkEYp8fBAcjwHXHTyiJT/151zeyGtMcLNAO7pwxYKmt5OwH1PAWGGuGzkqo4jAfAlDKTsqWOGWw52wgoEvlUjus4aaNXSUMXsMY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=avagin@virtuozzo.com; Received: from outlook.office365.com (65.152.152.74) by HE1PR08MB0745.eurprd08.prod.outlook.com (2a01:111:e400:59b1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Wed, 1 Nov 2017 17:47:18 +0000 Date: Wed, 1 Nov 2017 10:47:13 -0700 From: Andrei Vagin To: "Michael Kerrisk (man-pages)" Cc: Andrei Vagin , Alexander Viro , "linux-fsdevel@vger.kernel.org" , lkml , Linux API , linux-arch , criu@openvz.org, Arnd Bergmann , Pavel Emelyanov , Thomas Gleixner , Andrew Morton , Mike Rapoport Subject: Re: [PATCH] [RFC] vm: add a syscall to map a process memory into a pipe Message-ID: <20171101174712.GA26700@outlook.office365.com> References: <20170810184616.22726-1-avagin@openvz.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [65.152.152.74] X-ClientProxiedBy: DB6PR0202CA0001.eurprd02.prod.outlook.com (2603:10a6:4:29::11) To HE1PR08MB0745.eurprd08.prod.outlook.com (2a01:111:e400:59b1::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ba5a279f-0513-41b3-1641-08d521509a80 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(2017052603199)(49563074); SRVR:HE1PR08MB0745; X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0745; 3:PELGfvVS7xk2Qy2atZxPrO1GlwKOTeniY09l59KsQH1QuXkLPsuzgmEFEIM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XnHYOnpTZHU8wZpSuRrlOGBe0b3fM8idIS+K/VsrWy+znvY2ZpLtT9TtGhq55E8y78r6xCD82L8gJ+EwBuZ44Uq6plo2dbZzxzERVMty7iBRPFzN3RW6AfHooRJD+GRMrlaWRtSoembjrnxddUMFyg4MjtgxvTvdbEIpY1lu95k5S5RlqtmTVYN0k8i6SrjGtUNM02mCTdZu/7HAQ4rvP1vSNGrICevlvg=; 4:vSsWo5pR5lqeECIYHq2NmRyPv2YxVkZGhRPDNAc5x2U1OYqI0NASe2AarBgTllYjZ8fVXix9/Qdrlo8xdp18qDCXjtiHXtaXr9iEJT26htyGO+cn2tWkVRP3m6AzWcirzasDcqjcUT/TR3ZoLO6y8mvm6CSmGSgfRsBP0DOLph/DDQKpkf8Py8DhDfE3mQGJzXyJMeyBdmGSndFqvWgCQYuIYgdVlKva/uBvLjkJlef2caa4fQTyzpPjOceCBVcJedMyNjUc6pG/qGfXvwbG5Q== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(8121501046)(5005006)(3231020)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR08MB0745; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR08MB0745; X-Forefront-PRVS: 0478C23FE0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(346002)(376002)(189002)(199003)(24454002)(53936002)(84326002)(106356001)(8936002)(25786009)(305945005)(105586002)(8676002)(81156014)(4610100001)(81166006)(6116002)(568964002)(4326008)(3846002)(97736004)(7736002)(189998001)(69596002)(6246003)(53416004)(68736007)(229853002)(316002)(66066001)(83506002)(55016002)(2476003)(50986999)(76176999)(5890100001)(16586007)(7416002)(54906003)(6506006)(58126008)(54356999)(16526018)(5660300001)(1076002)(53546010)(478600001)(39060400002)(512884003)(2906002)(5000100001)(101416001)(9686003)(6916009)(2950100002)(33656002)(86362001)(6666003)(18370500001)(2700100001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR08MB0745; H:outlook.office365.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR08MB0745; 23:zjcPItRcjppy+7f5/h3nOt9Tu4r5+vGAU2pegrdKN?= =?us-ascii?Q?Nir8gm/5Xp8NSM28U1ZlGyooY6G7EzmgZR2IEhd6cCxcawEYB8T+RkGwFPBT?= =?us-ascii?Q?76RZkOJ7wX65jgfE9WewUooHNEHvLrNoQ8Q/b8Z+rzZW3KQH3H4m/ZVrRag8?= =?us-ascii?Q?+R8tR83ykmt61piYbuOoR72boUQtwlpT2KuSo080+E6/FH92ow1Y71+pSJ0E?= =?us-ascii?Q?TKQ9PDH2PmByDX5LwwxMwU9oyxuWUSBbRvGucGtq6SIc3QXjgFyDcJ0P9ZSS?= =?us-ascii?Q?/gQxgj5/1wIp4fNEEtnNP/7Ebd6S9rmhbY8JcONQsfBnUyXF6jQpE8jSzhWW?= =?us-ascii?Q?iX5RRvQ4HIetxqny5o8032Owdcxa51IXd7IVPYPPAjLhit4emajJZ9E0/5bz?= =?us-ascii?Q?yDbpYUxt0E8ahdCkyMZu5L/rZOe1usguFQMea9GfEioF/z45QecWgNUlOoJw?= =?us-ascii?Q?zldrtQa8/B89vjF409hg76+3Fp4dVh/sPfVwibXU/7XbVjTK9n33zgwEMrVg?= =?us-ascii?Q?wuLaLfgeATHd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U3AvaZv8szobfUp0vz8t/Moe3Je1s/bm8QIr5BE0L3uVzoNmtmfjMsE3L6ldP87tNg4PKAcf9Dr49tkTOXD/XBFBEcywq8K6sYItjL1PAkCKWQkJqnS//+9Ynu7JVWrBuf590gBGsPu/AFStVnXlo2huX9Hx32GgdbQ= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2017 17:47:18.4414 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba5a279f-0513-41b3-1641-08d521509a80 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB0745 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Michael, On Mon, Oct 30, 2017 at 01:47:31PM +0100, Michael Kerrisk (man-pages) wrote: > On 10 August 2017 at 20:46, Andrei Vagin wrote: > > It is a hybrid of process_vm_readv() and vmsplice(). > > > > vmsplice can map memory from a current address space into a pipe. > > process_vm_readv can read memory of another process. > > > > A new system call can map memory of another process into a pipe. > > > > ssize_t process_vmsplice(pid_t pid, int fd, const struct iovec *iov, > > unsigned long nr_segs, unsigned int flags) > > > > All arguments are identical with vmsplice except pid which specifies a > > target process. > > Can we have a man page for this new syscall please? I think we can add a description for process_vmsplice into man2/vmsplice.2. The patch is attached. Thanks, Andrei > > Thanks, > > Michael > > From 923cbd38805f8017b6d86ac6a12c8f45a4117399 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Wed, 1 Nov 2017 10:26:06 -0700 Subject: [PATCH] vmsplice.2: add description for process_vmsplice Signed-off-by: Andrei Vagin --- man2/vmsplice.2 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/man2/vmsplice.2 b/man2/vmsplice.2 index e3e61cf27..8b28b6fff 100644 --- a/man2/vmsplice.2 +++ b/man2/vmsplice.2 @@ -25,7 +25,7 @@ .\" .TH VMSPLICE 2 2014-10-02 "Linux" "Linux Programmer's Manual" .SH NAME -vmsplice \- splice user pages into a pipe +vmsplice, process_vmsplice \- splice user pages into a pipe .SH SYNOPSIS .nf .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" @@ -34,6 +34,8 @@ vmsplice \- splice user pages into a pipe .BI "ssize_t vmsplice(int " fd ", const struct iovec *" iov , .BI " unsigned long " nr_segs ", unsigned int " flags ); +.BI "ssize_t process_vmsplice(pid_t " pid ", int " fd ", const struct iovec *" iov , +.BI " unsigned long " nr_segs ", unsigned int " flags ); .fi .\" Return type was long before glibc 2.7 .SH DESCRIPTION @@ -55,6 +57,12 @@ The file descriptor .I fd must refer to a pipe. +The +.BR process_vmsplice() +system call maps user memory from the process identified by +.I pid +to the local pipe. + The pointer .I iov points to an array of @@ -114,6 +122,7 @@ Data must also be properly page aligned, both in memory and length. .\" commit bd1a68b59c8e3bce45fb76632c64e1e063c3962d .\" .\" .... if we expect to later SPLICE_F_MOVE to the cache. + .SH RETURN VALUE Upon successful completion, .BR vmsplice () @@ -145,6 +154,15 @@ set. .TP .B ENOMEM Out of memory. +.TP +.B ESRCH +No process with ID +.I pid +exists. +.TP +.B EPERM +The caller does not have permission to access the address space of the process +.IR pid . .SH VERSIONS The .BR vmsplice ()