Commit Graph

27 Commits

Author SHA1 Message Date
skrll 79fb68b068 Deal with __MACHINE_STACK_GROWS_UP machines.
constify the other psize while I'm here.

Thanks to Christos for looking.
2011-12-06 21:15:39 +00:00
yamt 9647763d4a puffs_cc_yield: fix a cc leak. PR/44679 2011-11-02 16:43:04 +00:00
yamt 5c50d59d8b puffs__cc_destroy: clear PCC_HASCALLER. the caller info is not
necessarily relevant to the next life of the cc.  this also fixes
the failure of the assertion in the next line.
2011-03-04 09:47:47 +00:00
yamt 79d46db770 typo in a comment 2011-01-10 23:20:45 +00:00
pooka 71043aa4cb clear cached puffs_cc's in puffs_exit() 2008-08-11 16:23:37 +00:00
pooka 7602ecfa8f * make sure we come out of mainloop in the main context. otherwise in
certain cases the server would jump to hyperspace when unmounted
* sprinkle some debug prints
2008-08-11 15:59:01 +00:00
pooka 704ded372f Don't add asserts between testing and commit - especially not
if you're going to write "assert(foo = 0)"
2008-01-28 18:51:03 +00:00
pooka d1d05d65b9 Implement lazy contexts for file systems using puffs_mainloop().
Previously each request was executed on its own callcontext and
switched to every time the request was being processed.  Now requests
borrow the mainloop context and switch only if/when they yield.
This takes two context switches away from a file system request
bringing down the typical amounts 2->0 (e.g. dtfs) and 4->2 (e.g.
psshfs).

The interfaces for manually executing requests changed a bit:
puffs_dispatch_create() and puffs_dispatch_exec() must now be used.
They are not tested, as nothing in-tree wants them and I doubt
anyone else is really interested in them either.

Also do some misc code cleanup related to execution contexts.  The
"work-in-progress checkpoint" committed over a year ago was starting
to look slightly weed-infested.
2008-01-28 18:35:49 +00:00
pooka c142350bc6 Fix fakecc case.
Noticed by Pavel Jirout on current-users
2008-01-17 17:43:14 +00:00
pooka 614c59fcb2 Cache a number of execution contexts instead of re-initializing
them every time.  Speeds up pure in-memory file systems such as
sysctlfs or dtfs quite a bit.  For actual I/O-workhorses the result
is of course less tasty.
2008-01-16 21:29:59 +00:00
pooka 3a433fe13b Use PROT_NONE page to protect bottom of stack from overrun 2008-01-16 00:29:42 +00:00
pooka 08c7b6138e * nuke puffs_cc_get{specific,usermount} for good
* move prototypes for puffs_docc and puffs_dopufbuf into the
  public header, as they are should be exposed
2007-12-16 20:02:57 +00:00
pooka 61113f40fd Part 3/n of extensive changes to message handling:
Get rid of the original puffs_req(3) framework and use puffs_framebuf(3)
instead for file system requests.  It has the advantage of being
suitable for transporting a distributed message passing protocol
and therefore us being able to run the file system server on any
host.

Ok, puffs is not quite here yet: libpuffs needs to grow request
routing support and the message contents need to be munged into a
host independent format.  Saying which format would be telling,
but it might begin with an X, end in an L and have the 13th character
in the middle.  Keep an eye out for the sequels: Parts 3+m/n.
2007-12-04 21:24:10 +00:00
pooka aadcb17f11 * allocate pcc as a slice from the stack instead of allocating it
separately
* provide puffs_cc_getcc()

This is in preparation for the removal of you-should-guess-what as
an argument to routines here and there and everywhere.
2007-11-29 17:47:54 +00:00
pooka baea362887 Fix a few bugs and memleaks with the threading code. 2007-10-31 16:09:09 +00:00
pooka edb40ac9bf Add some very initial support for a threading worker model as an
alternative to the (vastly superior ;) continuation model.  This
is very preliminary stuff and not compiled by default (which it
even won't do without some other patches I cannot commit yet).

The raison d'commit of the patch is a snippet which ensures proper
in-order dispatching of all operations, including those which don't
require a response.  Previously many of them would be dispatched
simultaneosly, e.g. fsync and reclaim on the same node, which
obviously isn't all that nice for correct operation.
2007-10-26 17:35:01 +00:00
pooka cb50a739c3 mmap stacks, makes it possible to align them 2007-10-26 13:51:14 +00:00
pooka 753b7cae6e Add puffs_cc_schedule() which marks a pcc runnable and will pass
execution to it when in the main loop the next time.
2007-10-21 19:25:58 +00:00
pooka be98071c8c Always provide caller information from the kernel based on curlwp.
(but don't deprecate the old puffs_cid interface just yet)
2007-10-21 14:28:05 +00:00
pooka 33c91738e5 Part 1/n of some pretty extensive changes to how the kernel module
interacts with the userspace file server:

  * since the kernel-user communication is not purely request-response
    anymore (hasn't been since 2006), try to rename some "request" to
    "message".  more similar mangling will take place in the future.

  * completely rework how messages are allocated.  previously most of
    them were borrowed from the stack (originally *all* of them),
    but now always allocate dynamically.  this makes the structure
    of the code much cleaner.  also makes it possible to fix a
    locking order violation.  it enables plenty of future enhancements.

  * start generalizing the transport interface to be independent of puffs

  * move transport interface to read/write instead of ioctl.  the
    old one had legacy design problems, and besides, ioctl's suck.
    implement a very generic version for now; this will be
    worked on later hopefully some day reaching "highly optimized".

  * implement libpuffs support behind existing library request
    interfaces.  this will change eventually (I hate those interfaces)
2007-10-11 19:41:13 +00:00
pooka f8326bf98e Move puffs to a two clause license where it already isn't so. And
as agc pointed out, even files with the third clause were already
effectively two clause because of a slight bug in the language...
2007-06-06 01:54:59 +00:00
pooka 291fe845cd Step 3 and currently final step of a more general purpose event loop:
support removal and addition of i/o file descriptors on the fly.

* detect closed file descriptors
* automatically free waiters of a dead file descriptor
* give the file server the possibility to specify a callback which
  notifies of a dead file descriptor
* move loop function to be a property of the mainloop instead of
  framebuf (doesn't change effective behaviour)
* add the possibility to configure a timespec parameter which
  attempts to call the loop function periodically
* move the event loop functions from the puffs_framebuf namespace
  to puffs_framev to differential between pure memory management
  functions
2007-05-15 13:44:46 +00:00
pooka 7806d3dfc4 assert that yield/continue is done only with a real continuation 2007-05-10 12:36:44 +00:00
pooka 5d86889ea0 add puffs_cc_getspecific(pcc), which is shorthand for:
puffs_getspecific(puffs_cc_getusermount(pcc))
2007-04-19 14:45:03 +00:00
pooka 29d5922025 #include <ucontext.h> 2007-02-17 23:00:16 +00:00
pooka 7cc096d8ec * get rid of the mount callback; it's no great surprise to the
server that it needs to mount the file system backend if it wants
  to call mount
* provide some options for getmntopts(), assume that callers will parse
  command line (or fstab) args
* reorganize the puffs_cc interface just a bit, preparing for a bigger
  revamp later
2007-01-06 18:22:09 +00:00
pooka 184a7d787c checkpoint some experimental work-in-progress, namely:
Add support for having multiple outstanding operations.  This is done
by exposing enough interfaces so that it is convenient to have the
main event loop in the implementation itself and by providing a
continuation framework for convinient blocking and rescheduling.

works fine, but will undergo further cleanup & development
2006-12-29 15:28:11 +00:00