[Top] [All Lists]

Re: Zero-copy Block IO with XFS

To: "Matthew Hodgson" <matthew@xxxxxxxxxxxxx>
Subject: Re: Zero-copy Block IO with XFS
From: "Bhagi rathi" <jahnu77@xxxxxxxxx>
Date: Tue, 11 Dec 2007 22:09:05 +0530
Cc: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=EoQhLH3d07lasgLt0Vbjoy2ne3lzjoRe1JHABrO0rLM=; b=sxv/wdEllur2XekfJdSeNrJU8xDS3qGSAn2U/x8ZPFAkqDGsSmZVduNp5wSwSKw9sBsJM8lhpsfJ/iG9UP7aI7O9u8s1eITWDhJ6Kgq9j/8hPCNEA3LOMY8x/BrMsrimyMu2ym0a+5poz+BZPCQmQHF6NgCVfHKteiYNswXuSF8=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=NGJzMK/4cjvR6/2vSznV6kV9IKLBAg1kms4ZelagjXp2dYgkUUFG/HOEXsAP2vocriYbmxbvL8qp3QmWBuZEpx1ORpFkKh224XwZql8t0Tz2lz9gR782fCf4QvVFunzM6ykEvmsvH2FrM+0/ubMgZYQetAxBNYV294/NpPwPZ9U=
In-reply-to: <475E76AB.705@xxxxxxxxxxxxx>
References: <475E76AB.705@xxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
On Dec 11, 2007 5:08 PM, Matthew Hodgson <matthew@xxxxxxxxxxxxx> wrote:

> Hi all,
> I'm experimenting with using XFS with a network block device (DST), and
> have come up against the problem that when writing data to the network,
> it uses kernel_sendpage to hand the page presented at the BIO layer to
> the network stack.  It then completes the block IO request.

 Actually,  you can pass a sendpage  read actor which takes a reference on
the page
 which ensures valid page exists with you. As long as you have ref on the
page and
 no truncate to the same file, you can safely access the file.  Once NIC
sends the
 data over wire, you can do put_page. This should work. By the way, linux
 does something similar to the above. Look into read actor of nfs server


> The problem arises when XFS proceeds to then reuse that page before the
> NIC actually sends it.  Particularly if TX checksumming or TCP
> segmentation is being offloaded to the NIC, it seems that the NIC will
> try to access to page after the BIO request has returned, and so operate
> on stale data.  I assume the same problem might happen in the case of
> TCP retransmits or similar.  The motivation for using sendpage rather
> than sendmsg (or using sendpage on a copy of the original page) is to
> try to ensure speed by a zero-copy path through the subsystem.
> Is there any way at all in which XFS would be able to (theoretically)
> expose an API to allow an underlying block device to retain ownership of
> pages until it's done with them, so as to avoid a potentially needless
> copy?  Or is there another way of achieving this?
> thanks in advance,
> Matthew.
> --
> Matthew Hodgson <matthew@xxxxxxxxxxxxx>
> Media & Systems Project Manager
> Tel: +44 (0) 845 666 7778
> http://www.mxtelecom.com

[[HTML alternate version deleted]]

<Prev in Thread] Current Thread [Next in Thread>