Re: [RFC -v2] kfifo writer side lock-less support
From: Stefani Seibold
Date: Tue Aug 24 2010 - 15:14:05 EST
> > > The patch adds only 1 field (unsigned int) to struct __kfifo. I think
> > > that should be acceptable. Because sizeof(struct __kfifo) should be much
> > > smaller that __kfifo->mask + 1 in most cases.
> >
> > I don't know what you mean with "because sizeof(struct __kfifo) should
> > be much smaller that __kfifo->mask + 1 in most cases". I am convinced
> > that you did not really understand the kfifo code. sizeof(struct
> > __kfifo) is constant and __kfifo->mask + 1 is the fifo size in elements,
> > which is not constant. Before you answering study the code first!
> >
> > And is not acceptable to bload the struct __kfifo, because it will never
> > need by the most users.
>
> I mean, for most user, __kfifo->mask + 1 > sizeof(struct __kfifo), so
> another 4 bytes for each user is relatively small.
>
You have no idea. As i wrote you should study the code before answering!
sizeof(struct __kfifo) is always 20 bytes on a 32 bit cpu, and
kfifo->mask +1 depends on the size of the number of fifo elements and it
is an initialization parameter.
If you will be able to shrink the footprint of the struct __kfifo,
whithout wasting the code, you are welcome to do.
Currently you generate only a lot of hot air. The assertion in your
"number of elements or bytes for kfifo_in etc" thread was also wrong.
You should first study code and understand it.
Until you have can prove your assertion by measurements and working
patches, please stop bothering.
- Stefani
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/