[0/4] Move libio lock single-thread optimization to generic libc-lock

Message ID 20210527204457.1250196-1-adhemerval.zanella@linaro.org
Headers
Series Move libio lock single-thread optimization to generic libc-lock |

Message

Adhemerval Zanella Netto May 27, 2021, 8:44 p.m. UTC
  This patchset removes some old unused code (_IO_lock_inexpensive
and _IO_MTSAFE_IO), consolidate the stdio-lock.h and move the
single-thread lock optimization to generic code instead of
per-function usage.

Adhemerval Zanella (4):
  libio: Assume _IO_lock_inexpensive
  libio: Assume _IO_MTSAFE_IO
  Consolidate stdio-lock.h
  Move libio lock single-thread optimization to generic libc-lock (BZ
    #27842)

 Makeconfig                        |   2 -
 debug/Makefile                    |  43 +++++-------
 grp/Makefile                      |   4 +-
 gshadow/Makefile                  |   4 +-
 htl/Makefile                      |   2 -
 hurd/vpprintf.c                   |   4 --
 include/stdio.h                   |   2 +-
 libio/Makefile                    |   2 -
 libio/Versions                    |   3 -
 libio/clearerr.c                  |   4 --
 libio/feof.c                      |   7 --
 libio/ferror.c                    |   9 +--
 libio/fileno.c                    |   2 +-
 libio/fputc.c                     |   7 --
 libio/genops.c                    |  66 -------------------
 libio/getc.c                      |   8 ---
 libio/getchar.c                   |   7 --
 libio/iofdopen.c                  |   4 --
 libio/iofflush.c                  |   7 --
 libio/iofgets.c                   |   7 --
 libio/iofopen.c                   |   4 --
 libio/iofopncook.c                |   6 --
 libio/iofputs.c                   |   7 --
 libio/iofread.c                   |   6 --
 libio/iofwrite.c                  |   6 +-
 libio/iopopen.c                   |  14 ----
 libio/ioungetc.c                  |   2 -
 libio/iovdprintf.c                |   2 -
 libio/iovsprintf.c                |   2 -
 libio/libio.h                     |  37 +++--------
 libio/libioP.h                    |  30 ++-------
 libio/memstream.c                 |   7 --
 libio/obprintf.c                  |   2 -
 libio/oldiofdopen.c               |   4 --
 libio/oldiofopen.c                |   4 --
 libio/oldiopopen.c                |  14 ----
 libio/oldstdfiles.c               |   6 --
 libio/putc.c                      |   7 --
 libio/putchar.c                   |   5 --
 libio/stdfiles.c                  |  11 +---
 libio/vasprintf.c                 |   2 -
 libio/vsnprintf.c                 |   2 -
 libio/vswprintf.c                 |   2 -
 libio/wgenops.c                   |   2 -
 libio/wmemstream.c                |   7 --
 nptl/Makefile                     |   3 -
 nptl/pthread_create.c             |   3 -
 pwd/Makefile                      |   1 -
 shadow/Makefile                   |   4 +-
 stdio-common/Makefile             |   2 -
 stdio-common/flockfile.c          |   1 -
 stdio-common/vfprintf-internal.c  |   4 --
 stdlib/Makefile                   |   9 ---
 stdlib/strfmon_l.c                |   2 -
 stdlib/strfrom-skeleton.c         |   2 -
 sysdeps/generic/stdio-lock.h      |  19 +++---
 sysdeps/htl/stdio-lock.h          |  57 ----------------
 sysdeps/ieee754/float128/Makefile |   4 --
 sysdeps/mach/libc-lock.h          |  12 ++--
 sysdeps/nptl/libc-lock.h          |   9 +--
 sysdeps/nptl/stdio-lock.h         | 104 ------------------------------
 sysdeps/unix/sysv/linux/Makefile  |   1 -
 wcsmbs/Makefile                   |   2 -
 63 files changed, 58 insertions(+), 566 deletions(-)
 delete mode 100644 sysdeps/htl/stdio-lock.h
 delete mode 100644 sysdeps/nptl/stdio-lock.h
  

Comments

Florian Weimer April 12, 2022, 12:18 p.m. UTC | #1
* Adhemerval Zanella via Libc-alpha:

> This patchset removes some old unused code (_IO_lock_inexpensive
> and _IO_MTSAFE_IO), consolidate the stdio-lock.h and move the
> single-thread lock optimization to generic code instead of
> per-function usage.
>
> Adhemerval Zanella (4):
>   libio: Assume _IO_lock_inexpensive
>   libio: Assume _IO_MTSAFE_IO
>   Consolidate stdio-lock.h
>   Move libio lock single-thread optimization to generic libc-lock (BZ
>     #27842)

This series is still assigned to me in Patchwork.  Is it still active?

Thanks,
Florian
  
Adhemerval Zanella Netto April 14, 2022, 2:23 p.m. UTC | #2
On 12/04/2022 09:18, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> This patchset removes some old unused code (_IO_lock_inexpensive
>> and _IO_MTSAFE_IO), consolidate the stdio-lock.h and move the
>> single-thread lock optimization to generic code instead of
>> per-function usage.
>>
>> Adhemerval Zanella (4):
>>   libio: Assume _IO_lock_inexpensive
>>   libio: Assume _IO_MTSAFE_IO
>>   Consolidate stdio-lock.h
>>   Move libio lock single-thread optimization to generic libc-lock (BZ
>>     #27842)
> 
> This series is still assigned to me in Patchwork.  Is it still active?

I think it would be a good micro-optimization and a code consolidation,
although I am not sure if it still applies.  If you think it would be
a good addition I can work on rebase and send a new version.
  
Florian Weimer April 14, 2022, 3:28 p.m. UTC | #3
* Adhemerval Zanella:

> On 12/04/2022 09:18, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>> 
>>> This patchset removes some old unused code (_IO_lock_inexpensive
>>> and _IO_MTSAFE_IO), consolidate the stdio-lock.h and move the
>>> single-thread lock optimization to generic code instead of
>>> per-function usage.
>>>
>>> Adhemerval Zanella (4):
>>>   libio: Assume _IO_lock_inexpensive
>>>   libio: Assume _IO_MTSAFE_IO
>>>   Consolidate stdio-lock.h
>>>   Move libio lock single-thread optimization to generic libc-lock (BZ
>>>     #27842)
>> 
>> This series is still assigned to me in Patchwork.  Is it still active?
>
> I think it would be a good micro-optimization and a code consolidation,
> although I am not sure if it still applies.  If you think it would be
> a good addition I can work on rebase and send a new version.

I'm interested in the _IO_MTSAFE_IO consolidation, but the rest looks
useful as well.  I think we have some places where we define stdio
locking macros differently for no apparent reason, that that's just
waiting to cause trouble.

Thanks,
Florian