All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ihar `Philips` Filipau" <thephilips@gmail.com>
To: ray-gmail@madrabbit.org
Cc: "Evgeniy Polyakov" <johnpol@2ka.mipt.ru>, linux-kernel@vger.kernel.org
Subject: Re: [patch 00/13] Syslets, "Threadlets", generic AIO support, v3
Date: Sat, 3 Mar 2007 23:14:29 +0100	[thread overview]
Message-ID: <efa6f5910703031414m7fa70bean4fa33609eb01b62@mail.gmail.com> (raw)
In-Reply-To: <2c0942db0703031312g15726e69gcce7a1d0b955ab76@mail.gmail.com>

On 3/3/07, Ray Lee <madrabbit@gmail.com> wrote:
> On 3/3/07, Ihar `Philips` Filipau <thephilips@gmail.com> wrote:
> > What I'm trying to get to: keep things simple. The proposed
> > optimization by Ingo does nothing else but allowing AIO to probe file
> > cache - if data there to go with fast path. So why not to implement
> > what the people want - probing of cache? Because it sounds bad? But
> > they are in fact proposing precisely that just masked with "fast
> > threads".
>
>
> Servers want to never, ever block. Not on a socket, not on a stat, not
> on anything. (I have an embedded server I wrote that has to fork
> internally just to watch the damn serial port signals in parallel with
> handling network I/O, audio, and child processes that handle H323.)
> There's a lot of things that can block out there, and it's not just
> disk I/O.
>

Why select/poll/epoll/friends do not work? I have programmed on both
sides - user-space network servers and in-kernel network protocols -
and "never blocking" thing was implemented in *nix in the times I was
walking under table.

One can poll() more or less *any* device in system. With frigging
exception of - right - files. IOW for 75% of I/O problem doesn't
exists since there is proper interface - e.g. sockets - in place.

User-space-wise, check how squid (caching http proxy) does it: you
have several (forked) instances to serve network requests and you have
one/several disk I/O daemons. (So called "diskd storeio") Why? Because
you cannot poll() file descriptors, but you can poll unix socket
connected to diskd. If diskd blocks, squid still can serve requests.
How threadlets are better then pool of diskd instances? All nastiness
of shared memory set loose...

What I'm trying to get to. Threadlets wouldn't help existing
single-threaded applications - what is about 95% of all applications.
And multi-threaded applications would gain little because few real
application create threads dynamically: creation need resources and
can fail, uncontrollable thread spawning hurts overall manageability
and additional care is needed regarding deadlocks/lock contentions
proofing. (The category of applications which want the performance
gain are also the applications which need to ensure greater stability
over long non-stop runs. Uncontrollable dynamism helps nothing.)

Having implemented several "file servers" - daemons serving file I/O
to other daemons - I honestly hardly see any improvements. Now people
configure such file servers to issue e.g. 10 file operations
simultaneously - using pool of 10 threads. What threadlets change? In
the end just to keep in check with threadlets I would need to issue
pthread_join() after some number of threadlets created. And the latter
number is the former "e.g. 10". IOW, programmer-wise the
implementation remain same - and all the limitations remain the same.
And all overhead of user-space locking remain the same. (*)

What's more, as having some limited experience of kernel programming,
I fail to see what threadlets would simplify on kernel side. End
result as I see it: user space becomes bit more complicated because of
dynamic multi-threading and kernel-space becomes also more complicated
because of the same added dynamism.

(*) Hm... On other side, if application would be able to tell kernel
to limit number of issued threadlets to N, then it might simplify the
job. Application can tell kernel "I need at most 10 blocking
threadlets, block me if there are more" and then dumbly throw I/O
threadlets at kernel as they are coming in. And kernel would then put
process to sleep if N+1 thredlets are blocking. That would definitely
simplify the job in user-space: it wouldn't need to call
pthread_join(). But it is still no replacement to poll()able file
descriptor or truly async mmap().

-- 
Don't walk behind me, I may not lead.
Don't walk in front of me, I may not follow.
Just walk beside me and be my friend.
    -- Albert Camus (attributed to)

  reply	other threads:[~2007-03-03 22:14 UTC|newest]

