mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jens Gustedt <Jens.Gustedt@inria.fr>
To: musl@lists.openwall.com
Subject: [PATCH 0/7] V3 of the new lock algorithm
Date: Wed, 3 Jan 2018 14:20:18 +0100	[thread overview]
Message-ID: <cover.1514985618.git.Jens.Gustedt@inria.fr> (raw)

This patch series implements and applies the new internal lock
algorithm.

Patch 1 is the lock implementation itself. I hope this is fit for
1.19, now.

The patches 2-7 do some clean up and apply this lock algorithm to two
fields, where we had specialized lock implementations before:
condition variables and malloc.

In all of this I am still a bit uncomfortable with the double syscalls
to futex functions. We do that just because some older Linux versions
might not implement private futexes. I'd prefer if that could be
replaced by a read to a central variable instead of having a second
(conditional) syscall. Such a variable could be initialized during
thread-library initialization, I think.

Jens Gustedt (7):
  a new lock algorithm with lock value and congestion count in the same
    atomic int
  consistently use the LOCK an UNLOCK macros
  revise the definition of multiple basic locks in the code
  separate the fast parts of __lock and __unlock into a .h file that may
    be used by other TU
  use the new lock algorithm for malloc
  implement __unlock_requeue
  implement the local lock for condition variables with the new lock
    feature

 src/dirent/__dirent.h               |  2 +-
 src/exit/at_quick_exit.c            |  2 +-
 src/exit/atexit.c                   |  2 +-
 src/internal/__lock.h               | 29 ++++++++++++++++
 src/internal/libc.h                 |  3 ++
 src/internal/pthread_impl.h         | 10 ++++--
 src/locale/dcngettext.c             |  2 +-
 src/locale/locale_map.c             |  2 +-
 src/locale/setlocale.c              |  2 +-
 src/malloc/lite_malloc.c            |  2 +-
 src/malloc/malloc.c                 | 38 ++++++++-------------
 src/misc/syslog.c                   |  2 +-
 src/prng/random.c                   |  2 +-
 src/stdio/ofl.c                     |  2 +-
 src/thread/__lock.c                 | 66 +++++++++++++++++++++++++++++++++----
 src/thread/pthread_atfork.c         |  2 +-
 src/thread/pthread_cond_timedwait.c | 53 ++++++++++-------------------
 src/thread/pthread_create.c         |  6 ++--
 src/thread/pthread_detach.c         |  5 ++-
 src/thread/pthread_getschedparam.c  |  4 +--
 src/thread/pthread_kill.c           |  4 +--
 src/thread/pthread_setschedparam.c  |  4 +--
 src/thread/pthread_setschedprio.c   |  4 +--
 src/thread/sem_open.c               |  2 +-
 src/thread/synccall.c               |  2 +-
 src/time/__tz.c                     |  2 +-
 26 files changed, 156 insertions(+), 98 deletions(-)
 create mode 100644 src/internal/__lock.h

-- 
2.15.1


             reply	other threads:[~2018-01-03 13:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 13:20 Jens Gustedt [this message]
2018-01-03 13:17 ` [PATCH 3/7] revise the definition of multiple basic locks in the code Jens Gustedt
2018-01-03 13:17 ` [PATCH 5/7] use the new lock algorithm for malloc Jens Gustedt
2018-01-09 17:42   ` Rich Felker
2018-01-09 18:58     ` Jens Gustedt
2018-01-09 19:26       ` Rich Felker
2018-09-18 19:23         ` Rich Felker
2018-01-03 13:17 ` [PATCH 2/7] consistently use the LOCK an UNLOCK macros Jens Gustedt
2018-01-03 13:17 ` [PATCH 7/7] implement the local lock for condition variables with the new lock feature Jens Gustedt
2018-01-03 13:17 ` [PATCH 6/7] implement __unlock_requeue Jens Gustedt
2018-01-03 13:17 ` [PATCH 1/7] a new lock algorithm with lock value and congestion count in the same atomic int Jens Gustedt
2018-01-03 13:17 ` [PATCH 4/7] separate the fast parts of __lock and __unlock into a .h file that may be used by other TU Jens Gustedt
2018-01-09 17:41   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1514985618.git.Jens.Gustedt@inria.fr \
    --to=jens.gustedt@inria.fr \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).