Re: Improving bus/resource API

From: Doug Rabson (dfr_at_nlsystems.com)
Date: 09/20/05

  • Next message: M. Warner Losh: "Re: Improving bus/resource API"
    Date: Tue, 20 Sep 2005 16:55:54 +0100
    To: John Baldwin <jhb@freebsd.org>
    
    

    On 20 Sep 2005, at 15:45, John Baldwin wrote:

    > On Tuesday 20 September 2005 07:20 am, Poul-Henning Kamp wrote:
    >
    >> The patch below improves the bus/resource API such that between 10
    >> and 20 lines of code can be eliminated from the attach/detach
    >> functions of the average device driver.
    >>
    >> Therefore the best place to start is to read what the patch does
    >> to if_sis.c, which is a very typical case.
    >>
    >> The patch is backwards compatible in binary and source form so
    >> it is a potential candidate for RELENG_6 at some point.
    >>
    >> Compile tested on i386/amd64 and sparc64. My alpha will be chewing
    >> on it for the forseeable future.
    >>
    >>
    >> For sanity in the ensuing bikeshed, let's take three topics in
    >> this order:
    >>
    >> 1. "what this does to the device driver sources."
    >>
    >> 2. "what this does to the rman/bus internals"
    >>
    >> 3. "suggestions for different function names"
    >>
    >
    > I'll only comment on 3)
    >
    > Maybe bus_read_{1,2,4}() rather than bsr_? (Same with s/bsw_/
    > bus_write_/). I
    > do like having the accessors take just a resource rather than a
    > tag, handle
    > pair. Many drivers already hide this in wrapper macros already
    > though.
    >
    > For the dwiw (dwim? :-P) maybe since it takes an array, just make the
    > 'resource' part plural, thus 'bus_alloc_resources()' and
    > 'bus_release_resources()'?

    I like these names.

    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"


  • Next message: M. Warner Losh: "Re: Improving bus/resource API"

    Relevant Pages

    • Re: Improving bus/resource API
      ... > The patch below improves the bus/resource API such that between 10 ... > functions of the average device driver. ... do like having the accessors take just a resource rather than a tag, ...
      (freebsd-arch)
    • [RFC] [PATCH] Avoid livelock for fsync
      ... only tagged pages (see the patch for details). ... We track dirty time on per-inode basis only because keeping it ... Tag all pages that should be written back ... rather quickly and thus livelocks should not happen in practice. ...
      (Linux-Kernel)
    • Re: [ckrm-tech] [RFC][PATCH 2/7] UBC: core (structures, API)
      ... Matt Helsley wrote: ... +struct user_beancounter ub0; ... You haven't explained what an luid is at this point in the patch series. ... So we create one beancounter object for every resource the user's tasks ...
      (Linux-Kernel)
    • Re: [RFC] [PATCH] Avoid livelock for fsync
      ... only tagged pages (see the patch for details). ... We track dirty time on per-inode basis only because keeping it ... * that have DIRTY tag set with a special TOWRITE tag. ...
      (Linux-Kernel)
    • Re: aim7 -30% regression in 2.6.24-rc1
      ... I got the tag from #git log. ... so readers could check the patch by clicking. ... I will do a bisect between 2.6.23 and tag 9c63d9c021f375a2708ad79043d6f4dd1291a085. ... It looks like at least 2 patches were responsible for the regression. ...
      (Linux-Kernel)

  • Quantcast