Thread overview: 277+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <efa6f5910703021120ia0b8d18ne0c806eb2e73da4c@mail.gmail.com>
     [not found] ` <20070303103427.GC22557@2ka.mipt.ru>
2007-03-03 10:58   ` [patch 00/13] Syslets, "Threadlets", generic AIO support, v3 Ihar `Philips` Filipau
2007-03-03 11:03     ` Evgeniy Polyakov
2007-03-03 11:51       ` Ihar `Philips` Filipau
2007-03-03 21:12     ` Ray Lee
2007-03-03 22:14       ` Ihar `Philips` Filipau [this message]
2007-03-03 23:54         ` Ray Lee
2007-03-04  9:33       ` Michael K. Edwards
2007-02-27 14:15 Al Boldi
  -- strict thread matches above, loose matches on Subject: below --
2007-02-27 14:15 Al Boldi
2007-02-27 19:22 ` Theodore Tso
2007-03-01 10:21 ` Pavel Machek
2007-02-25 19:11 Al Boldi
2007-02-25 19:10 Al Boldi
2007-02-22 12:27 linux
2007-02-22 13:40 ` David Miller
2007-02-22 23:52   ` linux
2007-02-21 21:13 Ingo Molnar
2007-02-21 22:46 ` Michael K. Edwards
2007-02-21 22:57   ` Ingo Molnar
2007-02-22  0:53     ` Michael K. Edwards
2007-02-22  1:33       ` Michael K. Edwards
2007-02-22  6:51       ` Ingo Molnar
2007-02-22  8:59         ` Michael K. Edwards
2007-02-21 23:03   ` Ingo Molnar
2007-02-21 23:24   ` Ingo Molnar
2007-02-22  0:55     ` Michael K. Edwards
2007-02-21 23:31   ` Ingo Molnar
2007-02-21 23:46     ` Ulrich Drepper
2007-02-22  7:40       ` Ingo Molnar
2007-02-22 11:31         ` Evgeniy Polyakov
2007-02-22 11:52           ` Arjan van de Ven
2007-02-22 12:39             ` Evgeniy Polyakov
2007-02-22 13:41               ` David Miller
2007-02-22 14:31                 ` Ingo Molnar
2007-02-22 14:47                   ` David Miller
2007-02-22 15:02                     ` Evgeniy Polyakov
2007-02-22 15:15                     ` Ingo Molnar
2007-02-22 15:29                       ` Ingo Molnar
2007-02-22 17:17                       ` David Miller
2007-02-23 11:12                         ` Ingo Molnar
2007-02-22 20:13                     ` Davide Libenzi
2007-02-22 21:30                     ` Zach Brown
2007-02-22 14:59                   ` Ingo Molnar
2007-02-22 21:42                   ` Michael K. Edwards
2007-02-22 14:53                 ` Avi Kivity
2007-02-22 12:59           ` Ingo Molnar
2007-02-22 13:32             ` Evgeniy Polyakov
2007-02-22 19:46               ` Davide Libenzi
2007-02-23 12:15                 ` Evgeniy Polyakov
2007-02-23 17:43                   ` Davide Libenzi
2007-02-23 18:01                     ` Evgeniy Polyakov
2007-02-23 20:43                       ` Davide Libenzi
2007-02-23 11:51               ` Ingo Molnar
2007-02-23 12:22                 ` Evgeniy Polyakov
2007-02-23 12:41                   ` Evgeniy Polyakov
2007-02-25 17:45                   ` Ingo Molnar
2007-02-25 18:09                     ` Evgeniy Polyakov
2007-02-25 19:04                       ` Ingo Molnar
2007-02-25 19:42                         ` Evgeniy Polyakov
2007-02-25 20:38                           ` Ingo Molnar
2007-02-26 12:39                           ` Ingo Molnar
2007-02-26 14:05                             ` Evgeniy Polyakov
2007-02-26 14:15                               ` Ingo Molnar
2007-02-26 16:55                                 ` Evgeniy Polyakov
2007-02-26 20:35                                   ` Ingo Molnar
2007-02-26 22:06                                     ` Bill Huey
2007-02-27 10:09                                     ` Evgeniy Polyakov
2007-02-27 17:13                                     ` Pavel Machek
2007-02-27  2:18                                   ` Davide Libenzi
2007-02-27 10:13                                     ` Evgeniy Polyakov
2007-02-27 16:01                                       ` Davide Libenzi
2007-02-27 16:21                                         ` Evgeniy Polyakov
2007-02-27 16:58                                           ` Eric Dumazet
2007-02-27 17:06                                             ` Evgeniy Polyakov
2007-02-27 19:20                                           ` Davide Libenzi
2007-02-26 19:47                           ` Davide Libenzi
2007-02-25 23:14                         ` Michael K. Edwards
2007-02-22 14:17             ` Suparna Bhattacharya
2007-02-22 14:36               ` Ingo Molnar
2007-02-23 14:23                 ` Suparna Bhattacharya
2007-02-22 21:24             ` Michael K. Edwards
2007-02-23  0:30               ` Alan
2007-02-23  2:47                 ` Michael K. Edwards
2007-02-23  8:31                   ` Michael K. Edwards
2007-02-23 10:22                   ` Ingo Molnar
2007-02-23 12:37                   ` Alan
2007-02-23 23:49                     ` Michael K. Edwards
2007-02-24  1:08                       ` Alan
2007-02-24  0:51                         ` Michael K. Edwards
2007-02-24  2:17                           ` Michael K. Edwards
2007-02-24  3:25                           ` Michael K. Edwards
2007-02-23 12:17               ` Ingo Molnar
2007-02-24 19:52                 ` Michael K. Edwards
2007-02-24 21:04                   ` Davide Libenzi
2007-02-24 23:01                     ` Michael K. Edwards
2007-02-25 22:44           ` Linus Torvalds
2007-02-26 13:11             ` Ingo Molnar
2007-02-26 17:37               ` Evgeniy Polyakov
2007-02-26 18:19                 ` Arjan van de Ven
2007-02-26 18:38                   ` Evgeniy Polyakov
2007-02-26 18:56                     ` Chris Friesen
2007-02-26 19:20                       ` Evgeniy Polyakov
2007-02-26 17:28             ` Evgeniy Polyakov
2007-02-26 17:57               ` Linus Torvalds
2007-02-26 18:32                 ` Evgeniy Polyakov
2007-02-26 19:22                   ` Linus Torvalds
2007-02-26 19:30                     ` Evgeniy Polyakov
2007-02-26 20:04                       ` Linus Torvalds
2007-02-27  8:09                         ` Evgeniy Polyakov
2007-02-26 19:54                 ` Ingo Molnar
2007-02-27 10:28                   ` Evgeniy Polyakov
2007-02-27 11:52                     ` Theodore Tso
2007-02-27 12:11                       ` Evgeniy Polyakov
2007-02-27 12:13                         ` Ingo Molnar
2007-02-27 12:40                           ` Evgeniy Polyakov
2007-02-28 16:14                         ` Pavel Machek
2007-03-01  8:18                           ` Evgeniy Polyakov
2007-03-01  9:26                             ` Pavel Machek
2007-03-01  9:47                               ` Evgeniy Polyakov
2007-03-01  9:54                                 ` Ingo Molnar
2007-03-01 10:59                                   ` Evgeniy Polyakov
2007-03-01 11:00                                     ` Ingo Molnar
2007-03-01 11:16                                       ` Evgeniy Polyakov
2007-03-01 11:27                                         ` Ingo Molnar
2007-03-01 11:36                                           ` Evgeniy Polyakov
2007-03-01 11:41                                         ` Ingo Molnar
2007-03-01 11:47                                           ` Ingo Molnar
2007-03-01 12:10                                             ` Evgeniy Polyakov
2007-03-01 12:43                                               ` Ingo Molnar
2007-03-01 13:01                                                 ` Evgeniy Polyakov
2007-03-01 13:11                                                   ` Ingo Molnar
2007-03-01 13:30                                                     ` Evgeniy Polyakov
2007-03-01 14:19                                                       ` Eric Dumazet
2007-03-01 14:16                                                         ` Ingo Molnar
2007-03-01 14:31                                                           ` Eric Dumazet
2007-03-01 14:27                                                             ` Ingo Molnar
2007-03-01 14:54                                                           ` Evgeniy Polyakov
2007-03-01 15:09                                                             ` Ingo Molnar
2007-03-01 15:36                                                               ` Evgeniy Polyakov
2007-03-02 10:57                                                                 ` Ingo Molnar
2007-03-02 11:48                                                                   ` Evgeniy Polyakov
2007-03-02 17:32                                                                   ` Davide Libenzi
2007-03-02 19:39                                                                     ` Ingo Molnar
2007-03-02 20:18                                                                       ` Davide Libenzi
2007-03-02 20:29                                                                         ` Ingo Molnar
2007-03-02 20:53                                                                           ` Davide Libenzi
2007-03-02 21:21                                                                             ` Michael K. Edwards
2007-03-02 21:43                                                                             ` Nicholas Miell
2007-03-03  0:52                                                                               ` Davide Libenzi
2007-03-03  1:36                                                                                 ` Nicholas Miell
2007-03-03  1:48                                                                                   ` Benjamin LaHaise
2007-03-03  2:19                                                                                   ` Davide Libenzi
2007-03-03  7:19                                                                                     ` Ingo Molnar
2007-03-03  7:20                                                                                       ` Ingo Molnar
2007-03-03  9:02                                                                                       ` Davide Libenzi
2007-03-01 19:31                                                             ` Davide Libenzi
2007-03-02  8:10                                                               ` Evgeniy Polyakov
2007-03-02 17:13                                                                 ` Davide Libenzi
2007-03-02 19:13                                                                   ` Davide Libenzi
2007-03-03 10:06                                                                   ` Evgeniy Polyakov
2007-03-03 18:46                                                                     ` Davide Libenzi
2007-03-03 20:31                                                                       ` Evgeniy Polyakov
2007-03-03 21:57                                                                         ` Davide Libenzi
2007-03-03 22:10                                                                           ` Davide Libenzi
2007-03-04 16:23                                                                           ` Kirk Kuchov
2007-03-04 17:46                                                                             ` Kyle Moffett
2007-03-05  5:23                                                                               ` Michael K. Edwards
2007-03-04 21:17                                                                             ` Davide Libenzi
2007-03-04 22:49                                                                               ` Kirk Kuchov
2007-03-04 22:57                                                                                 ` Davide Libenzi
2007-03-05  4:46                                                                                 ` Magnus Naeslund(k)
2007-03-06  8:19                                                                                 ` Pavel Machek
2007-03-07 12:02                                                                                   ` Kirk Kuchov
2007-03-07 17:26                                                                                     ` Linus Torvalds
2007-03-07 17:39                                                                                     ` Ingo Molnar
2007-03-07 18:21                                                                                       ` Kirk Kuchov
2007-03-07 18:24                                                                                         ` Jens Axboe
2007-03-07 18:32                                                                                         ` Evgeniy Polyakov
2007-03-01 12:01                                           ` Evgeniy Polyakov
2007-03-01 11:14                                     ` Eric Dumazet
2007-03-01 11:20                                       ` Evgeniy Polyakov
2007-03-01 11:28                                         ` Eric Dumazet
2007-03-01 11:47                                           ` Evgeniy Polyakov
2007-03-01 13:12                                             ` Eric Dumazet
2007-03-01 14:43                                               ` Evgeniy Polyakov
2007-03-01 14:47                                                 ` Ingo Molnar
2007-03-01 15:23                                                   ` Evgeniy Polyakov
2007-03-01 15:32                                                     ` Eric Dumazet
2007-03-01 15:41                                                       ` Eric Dumazet
2007-03-01 15:51                                                         ` Evgeniy Polyakov
2007-03-01 15:47                                                       ` Evgeniy Polyakov
2007-03-01 19:47                                                       ` Davide Libenzi
2007-03-01 14:57                                                 ` Evgeniy Polyakov
2007-03-01 12:19                                           ` Evgeniy Polyakov
2007-03-01 12:34                                     ` Ingo Molnar
2007-03-01 13:26                                       ` Evgeniy Polyakov
2007-03-01 13:32                                         ` Ingo Molnar
2007-03-01 14:24                                           ` Evgeniy Polyakov
2007-03-01 16:56                                     ` David Lang
2007-03-01 17:56                                       ` Evgeniy Polyakov
2007-03-01 18:41                                         ` David Lang
2007-03-01 19:19                                   ` Davide Libenzi
2007-03-01 10:11                                 ` Pavel Machek
2007-03-01 10:19                                   ` Ingo Molnar
2007-03-01 11:18                                   ` Evgeniy Polyakov
2007-03-02 10:27                                     ` Pavel Machek
2007-03-02 10:37                                       ` Evgeniy Polyakov
2007-03-02 10:56                                         ` Ingo Molnar
2007-03-02 11:08                                           ` Evgeniy Polyakov
2007-03-02 17:28                                             ` Davide Libenzi
2007-03-03 10:27                                               ` Evgeniy Polyakov
2007-03-01 19:24                             ` Johann Borck
2007-03-01 19:37                               ` David Lang
2007-03-01 20:34                                 ` Johann Borck
2007-02-27 12:34                       ` Ingo Molnar
2007-02-27 13:14                         ` Evgeniy Polyakov
2007-02-27 13:32                         ` Avi Kivity
2007-02-28  3:03                       ` Michael K. Edwards
2007-02-28  8:02                         ` Evgeniy Polyakov
2007-02-28 17:01                           ` Michael K. Edwards
2007-02-28 16:38                         ` Phillip Susi
2007-02-22 19:38         ` Davide Libenzi
2007-02-28  9:45           ` Ingo Molnar
2007-02-28 16:17             ` Davide Libenzi
2007-02-28 16:42               ` Linus Torvalds
2007-02-28 17:26                 ` Ingo Molnar
2007-02-28 18:22                 ` Davide Libenzi
2007-02-28 18:42                   ` Linus Torvalds
2007-02-28 18:50                     ` Davide Libenzi
2007-02-28 19:03                       ` Chris Friesen
2007-02-28 19:42                         ` Davide Libenzi
2007-03-01  8:38                           ` Evgeniy Polyakov
2007-03-01  9:28                             ` Evgeniy Polyakov
2007-02-28 23:12                 ` Ingo Molnar
2007-03-01  1:33                   ` Andrea Arcangeli
2007-03-01  9:15                     ` Evgeniy Polyakov
2007-03-01 21:27                   ` Linus Torvalds
2007-02-28 20:21               ` Ingo Molnar
2007-02-28 21:09                 ` Davide Libenzi
2007-02-28 21:23                   ` Ingo Molnar
2007-02-28 21:46                     ` Davide Libenzi
2007-02-28 22:22                       ` Ingo Molnar
2007-02-28 22:47                         ` Davide Libenzi
2007-02-22 21:23         ` Zach Brown
2007-02-22 21:32           ` Benjamin LaHaise
2007-02-22 21:44             ` Zach Brown
2007-02-22  1:04     ` Michael K. Edwards
2007-02-22  7:00       ` Ingo Molnar
2007-02-22  9:29         ` Michael K. Edwards
2007-02-22 10:01 ` Suparna Bhattacharya
2007-02-22 11:20   ` Ingo Molnar
2007-02-24 18:34 ` Evgeniy Polyakov
2007-02-25 17:23   ` Ingo Molnar
2007-02-25 17:44     ` Evgeniy Polyakov
2007-02-25 17:54       ` Ingo Molnar
2007-02-25 18:21         ` Evgeniy Polyakov
2007-02-25 18:22           ` Ingo Molnar
2007-02-25 18:37             ` Evgeniy Polyakov
2007-02-25 18:34               ` Ingo Molnar
2007-02-25 20:01                 ` Frederik Deweerdt
2007-02-25 19:21               ` Ingo Molnar
     [not found]                 ` <20070225194645.GB1353@2ka.mipt.ru>
     [not found]                   ` <20070225195308.GC15681@elte.hu>
     [not found]                     ` <Pine.LNX.4.64.0702251232350.6011@alien.or.mcafeemobile.com>
2007-02-26  8:16                       ` Ingo Molnar
2007-02-26  9:25                         ` Evgeniy Polyakov
2007-02-26  9:55                           ` Ingo Molnar
2007-02-26 10:31                             ` Ingo Molnar
2007-02-26 10:43                               ` Evgeniy Polyakov
2007-02-26 20:02                               ` Davide Libenzi
2007-02-26 10:33                             ` Evgeniy Polyakov
2007-02-26 10:35                               ` Ingo Molnar
2007-02-26 10:47                                 ` Evgeniy Polyakov
2007-02-26 12:51                                   ` Ingo Molnar
2007-02-26 16:46                                     ` Evgeniy Polyakov
2007-02-27  6:24                                       ` Ingo Molnar
2007-02-27 10:41                                         ` Evgeniy Polyakov
2007-02-27 10:49                                           ` Ingo Molnar
2007-02-25 18:25           ` Evgeniy Polyakov
2007-02-25 18:24             ` Ingo Molnar

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=efa6f5910703031414m7fa70bean4fa33609eb01b62@mail.gmail.com \
    --to=thephilips@gmail.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ray-gmail@madrabbit.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.