Re: Unit number allocation API

From: John Baldwin (jhb_at_FreeBSD.org)
Date: 09/30/04

  • Next message: John Baldwin: "Re: Unit number allocation API"
    To: freebsd-current@FreeBSD.org
    Date: Thu, 30 Sep 2004 14:09:25 -0400
    
    

    On Thursday 30 September 2004 03:06 am, Poul-Henning Kamp wrote:
    > I had this one out on arch@ previously. I'm very interested in informed
    > feedback on how we deal with locking for service api's like this.

    I would suggest that the caller should ask for a unit before it needs a lock
    and if it finds that it doesn't need the unit after all it can give it back
    in the error handling. That is, this is similar to malloc'ing a structure up
    front, then grabbing locks and making changes, then after releasing the lock
    free'ing the structure if it turned out we didn't need it.

    -- 
    John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
    "Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: John Baldwin: "Re: Unit number allocation API"

    Relevant Pages

    • Re: Unit number allocation API
      ... On Thursday 30 September 2004 03:06 am, Poul-Henning Kamp wrote: ... > I had this one out on arch@ previously. ... > feedback on how we deal with locking for service api's like this. ... I would suggest that the caller should ask for a unit before it needs a lock ...
      (freebsd-current)
    • Re: Unit number allocation API
      ... >> I had this one out on arch@ previously. ... >> feedback on how we deal with locking for service api's like this. ... >I would suggest that the caller should ask for a unit before it needs a lock ...
      (freebsd-current)
    • Re: Unit number allocation API
      ... >> I had this one out on arch@ previously. ... >> feedback on how we deal with locking for service api's like this. ... >I would suggest that the caller should ask for a unit before it needs a lock ...
      (freebsd-current)
    • Re: hugetlb demand paging patch part [2/3]
      ... > to lock the page, it's really gets in the way with the spin_lock as well. ... >> function from every arch, ... > That function has to go for demand paging, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] kernel/timer.c: xtime lock missing
      ... That is a very distant chain between where ... there is a problem here in that the lock is taken in arch code ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)