public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jakob Østergaard" <jakob@unthought.net>
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: davem@redhat.com, ak@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] zerocopy NFS updated
Date: Thu, 18 Apr 2002 09:58:13 +0200	[thread overview]
Message-ID: <20020418095813.A28396@unthought.net> (raw)
In-Reply-To: <20020414.212308.33849971.davem@redhat.com> <20020416.100302.129343787.taka@valinux.co.jp> <20020416034120.R18116@unthought.net> <20020418.140155.85418444.taka@valinux.co.jp>

On Thu, Apr 18, 2002 at 02:01:55PM +0900, Hirokazu Takahashi wrote:
> Hi,
> 
> I've been thinking about your comment, and I realized it was a good
> suggestion.
> There are no problem with the zerocopy NFS, but If you want to
> use UDP sendfile for streaming or something like that, you wouldn't
> get good performance.

Hi again,

So the problem is, that it is too easy to use UDP sendfile "poorly", right?

Your NFS threads don't have the problem because you make sure that pages are in
core prior to the sendfile call, but not every developer may think that far...

...
> 
> Shall I make a multiple queue based on pid instead of destitation address ?
> Any idea is welcome!

Ok, so here's some ideas. I'm no expert so if something below seems subtle,
it's more likely to be plain stupid rather than something really clever  ;) 


In order to keep sendfile as simple as possible, perhaps one could just make
it fail if not all pages are in core.

So, your NFS send routine would be something like


retry:
  submit_read_requests
  await_io_completion

  rc = sendfile(..)
  if (rc == -EFAULT)
    goto retry

(I suppose even the retry is optional - this being UDP, the packet could be
 dropped anywhere anyway. The rationale behind retrying immediately is, that
 "almost" all pages probably are in core)

That would keep sendfile simple, and force it's users to think of a clever
way to make sure the pages are ready (and about what to do if they aren't).


This is obviously not something one can do from userspace. There, I think that
your suggestion with a queue per pid seems like a nice solution.  What I worry
about is, if the machine is under heavy memory pressure and the queue entries
start piling up - if sendfile is not clever (or somehow lets the VM figure out
what to do with the requests), the queues will be competing against eachother,
taking even longer to finish...

Perhaps userspace would call some sendfile wrapper routine that would do the
queue management, while kernel threads that are sufficiently clever by
themselves will just call the lightweight sendfile.

Or, will the queue management be simpler and less dangerous than I think ?  :)


Cheers,

-- 
................................................................
:   jakob@unthought.net   : And I see the elder races,         :
:.........................: putrid forms of man                :
:   Jakob Østergaard      : See him rise and claim the earth,  :
:        OZ9ABN           : his downfall is at hand.           :
:.........................:............{Konkhra}...............:

  reply	other threads:[~2002-04-18  7:58 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20020410.190550.83626375.taka@valinux.co.jp.suse.lists.linux.kernel>
2002-04-10 19:32 ` [PATCH] zerocopy NFS updated Andi Kleen
2002-04-11  2:30   ` David S. Miller
2002-04-11  6:46     ` Hirokazu Takahashi
2002-04-11  6:48       ` David S. Miller
2002-04-11  7:41         ` Hirokazu Takahashi
2002-04-11  7:52           ` David S. Miller
2002-04-11 11:38             ` Hirokazu Takahashi
2002-04-11 11:36               ` David S. Miller
2002-04-11 18:00                 ` Denis Vlasenko
2002-04-11 13:16                   ` Andi Kleen
2002-04-11 17:36                     ` Benjamin LaHaise
2002-04-16  0:17                     ` Mike Fedyk
2002-04-16 15:37                       ` Oliver Xymoron
2002-04-11 17:33             ` Benjamin LaHaise
2002-04-12  8:10               ` Hirokazu Takahashi
2002-04-12 12:30         ` Hirokazu Takahashi
2002-04-12 12:35           ` Andi Kleen
2002-04-12 21:22             ` Jamie Lokier
2002-04-12 21:31               ` David S. Miller
2002-04-13  0:21                 ` Jamie Lokier
2002-04-13  6:39                   ` Andi Kleen
2002-04-13  8:01                     ` Hirokazu Takahashi
2002-04-13 19:19                     ` Eric W. Biederman
2002-04-13 19:37                       ` Andi Kleen
2002-04-13 20:34                         ` Eric W. Biederman
2002-04-24 23:11                           ` Mike Fedyk
2002-04-25 17:11                             ` Andreas Dilger
2002-04-13 18:52                 ` Chris Wedgwood
2002-04-14  0:07                   ` Keith Owens
2002-04-14  8:19                     ` Chris Wedgwood
2002-04-14  8:40                       ` Keith Owens
2002-04-12 21:39             ` David S. Miller
2002-04-15  1:30               ` Hirokazu Takahashi
2002-04-15  4:23                 ` David S. Miller
2002-04-16  1:03                   ` Hirokazu Takahashi
2002-04-16  1:41                     ` Jakob Østergaard
2002-04-16  2:20                       ` Hirokazu Takahashi
2002-04-18  5:01                       ` Hirokazu Takahashi
2002-04-18  7:58                         ` Jakob Østergaard [this message]
2002-04-18  8:53                         ` Trond Myklebust
2002-04-19  3:21                           ` Hirokazu Takahashi
2002-04-19  9:18                             ` Trond Myklebust
2002-04-20  7:47                               ` Hirokazu Takahashi
2002-04-25 12:37                                 ` Possible bug with UDP and SO_REUSEADDR. Was " Terje Eggestad
2002-04-26  2:43                                   ` David S. Miller
2002-04-26  7:38                                     ` Terje Eggestad
2002-04-29  0:41                                     ` Possible bug with UDP and SO_REUSEADDR David Schwartz
2002-04-29  8:06                                       ` Terje Eggestad
2002-04-29  8:44                                         ` David Schwartz
2002-04-29 10:03                                           ` Terje Eggestad
2002-04-29 10:38                                             ` David Schwartz
2002-04-29 14:20                                               ` Terje Eggestad
     [not found]                               ` <200204192128.QAA24592@popmail.austin.ibm.com>
2002-04-20 10:14                                 ` [PATCH] zerocopy NFS updated Hirokazu Takahashi
2002-04-20 15:49                                   ` Andrew Theurer
2002-04-10 10:05 Hirokazu Takahashi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020418095813.A28396@unthought.net \
    --to=jakob@unthought.net \
    --cc=ak@suse.de \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=taka@valinux.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox