module reentrancy

From: Al Peat (al_kernel@yahoo.com)
Date: Fri Oct 06 2000 - 13:27:28 EDT

  • Next message: Petr Vandrovec: "page->mapping == NULL recreated without vmware..."

      I could use a little advice on reentrancy issues for
    modules.

      I have written a device driver that is nothing more
    than a circular FIFO buffer in memory. The read and
    write methods access user space, so I know that those
    sections of code need to be reentrant. Since the
    module represents one shared buffer, I use a couple of
    global variables to keep track of the begin and end of
    the buffer. I understand that the filp->private field
    provides some protection for reentrancy, but don't
    know if that is appropriate in this case. Would a
    rwlock be a good solution? The buffer is going to be
    used to collect some information from a modified IDE
    subsystem, so it will be written to many times in
    short periods of time, and thus needs to have
    efficient write methods.

      I've read all I could find on reentrancy in the
    kernel docs and in Alessandro Rubini's excellent book.
     Any other pointers to things I could read (or good
    examples of reentrant modules) would be appreciated.

      Thanks,
            Al

    __________________________________________________
    Do You Yahoo!?
    Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
    http://photos.yahoo.com/
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Fri Oct 06 2000 - 13:29:27 EDT