lkml.org 
[lkml]   [2004]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: upcalls from kernel code to user space daemons
    Bernd Petrovitsch wrote:
    > On Mon, 2004-06-14 at 23:57, Chris Friesen wrote:
    > > Oliver Neukum wrote:
    > >
    > > > > userspace daemon loops on ioctl()
    > > > > kernel portion of ioctl call goes to sleep until something to do
    > > > > when needed, fill in data and return to userspace
    > > > > userspace does stuff, then passes data back down via ioctl()
    > > > > ioctl() puts userspace back to sleep and continues on with other
    > work
    > > >
    > > > You could just as well implement an ordinary read()
    > >
    > > Not quite. The userspace is passing data down as well. I don't know
    > how you'd
    > > do that with read().
    >
    > For this you use write().

    And you eat another syscall per userspace call. For the ioctl() case, you only
    need to issue a single call to ioctl(). You pass the result of the previous
    request down, and then when it returns you get the data for the next request.

    Although I have to admit it's not pretty, and the performance improvements may
    not be worth the obfuscation of the code.

    Chris
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:03    [W:0.031 / U:212.948 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site