Received: by 10.223.185.116 with SMTP id b49csp5814465wrg; Tue, 27 Feb 2018 22:12:24 -0800 (PST) X-Google-Smtp-Source: AH8x226Pga0Lp9gr+NR/vtjAt2ZNtDo6gLkbWSGKT3x8mwppRXn5FSXEcLYGFaT1vwwDUe0goaky X-Received: by 2002:a17:902:47:: with SMTP id 65-v6mr16513467pla.194.1519798344263; Tue, 27 Feb 2018 22:12:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519798344; cv=none; d=google.com; s=arc-20160816; b=cnPrmwylEuNcfk/1ZFx+IAQXlcq+y2Ix/t07CmAa3OHeiY6CNNL5FwroyTtaHdTgan rxE8Tnu5M0OybGnMtS6wZgOlXN3N4f8aBewi1gLG3TzCWLLRVN/q+iiawvg/RpsrM/ZM OxUv1FcS7+Oj5bLsMZQl9UULSleIeG0u/sFI0mrGIVoxW8CkMiKyDLCDWWokpmrt5Cw5 b7jHYDaN2x329DkhVsUhXVKvSaOVhtSJ8vBgdRqZ4wiit/GfsM1GitrVC5Bq3R1Fuhf9 j7+Q641e4gNQO69rcwX3OcH/Z5jqTp+OtTg5O+eJKTMqO7PG9nFfQbqL2becFzNUou8d DS5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=y7KxPKjLIJkqpce4A5Lt0MnLufta2xq9Jl5FWbpAvBo=; b=WlYO/7GKxccEWjcY99NtrJlVLqpfVY1BcN6lGFRW6SErzdbkONzo0orRb8aSprHu32 J3+DX4OYrJm0MRhZauyzhGrO7eSEuBaaCq1t1RwNucsJiwqPGdIDX/DcE7hgboh+Q+nK 6M1NVicvhHbvJsiEoa1NydpNejZdXkJybXDMePSwOLb0f94mN2VsI4kPutSVXldYj1fV AGBk+60oje4NUJePEkLi87jfmNIW+6bmJDD/Fpo1fNIeGErR1aTx8pXoKGIFR3kBjpN2 xHlOL38i9ZuaJPEqk5FdBknpk/9L6QoNGOR+4ehMLH/iBw7xXEc1RlM+eGGYevWpBHjy uQ/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=H2L6IZ7R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15-v6si772347pln.186.2018.02.27.22.12.08; Tue, 27 Feb 2018 22:12:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=H2L6IZ7R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751819AbeB1GL2 (ORCPT + 99 others); Wed, 28 Feb 2018 01:11:28 -0500 Received: from mail-eopbgr50129.outbound.protection.outlook.com ([40.107.5.129]:38784 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751031AbeB1GLZ (ORCPT ); Wed, 28 Feb 2018 01:11:25 -0500 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=y7KxPKjLIJkqpce4A5Lt0MnLufta2xq9Jl5FWbpAvBo=; b=H2L6IZ7RTVMeT8KHcK07fn7IXJ3KLswesSt0iOTAPcDeKPMR0E4ZOISBz1/soWhUpOOYGRuBPXxTGBLUMEotUyQHH0NXARyqYT0jzX05qcB8iJiXID7lkoeWXFhJTG5a/Bv3d+n6u/wyA21zpRqQZHGCcoXw95hi+W/4cHW54wk= Received: from outlook.office365.com (73.140.212.29) by VI1PR08MB0750.eurprd08.prod.outlook.com (2a01:111:e400:5a04::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Wed, 28 Feb 2018 06:11:15 +0000 Date: Tue, 27 Feb 2018 22:11:04 -0800 From: Andrei Vagin To: "Dmitry V. Levin" Cc: Pavel Emelyanov , Andrew Morton , Mike Rapoport , Alexander Viro , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, criu@openvz.org, gdb@sourceware.org, devel@lists.open-mpi.org, rr-dev@mozilla.org, Arnd Bergmann , Michael Kerrisk , Thomas Gleixner , Josh Triplett , Jann Horn , Greg KH , Andrei Vagin Subject: Re: [PATCH v5 0/4] vm: add a syscall to map a process memory into a pipe Message-ID: <20180228061103.GA8608@outlook.office365.com> References: <1515479453-14672-1-git-send-email-rppt@linux.vnet.ibm.com> <20180220164406.3ec34509376f16841dc66e34@linux-foundation.org> <3122ec5a-7f73-f6b4-33ea-8c10ef32e5b0@virtuozzo.com> <20180227021818.GA31386@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20180227021818.GA31386@altlinux.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [73.140.212.29] X-ClientProxiedBy: CY4PR06CA0039.namprd06.prod.outlook.com (2603:10b6:903:77::25) To VI1PR08MB0750.eurprd08.prod.outlook.com (2a01:111:e400:5a04::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41853f8f-0115-49eb-f221-08d57e72154d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:VI1PR08MB0750; X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB0750;3:3HGaLT9QBTCR5reCB5RJoTJ4HE++l8MKJratokfFNn1h3Qop+WVmUzuGZKGmfLae55edaaJBzxUEyYxSLAyjAKAcP9+89VxdiXKeBiW4wXcdEE9oJBA5j4N+DAhg/RkqnthJFrbsBAUCYKUAxTo/7lcsyhsfGKG6v4KPy+BvYgxcxDexTlURklgHKYEmVv5u/BsfXA6Gdc6jONFTwVqHuS+jnEdzPRrKgP8EUoCKL/gmN/d2O482lhMUegaxmQ3s;25:HKKGcg5OziI4vzoZwSx58k43V1P9WtTBqmNyvY4FTT9a230olzTTzFeDnr+GGav7APVsikRiCBzgZO0otnB578ov/xVTjYtLkHF1euB8s2FHw3omyvcWwkeYt4oUlCnNJXRl6OGEgychreYJMX+2QoXvLGRM1jr4c/S9tVwVqVxDDqlOqKUTozsfqUig7AqvDMal3elOK9ok9lICsVIOX818jhbgUaEEniBxmSYt8RT6M/KK92b54NNbBdQI+SW55OHBTUJsX2QEhEBi6uRnkMxiVlQXUt1BH+V+XJXWSPSsMKdsqCzxuDsHb8ksqGdOB1vEOHcWfumAarQffHs61w==;31:KQmGHSMn/WyFAyhdRwhIQ9zGb6hwy0PPPcj9IZ0bYh7EJcEuHBxibHdDU/hTbovl+Os7X/ZHjt9F3isGaj9+w5K8TeLkWbX2/Sq95zfYjwRGjbeQNen3okJWsiYNWn9++vEdLRK+b/bVqUXy7TvwyqtjugXnZnrQgCiNYpGbJ+Kp1E0rNEtyQ5o2yBsX2dHMKWk/ULx2uSOg/OJmtiNnmzDutavpMiD3aRETCE1T60s= X-MS-TrafficTypeDiagnostic: VI1PR08MB0750: X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB0750;20:YNAG/uMTSo3M5ccc6iEEtf+q1u+aeWXDgIPsHsK/8MsgcwgMWPWOsHkiK0tl3j7fR/JzyUExhRTPKSK4QBhewyKs4y7QmuAMMEZx7BzZGlq626+3pTHtTSoM0IAO00hsClUeoAx0283Twyw1QLvjP3xTEPiQ8yhZGuVqjyesJeWz7T5MbkN2xEZhT4jbzZr7E7YNu4A1p5lafHSo/TMNL+vH7DEiLXupIUwUrizf+T9oQ0CKukX5+qTTYQc5c8Aju6ZO/+sC5hhRU3ABQRmEIJ6PnxBCQ0X0wYTY/CoiGNq4eX5d3rE3YIz5Ja0wJLuhrC9BXJHNuEUjiTnmMj0fVGzJjiSIdztnF8CrYVNw97OEVbJ9Rkf7+E8baS4ltliVThuFMio0BlrNlJzsAkOIMzQPdekAQNarD3B3V1eefOiWqXoRxibsOTQHRfQkdJjGYzg1OiuV1kUBqMjYpLwirwamCW5YaJNgorhw+uXDzK287VtoXMDxf/Tjf4+kLSb/;4:Nm4xk/dtkZ7Qxh1z4DxS/G/8ozYIj8pfStbdO7m/E+S8pvsI3tGlPl793QyqGy8xiC+uMbXbTG/rv7aoOSElG0ACRfyqsVKNm1amoRhEVVvXjOrGaWAwvzC/2zB0qw/FXzAbigs0ZLBgzjpjEEpnki2+vH4Nt4e4uWcinGM1Llzuy1e00qVlALUmh5XA16n6kq2cVh/xV8TRpAOCnqWPWdlyqIOviVSXih6hojFX66AkXgNO6BrNpxcwBkPw3DvF3OOIPJkjEjPZs7jnjPskyskOiB//ZfTkV3OsuVZPLJhnAqAQUjl8maonDz2OD5OX X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(104084551191319); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(5005006)(8121501046)(3231220)(944501215)(52105095)(10201501046)(93006095)(93001095)(3002001)(6041288)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011);SRVR:VI1PR08MB0750;BCL:0;PCL:0;RULEID:;SRVR:VI1PR08MB0750; X-Forefront-PRVS: 0597911EE1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39380400002)(39850400004)(396003)(346002)(366004)(376002)(189003)(199004)(107886003)(106356001)(53416004)(47776003)(6916009)(186003)(16526019)(6346003)(16586007)(93886005)(86362001)(25786009)(8676002)(478600001)(2950100002)(6666003)(66066001)(81166006)(8936002)(81156014)(53546011)(52116002)(5660300001)(4326008)(54906003)(55016002)(6506007)(26005)(316002)(58126008)(76176011)(6246003)(386003)(59450400001)(305945005)(1076002)(69596002)(97736004)(7416002)(105586002)(7736002)(7696005)(39060400002)(68736007)(2906002)(9686003)(229853002)(33656002)(53936002)(50466002)(6116002)(23686003)(3846002)(18370500001);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR08MB0750;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) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=avagin@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;VI1PR08MB0750;23:Bm9OHnQ2opku9QIk+GWZ5Fi/wLQzk1ARKk7g4xPkuuG?= =?koi8-r?Q?woJz7fGwK+6Iet9+vnQepSxxShYzyf6rgDIcp5tMn8X+HDboVWMMIcIzCXNEeR?= =?koi8-r?Q?K+r5DO9MvhGW9G9isJGGYEg2JOVCj0Fgz+WwyXbubBWxaxuW2bhl1HojjMZ26X?= =?koi8-r?Q?Q9bO+Po0cD/gc9KPMlgt5jzKyMboGIO410hAfe6+VmlVTujYClE0sgdOWdfXcU?= =?koi8-r?Q?VkfHm9E86+vtHWPjPvMOXTljVcElmykVcP8yxZui2XE5GUrtWpePSKbB9wB98R?= =?koi8-r?Q?Y0nt+x6ZhuXQ5dp6g7g7XEqK9WkNicRy3CGe2xoMYQFW0t7vsTlmzMQtYtehsA?= =?koi8-r?Q?TRJY6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Um8phWliElyhz7Gu9ieTn5PU/b09n+XrkFhyzFP3S4KvW7/cgxsMX3vR/IonioLe6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB0750;20:cE/6R9n5gdVDXsEvI6tLAwhf4vD5RRvwqR+eNbFXdym0A7n5muzV2bgjvyo4mFCLCOi0N4ecsBa7n0T5icJrLyyJBBLDw/I1SNSLNFLZni2eG+8QFjoPG2sEcisJYjxMm/PgUj7HNU7ntxT6evbDr0QIuKexjspELV3MDy9ZGts= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2018 06:11:15.2062 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41853f8f-0115-49eb-f221-08d57e72154d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB0750 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 27, 2018 at 05:18:18AM +0300, Dmitry V. Levin wrote: > On Mon, Feb 26, 2018 at 12:02:25PM +0300, Pavel Emelyanov wrote: > > On 02/21/2018 03:44 AM, Andrew Morton wrote: > > > On Tue, 9 Jan 2018 08:30:49 +0200 Mike Rapoport wrote: > > > > > >> This patches introduces new process_vmsplice system call that combines > > >> functionality of process_vm_read and vmsplice. > > > > > > All seems fairly strightforward. The big question is: do we know that > > > people will actually use this, and get sufficient value from it to > > > justify its addition? > > > > Yes, that's what bothers us a lot too :) I've tried to start with finding out if anyone > > used the sys_read/write_process_vm() calls, but failed :( Does anybody know how popular > > these syscalls are? > > Well, process_vm_readv itself is quite popular, it's used by debuggers nowadays, > see e.g. > $ strace -qq -esignal=none -eprocess_vm_readv strace -qq -o/dev/null cat /dev/null For this case, there is no advantage from process_vmsplice(). But it can significantly optimize a process of generating a core file. In this case, we need to read a process memory and save content into a file. process_vmsplice() allows to do this more optimal than process_vm_readv(), because it doesn't copy data into a userspace. Here is a part of strace how gdb saves memory content into a core file: 10593 open("/proc/10193/mem", O_RDONLY|O_CLOEXEC) = 17 10593 pread64(17, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"..., 1048576, 140009356111872) = 1048576 10593 close(17) = 0 10593 write(16, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"..., 4096) = 4096 10593 write(16, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"..., 1044480) = 1044480 10593 open("/proc/10193/mem", O_RDONLY|O_CLOEXEC) = 17 10593 pread64(17, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"..., 1048576, 140009357160448) = 1048576 10593 close(17) = 0 10593 write(16, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"..., 4096) = 4096 10593 write(16, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"..., 1044480) = 1044480 10593 open("/proc/10193/mem", O_RDONLY|O_CLOEXEC) = 17 10593 pread64(17, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"..., 1048576, 140009358209024) = 1048576 10593 close(17) = 0 10593 write(16, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"..., 4096) = 4096 10593 write(16, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"..., 1044480) = 1044480 10593 open("/proc/10193/mem", O_RDONLY|O_CLOEXEC) = 17 10593 pread64(17, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"..., 1048576, 140009359257600) = 1048576 10593 close(17) It is strange that process_vm_readv() isn't used and that /proc/10193/mem is opened many times. BTW: "strace -fo strace-gdb.log gdb -p PID" doesn't work properly. Thanks, Andrei > > > -- > ldv