Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1403705 > unrolled thread

Re: [patch V2 3/7] futex: Add op for hash preallocation

Started byPeter Zijlstra <peterz@infradead.org>
First post2016-05-19 14:30 +0200
Last post2016-05-19 21:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [patch V2 3/7] futex: Add op for hash preallocation Peter Zijlstra <peterz@infradead.org> - 2016-05-19 14:30 +0200
    Re: [patch V2 3/7] futex: Add op for hash preallocation Darren Hart <dvhart@infradead.org> - 2016-05-19 21:40 +0200

#1403705 — Re: [patch V2 3/7] futex: Add op for hash preallocation

FromPeter Zijlstra <peterz@infradead.org>
Date2016-05-19 14:30 +0200
SubjectRe: [patch V2 3/7] futex: Add op for hash preallocation
Message-ID<rAvfr-8bz-1@gated-at.bofh.it>
On Sat, May 07, 2016 at 10:47:38AM +0200, Thomas Gleixner wrote:
> On Fri, 6 May 2016, Darren Hart wrote:

> > So this seems like it could be tricky for the user as system libraries, like
> > glibc, make use of futexes. Can we guarantee that "sys_futex" is not called by
> > the time main() is called?
> 
> To the extent of my testing I never observed that the hash was automatically
> created when I called futex(PREALLOC) right away in main. But yes, that might
> need some thought.

I suspect that even if glibc uses futexes before main(), they will not
be contended, because, last time I checked, the C runtime environment is
very much single threaded unless explicitly made not so by the program.

In any case (re)hashing if the hash is empty is 'easy', if there's already state,
not so much.

[toc] | [next] | [standalone]


#1403938

FromDarren Hart <dvhart@infradead.org>
Date2016-05-19 21:40 +0200
Message-ID<rABXB-41A-23@gated-at.bofh.it>
In reply to#1403705
On Thu, May 19, 2016 at 02:28:49PM +0200, Peter Zijlstra wrote:
> On Sat, May 07, 2016 at 10:47:38AM +0200, Thomas Gleixner wrote:
> > On Fri, 6 May 2016, Darren Hart wrote:
> 
> > > So this seems like it could be tricky for the user as system libraries, like
> > > glibc, make use of futexes. Can we guarantee that "sys_futex" is not called by
> > > the time main() is called?
> > 
> > To the extent of my testing I never observed that the hash was automatically
> > created when I called futex(PREALLOC) right away in main. But yes, that might
> > need some thought.
> 
> I suspect that even if glibc uses futexes before main(), they will not
> be contended, because, last time I checked, the C runtime environment is
> very much single threaded unless explicitly made not so by the program.
> 
> In any case (re)hashing if the hash is empty is 'easy', if there's already state,
> not so much.

It certainly would be nice to be able to resize the hash if it's empty.

-- 
Darren Hart
Intel Open Source Technology Center

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web