unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Vineet Gupta <vineet.gupta1@synopsys.com>,
	Joseph Myers <joseph@codesourcery.com>,
	 GNU C Library <libc-alpha@sourceware.org>,
	 "open list:SYNOPSYS ARC ARCHITECTURE"
	<linux-snps-arc@lists.infradead.org>
Subject: Re: ARC vs. generic sigaction (was Re: [PATCH 08/21] ARC: Linux Syscall Interface)
Date: Thu, 20 Dec 2018 13:06:51 +0100	[thread overview]
Message-ID: <CAK8P3a3Fg0Y9Os3YP21VXbidPZaV+k10YELd8e=2RWi7nbqT1g@mail.gmail.com> (raw)
In-Reply-To: <4c3af320-cf35-f914-8bc3-a4c290b8e12b@linaro.org>

On Thu, Dec 20, 2018 at 12:19 PM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
> On 19/12/2018 20:23, Vineet Gupta wrote:
> > On 12/19/18 2:00 PM, Adhemerval Zanella wrote:
> >> One possibility is to define an arch-specific __sigset_t.h with a custom
> >> _SIGSET_NWORDS value and add an optimization on Linux sigaction.c to check
> >> if both kernel_sigaction and glibc sigaction share same size and internal
> >> layout to use the struct as-is for syscall instead of copy to a temporary
> >> value (similar to what we used to have on getdents).  ARC would still have
> >> arch-specific code and would be the only ABI to have a different sigset_t
> >> though.
> >
> > I don't like ARC to single out either. But as Joseph suggests could this be
> > starting point for arches of future. Assuming it does, would rather see this or
> > the approach Joseph alluded to earlier [1]
> >
> > [1] http://lists.infradead.org/pipermail/linux-snps-arc/2018-December/005122.html
> >
> >>
> >> However I *hardly* think sigaction is a hotspot in real world cases, usually
> >> the signal action is defined once or in a very limited number of times.  I am
> >> not considering synthetic benchmarks, specially lmbench which in most cases
> >> does not measure any useful metric.
> >
> > I tend to disagree. Coming from embedded linux background, I've found it immensely
> > useful to compare 2 minimal systems: especially when distos, out-of-box packages,
> > fancy benchmarks don't even exist.
> >
> > At any rate, my disagreement with status quo is not so much of optimize for ARC,
> > but rather pointless spending of electrons. When we know that there are 64 signals
> > at max, which need 64-bits, why bother shuffling around 1k bits, specially when
> > one is starting afresh and there's no legacy crap getting in the way.
> >
> > The case of adding more signals in future is indeed theoretically possible but
> > that will be an ABI change anyways.
>
> The only advantage of using a larger sigset_t from glibc standpoint is if
> kernel ever change it maximum number of supported signals it would not be
> a ABI change (it would be if glibc provided sigset_t need to be extended).
>
> My point was that this change would hardly help in performance or memory
> utilization due the signal set common utilization in exported and internal
> API.  But at the same time the signal set hasn't been changed for a *long* time
> and I don't see indication that it will any time soon. So a new architecture
> might indeed assume it won't change and set its default to follow Linux user
> ABI.

I just checked again what we actually use in the kernel.
With very few exceptions, all architectures in current kernels use

#define _NSIG             64
#define _NSIG_WORDS       (_NSIG / _NSIG_BPW)
typedef struct {
    /* this sucks for big-endian 32-bit compat mode */
    unsigned long sig[_NSIG_WORDS];
} sigset_t;

The only two exceptions I see are:

- alpha uses a scalar 'unsigned long' instead of the struct+array, but
  the effect is the same layout.
- For unknown reasons, all three MIPS ABIs now use _NSIG=128.
  This changed during linux-2.1.x from 65, to 32 and then the current
  value...

