public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: [PATCH 1/4] libio: Assume _IO_lock_inexpensive
Date: Thu, 27 May 2021 17:44:54 -0300	[thread overview]
Message-ID: <20210527204457.1250196-2-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20210527204457.1250196-1-adhemerval.zanella@linaro.org>

It is already set by both Linux and Hurd.
---
 libio/libio.h             | 11 ++---------
 sysdeps/mach/libc-lock.h  |  3 ---
 sysdeps/nptl/stdio-lock.h |  3 ---
 3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/libio/libio.h b/libio/libio.h
index 511b39457f..be2cde61e2 100644
--- a/libio/libio.h
+++ b/libio/libio.h
@@ -282,17 +282,10 @@ libc_hidden_proto (_IO_sgetn)
 # undef _IO_ftrylockfile
 
 # define _IO_peekc(_fp) _IO_peekc_locked (_fp)
-# if _IO_lock_inexpensive
-#  define _IO_flockfile(_fp) \
+# define _IO_flockfile(_fp) \
   if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_lock (*(_fp)->_lock)
-#  define _IO_funlockfile(_fp) \
+# define _IO_funlockfile(_fp) \
   if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_unlock (*(_fp)->_lock)
-# else
-#  define _IO_flockfile(_fp) \
-  if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_flockfile (_fp)
-#  define _IO_funlockfile(_fp) \
-  if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_funlockfile (_fp)
-# endif
 #endif /* _IO_MTSAFE_IO */
 
 #endif /* _LIBIO_H */
diff --git a/sysdeps/mach/libc-lock.h b/sysdeps/mach/libc-lock.h
index d713f34b5f..220fcee921 100644
--- a/sysdeps/mach/libc-lock.h
+++ b/sysdeps/mach/libc-lock.h
@@ -24,9 +24,6 @@
 #include <tls.h>
 #include <lowlevellock.h>
 
-/* The locking here is very inexpensive, even for inlining.  */
-#define _IO_lock_inexpensive   1
-
 typedef unsigned int __libc_lock_t;
 typedef struct
 {
diff --git a/sysdeps/nptl/stdio-lock.h b/sysdeps/nptl/stdio-lock.h
index f2eee49816..a4f419b516 100644
--- a/sysdeps/nptl/stdio-lock.h
+++ b/sysdeps/nptl/stdio-lock.h
@@ -23,9 +23,6 @@
 #include <lowlevellock.h>
 
 
-/* The locking here is very inexpensive, even for inlining.  */
-#define _IO_lock_inexpensive	1
-
 typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
 #define _IO_lock_t_defined 1
 
-- 
2.30.2


  reply	other threads:[~2021-05-27 20:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 20:44 [PATCH 0/4] Move libio lock single-thread optimization to generic libc-lock Adhemerval Zanella
2021-05-27 20:44 ` Adhemerval Zanella [this message]
2021-05-30 13:11   ` [PATCH 1/4] libio: Assume _IO_lock_inexpensive Florian Weimer
2021-05-27 20:44 ` [PATCH 2/4] libio: Assume _IO_MTSAFE_IO Adhemerval Zanella
2021-05-27 21:38   ` Andreas Schwab
2021-05-27 20:44 ` [PATCH 3/4] Consolidate stdio-lock.h Adhemerval Zanella
2021-05-27 20:44 ` [PATCH 4/4] Move libio lock single-thread optimization to generic libc-lock (BZ #27842) Adhemerval Zanella
2022-04-12 12:18 ` [PATCH 0/4] Move libio lock single-thread optimization to generic libc-lock Florian Weimer
2022-04-14 14:23   ` Adhemerval Zanella
2022-04-14 15:28     ` Florian Weimer

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=20210527204457.1250196-2-adhemerval.zanella@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).