Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11922766ybi; Fri, 26 Jul 2019 01:53:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxr9Kd247uGsA43cygdN40l3cpapjE37gCxJukeX+pxYX0m4fi/DSW8VBL53QJIpKEp0PG4 X-Received: by 2002:a17:902:2aab:: with SMTP id j40mr43857016plb.76.1564131212979; Fri, 26 Jul 2019 01:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564131212; cv=none; d=google.com; s=arc-20160816; b=Ht1/ZnrMfMogtzo+2nKU6vVwEWKyazYTt0AUq/5Kk1ScqstsBAhSoX7FH1JMYO+KY9 XOTVBZIHDsogTkLgm4MjZCl45yZcHf1clR/ICbpDUNbGqF1Jzl6D1Q6eiZuxo7RZC6UG PXJm/u3sfWD6hFVAzvhtc+dMCf+M0R4OXG/f6DL/r5fbioMVLP2rjO8OzbnsSeKoYRjK KG3wI8ZZ4mg02F1QUjty6SlfXEoyUg3/V3VgQ3j3XrFLkFffZmEe/cEDPbyCdmOP0ez/ SfaTo42+4ukWCc1uAT9ZOdE0n1c6zOpitEpYcyIw52bMzmk4LyshodbZWIKkxMkas8RH Dn3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ivu7mmuUCBtRCJ9+296IctrbfYNXAVCIQ5a8QkkFxDo=; b=rq4HV17Q/uruapZBZPwOkI/EnIJTERifTfQ5Ze3Blfyftp9DiOCLgmxkEATGQSgPOm 0hY3g9uYX7rsgbkFALj/QEF2N9dEUyityi1T9KA9XnwMgo0jwUNrO2umat3wu4BHoDkv BJ/2z7wgPnQwBEAFIXC5S6Pluo9MMgn1hyYbqZbdZXdmq8I4FzovAkDiQ7inlppWxupt 4i8r//hc2P0NhlWuuS2WMe1YCWac6OAJSfYW71dPxLkfUAl5NN+BCJ+oktKgJhvjS70H 6FqK65NCpg5cvRQq4yHSxD+f0rxsnmPhoDeDHNkjYEX1Gsy1Al23dk3K5m8icEbyLaGw HQqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=BcbB9dYE; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e123si20379159pfa.252.2019.07.26.01.53.18; Fri, 26 Jul 2019 01:53:32 -0700 (PDT) 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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=BcbB9dYE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726305AbfGZIwn (ORCPT + 99 others); Fri, 26 Jul 2019 04:52:43 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:46823 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbfGZIwn (ORCPT ); Fri, 26 Jul 2019 04:52:43 -0400 Received: by mail-io1-f67.google.com with SMTP id i10so103176163iol.13 for ; Fri, 26 Jul 2019 01:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ivu7mmuUCBtRCJ9+296IctrbfYNXAVCIQ5a8QkkFxDo=; b=BcbB9dYEb6fL2ssaGCJwDjSepgxhHuOJBsItX3hrLsfKUFk5WZgW0heTRA+zC+/9ki epLl9ANmgYHGtkc3Uqix9qGThZR50Myd2iSEOnydNe8nrEbh5evDIlUXXLW6hWf+6EwY X0n577EY+VzxpMbP8Wy6TqPvogcrYcyOEn6Us= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ivu7mmuUCBtRCJ9+296IctrbfYNXAVCIQ5a8QkkFxDo=; b=Di7on5p4u3dL1azFlPG0dBjAkmuMHN73CFU7ppjMT9Bl6ylGboChegFOixXQ4/vSsp l06bNKX2OltojT2/S8h8CfQ/vip4KSMMdgodd21TOg+ew8OJAuym5yTwhOpBh0I3FJHU FZiFqgBirp0/P0rNyIh5H60aNQa7immPUt4mmtr6dFPwVRQbzBAXHaJb/2a5cP4B5m1a R1nXf6E4J3h5xvJaYPA4opjlZ7HepS+JSMUz1DTxa1D3iIJKGKNmH/xyIxgJOhtBoorM RSP9Oxmnvrfw7fl7XHpnCw/VA6Pj4Tj0mVyjK6F7ktHPevIoE24PTD78vIwFCYsdHVBP P5yw== X-Gm-Message-State: APjAAAX255PiSdQ6uK39VSrw3cB5ZRjCtg/p4H2BtH8gQwxT6ZoNSv1X e7s4xnthTVX65b6KlG+aEVNfsHlh33/J8VfTnBU= X-Received: by 2002:a02:ce52:: with SMTP id y18mr92451652jar.78.1564131162681; Fri, 26 Jul 2019 01:52:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Miklos Szeredi Date: Fri, 26 Jul 2019 10:52:31 +0200 Message-ID: Subject: Re: Question about vmsplice + SPLICE_F_GIFT To: Leonardo Bras Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Viro Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 23, 2019 at 10:33 PM Leonardo Bras wrote: > > Hello everybody, > > I am not sure if this is the right place to be asking this. If is not, > I apologize for the inconvenience. Also, please tell me where is a > better way to as these questions. > > I am trying to create a basic C code to test vmsplice + SPLICE_F_GIFT > for moving memory pages between two processes without copying. > > I have followed the man pages and several recipes across the web, but I > could not reproduce it yet. > > Basically, I am doing: > Sending process: > - malloc + memcpy for generating pages to transfer > - vmsplice with SPLICE_F_GIFT sending over named pipe (in a loop) > Receiving process: > - Create mmaped file to receive the pages > - splice with SPLICE_F_MOVE receiving from named pipe (in a loop) As the splice(2) man page says SPLICE_F_MOVE is currently a no-op. > I have seen the SPLICE_F_MOVE being used on steal ops from the > 'pipebuffer', but I couldn't find a way to call it from splice. > > Questions: > It does what I think it does? (reassign memory pages from a process to > another) > If so, does page gifting still works? > If so, is there a basic recipe to test it's workings? What is the end goal? It is easy to transfer pages using shared memory (see shm_open(3) and related API), so why mess with splice? Thanks, Miklos