All users of sigset_t that I could find in the kernel just check
the size argument to ensure it matches _NSIG, and return
EINVAL otherwise.

      Arnd

  reply	other threads:[~2018-12-20 12:07 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 21:04 [PATCH 00/21] glibc port to ARC processors Vineet Gupta
2018-12-18 21:04 ` [PATCH 01/21] longlong.h: sync from gcc to fix ARC inline asm constraints Vineet Gupta
2018-12-18 22:56   ` Joseph Myers
2018-12-18 23:11     ` Vineet Gupta
2018-12-21 18:46   ` Joseph Myers
2018-12-21 19:07     ` Vineet Gupta
2018-12-18 21:04 ` [PATCH 02/21] ARC: add definitions to elf/elf.h Vineet Gupta
2018-12-18 21:04 ` [PATCH 03/21] ARC: ABI Implementation Vineet Gupta
2018-12-18 23:09   ` Joseph Myers
2018-12-19  2:00     ` Vineet Gupta
2018-12-19 17:40       ` Joseph Myers
2018-12-19 20:20         ` Vineet Gupta
2018-12-19 20:37           ` Joseph Myers
2019-01-28 23:03     ` ARC binutils init/fini (was Re: [PATCH 03/21] ARC: ABI Implementation) Vineet Gupta
2019-01-28 23:13       ` Joseph Myers
2019-01-28 23:42         ` Vineet Gupta
2018-12-18 21:04 ` [PATCH 04/21] ARC: startup and dynamic linking code Vineet Gupta
2018-12-18 23:24   ` Joseph Myers
2018-12-19  0:52     ` Vineet Gupta
2018-12-18 21:04 ` [PATCH 05/21] ARC: Thread Local Storage support Vineet Gupta
2018-12-18 21:04 ` [PATCH 06/21] ARC: Atomics and Locking primitives Vineet Gupta
2018-12-18 23:15   ` Joseph Myers
2019-01-15  0:40     ` Vineet Gupta
2018-12-18 21:04 ` [PATCH 07/21] ARC: math soft float support Vineet Gupta
2018-12-18 23:23   ` Joseph Myers
2018-12-19  0:01     ` Joseph Myers
2018-12-20 21:35       ` Vineet Gupta
2018-12-21  1:08     ` Vineet Gupta
2018-12-21  1:19       ` Joseph Myers
2018-12-18 21:04 ` [PATCH 08/21] ARC: Linux Syscall Interface Vineet Gupta
2018-12-18 23:30   ` Joseph Myers
2018-12-19  2:39     ` Vineet Gupta
2018-12-19 17:58       ` ARC vs. generic sigaction (was Re: [PATCH 08/21] ARC: Linux Syscall Interface) Vineet Gupta
2018-12-19 18:07         ` Joseph Myers
2018-12-19 22:00         ` Adhemerval Zanella
2018-12-19 22:23           ` Vineet Gupta
2018-12-20 11:19             ` Adhemerval Zanella
2018-12-20 12:06               ` Arnd Bergmann [this message]
2018-12-20 19:25                 ` Vineet Gupta
2018-12-20 12:40               ` Florian Weimer
2018-12-20 18:48                 ` Vineet Gupta
2019-01-03 13:10                   ` Florian Weimer
2018-12-20 19:23               ` Vineet Gupta
2018-12-20 20:06                 ` Adhemerval Zanella
2018-12-20 20:46                   ` Vineet Gupta
2018-12-21 12:05                     ` Adhemerval Zanella
2019-01-09 21:49                       ` Vineet Gupta
2018-12-18 21:04 ` [PATCH 09/21] ARC: Linux ABI Vineet Gupta
2018-12-18 23:38   ` Joseph Myers
2018-12-19 19:57     ` Vineet Gupta
2018-12-19 20:36       ` Joseph Myers
2018-12-21 23:06         ` Vineet Gupta
2018-12-18 21:04 ` [PATCH 10/21] ARC: Linux Startup and Dynamic Loading Vineet Gupta
2018-12-18 23:49   ` Joseph Myers
2018-12-19 20:26     ` Vineet Gupta
2018-12-18 21:04 ` [PATCH 11/21] ARC: ABI lists Vineet Gupta
2018-12-18 22:31   ` Andreas Schwab
2018-12-18 22:32     ` Vineet Gupta
2018-12-18 21:04 ` [PATCH 12/21] ARC: Update syscall-names.list for ARC specific syscalls Vineet Gupta
2018-12-18 21:26   ` Florian Weimer
2018-12-18 21:29     ` Vineet Gupta
2018-12-19  8:16       ` Florian Weimer
2018-12-18 21:04 ` [PATCH 13/21] ARC: Build Infrastructure Vineet Gupta
2018-12-18 23:44   ` Joseph Myers
2018-12-19 21:58     ` Vineet Gupta
2018-12-19 22:17       ` Joseph Myers
2018-12-20 23:21         ` Vineet Gupta
2018-12-20 23:24           ` Joseph Myers
2019-01-29 23:36             ` Vineet Gupta
2018-12-18 21:04 ` [PATCH 14/21] ARC: Enable __start as entry point vs. canonical _start Vineet Gupta
2018-12-18 21:28   ` Florian Weimer
2018-12-18 21:31     ` Vineet Gupta
2018-12-18 22:59       ` Joseph Myers
2018-12-18 23:08         ` Vineet Gupta
2018-12-19 20:36     ` Vineet Gupta
2018-12-18 21:04 ` [PATCH 15/21] ARC: testsuite fix: elf/check-initfini Vineet Gupta
2018-12-18 21:04 ` [PATCH 16/21] ARC: testsuite fix: sysvipc/* Vineet Gupta
2018-12-19 22:10   ` Adhemerval Zanella
2018-12-18 21:04 ` [PATCH 17/21] ARC: testsuite fix: stdlib/tst-makecontext Vineet Gupta
2018-12-18 22:36   ` Andreas Schwab
2019-01-21 22:32     ` Vineet Gupta
2018-12-18 21:04 ` [PATCH 18/21] ARC: testsuite fix: GD TLS issue Vineet Gupta
2018-12-18 21:04 ` [PATCH 19/21] ARC: fix several unwining and cancelation tests Vineet Gupta
2018-12-18 21:04 ` [PATCH 20/21] build-many-glibcs.py: Enable ARC builds Vineet Gupta
2018-12-18 21:04 ` [PATCH 21/21] NEWS: mention ARC port Vineet Gupta
2018-12-18 23:45   ` Joseph Myers
2018-12-19 18:30     ` Vineet Gupta
2018-12-18 22:52 ` [PATCH 00/21] glibc port to ARC processors Joseph Myers
2018-12-18 23:07   ` Vineet Gupta
2018-12-18 23:52     ` Joseph Myers
2018-12-21  1:55       ` Vineet Gupta
2018-12-21 14:32         ` Joseph Myers
2018-12-21 17:36           ` Vineet Gupta
2018-12-18 23:11 ` Joseph Myers
2018-12-19 23:45   ` Vineet Gupta
2018-12-20  0:14     ` Joseph Myers
2018-12-20  0:51       ` Vineet Gupta
2018-12-20 21:22 ` test related questions (was Re: [PATCH 00/21] glibc port to ARC processors) Vineet Gupta
2018-12-20 21:59   ` Joseph Myers

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to='CAK8P3a3Fg0Y9Os3YP21VXbidPZaV+k10YELd8e=2RWi7nbqT1g@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=adhemerval.zanella@linaro.org \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=vineet.gupta1@synopsys.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.
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).