Fwd: [RFC] Kernel shared variables

Konstantin Belousov kostikbel at gmail.com
Mon Jun 4 22:12:27 UTC 2012


On Mon, Jun 04, 2012 at 11:16:10PM +0200, Giovanni Trematerra wrote:
> On Mon, Jun 4, 2012 at 8:19 PM, Konstantin Belousov <kostikbel at gmail.com> wrote:
> > On Mon, Jun 04, 2012 at 11:01:57AM -0400, John Baldwin wrote:
> >> On Sunday, June 03, 2012 6:49:27 am Bruce Evans wrote:
> >> > On Sun, 3 Jun 2012, Konstantin Belousov wrote:
> 
> >> I think duplicating this logic in userland would just be wasteful.  I have
> >> a private fast gettimeofday() at my current job and it works by exporting
> >> the current timehands structure (well, the equivalent) to userland.  The
> >> userland bits then fetch a copy of the details and do the same as bintime().
> >> (I move the math (bintime_addx() and the multiply)) out of the loop however.
> > I started yesterday an implementation which uses shared page to export
> > some variant of timehands, and uses auxv to provide the libc with a pointer
> > to timehands when rdtsc is reasonable.
> >
> > I almost finished both 32bit and 64bit userspace, but there is
> > kernel-side work left. Is your implementation ready or close to be ready
> > for commit ? In other words, should I drop the efforts, or continue ?
> >
> 
> Hey wait, What are you doing?
> This is completely unfair. You didn't even review my patch.
I did. I am quite saddened if you did not note that I did reviewed your
patch.

> I really don't understand your way to completely ignore me and start implement
> yesterday something you didn't care about for more than 3 years.
> It costs me a lot of time and energy and I think I deserve more respect that
> just be ignored.

I did not ignored the problem for 3 years. In fact, I did some, IMO
non-trivial development moving the whole issue forward. In particular, I
developed the shared page infrastructure that are currently used (yes,
we already do have properly implemented shared page and sub-allocator
of memory from it). I did some relevant rtld and libc changes, in
particular, libc now have full access and uses auxv. So I consider this
statement as a form of insult.

I indeed never had much desire to delve into the timekeeping code.
But periodically raising discussions, and final flamefest about the
issue made me realize that I spent more efforts discussing the 'shared
page' 'idea' then it would be to implement fast gettimeofday() and
clock_gettime() using existing infrastructure.

Having my hands somewhat deep into our ABI/ELF everything, I very much want
to not paint myself into corner with unsustaining decisions that make
ABI maintainance problematic. So I decided to save my time and implement
it 'properly', to close the question and possibly remove the item from
the ideas page.

Please note that what I do now is still not a vdso. It does allow the
vdso to plug into the framework later, but currently I only plan to
reuse shared page and auxv transport to implement gettimeofday without
usermode->kernelmode trip.

If you want to do full-flesged vdso at once, I will be very much pleasured
and probably support this work technically. For posted patch, I do respond
with the NACK.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20120604/eced44e9/attachment.pgp


More information about the freebsd-arch mailing list