On Thu, Mar 22, 2012 at 11:17 AM, Mark Kampe <Mark.Kampe@xxxxxxxxxxxxx> wrote: > On 03/22/12 09:38, Colin McCabe wrote: >> An mmap'ed buffer, even a lockless one, is a simple beast. Do you >> really need a whole library just for that? Maybe I'm just >> old-fashioned. > > > IMHO, surprisingly few things involving large numbers of performance > critical threads turn out to be simple :-) For example: > > If we are logging a lot, buffer management has the potential > to become a bottle-neck ... so we need to be able to allocate > a record of the required size from the circular buffer > with atomic instructions (at least in non-wrap situations). > > But if records are allocated and then filled, we have to > consider how to handle the case where the filling is > delayed, and the reader catches up with an incomplete > log record (e.g. skip it, wait how long, ???). The easiest solution is to store pointers in the circular buffer rather than directly writing to it. Another solution would be epoch numbers that increment each time the log buffer wraps around. C. -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html