11 May, 2007

1 commit

  • This patch series implements the new signalfd() system call.

    I took part of the original Linus code (and you know how badly it can be
    broken :), and I added even more breakage ;) Signals are fetched from the same
    signal queue used by the process, so signalfd will compete with standard
    kernel delivery in dequeue_signal(). If you want to reliably fetch signals on
    the signalfd file, you need to block them with sigprocmask(SIG_BLOCK). This
    seems to be working fine on my Dual Opteron machine. I made a quick test
    program for it:

    http://www.xmailserver.org/signafd-test.c

    The signalfd() system call implements signal delivery into a file descriptor
    receiver. The signalfd file descriptor if created with the following API:

    int signalfd(int ufd, const sigset_t *mask, size_t masksize);

    The "ufd" parameter allows to change an existing signalfd sigmask, w/out going
    to close/create cycle (Linus idea). Use "ufd" == -1 if you want a brand new
    signalfd file.

    The "mask" allows to specify the signal mask of signals that we are interested
    in. The "masksize" parameter is the size of "mask".

    The signalfd fd supports the poll(2) and read(2) system calls. The poll(2)
    will return POLLIN when signals are available to be dequeued. As a direct
    consequence of supporting the Linux poll subsystem, the signalfd fd can use
    used together with epoll(2) too.

    The read(2) system call will return a "struct signalfd_siginfo" structure in
    the userspace supplied buffer. The return value is the number of bytes copied
    in the supplied buffer, or -1 in case of error. The read(2) call can also
    return 0, in case the sighand structure to which the signalfd was attached,
    has been orphaned. The O_NONBLOCK flag is also supported, and read(2) will
    return -EAGAIN in case no signal is available.

    If the size of the buffer passed to read(2) is lower than sizeof(struct
    signalfd_siginfo), -EINVAL is returned. A read from the signalfd can also
    return -ERESTARTSYS in case a signal hits the process. The format of the
    struct signalfd_siginfo is, and the valid fields depends of the (->code &
    __SI_MASK) value, in the same way a struct siginfo would:

    struct signalfd_siginfo {
    __u32 signo; /* si_signo */
    __s32 err; /* si_errno */
    __s32 code; /* si_code */
    __u32 pid; /* si_pid */
    __u32 uid; /* si_uid */
    __s32 fd; /* si_fd */
    __u32 tid; /* si_fd */
    __u32 band; /* si_band */
    __u32 overrun; /* si_overrun */
    __u32 trapno; /* si_trapno */
    __s32 status; /* si_status */
    __s32 svint; /* si_int */
    __u64 svptr; /* si_ptr */
    __u64 utime; /* si_utime */
    __u64 stime; /* si_stime */
    __u64 addr; /* si_addr */
    };

    [akpm@linux-foundation.org: fix signalfd_copyinfo() on i386]
    Signed-off-by: Davide Libenzi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davide Libenzi
     

10 May, 2007

1 commit

  • This patch moves the sig_kernel_* and related macros from kernel/signal.c
    to linux/signal.h, and cleans them up slightly. I need the sig_kernel_*
    macros for default signal behavior in the utrace code, and want to avoid
    duplication or overhead to share the knowledge.

    Signed-off-by: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     

08 Dec, 2006

1 commit

  • Move sighand_cachep definitioni to linux/signal.h

    The sighand cache is only used in fs/exec.c and kernel/fork.c. It is defined
    in kernel/fork.c but only used in fs/exec.c.

    The sighand_cachep is related to signal processing. So add the definition to
    signal.h.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

03 Jul, 2006

1 commit

  • The recent interrupt rework introduced bit value conflicts with sparc.
    Instead of introducing new architecture flags mess, move the interrupt SA_
    flags out of the signal namespace and replace them by interrupt related flags.

    This allows to remove the obsolete SA_INTERRUPT flag and clean up the bit
    field values.

    This patch:

    Move the interrupt related SA_ flags out of linux/signal.h and rename them to
    IRQF_ . This moves the interrupt related flags out of the signal namespace
    and allows to remove the architecture dependencies.

    SA_INTERRUPT is not needed by userspace and glibc so it can be removed safely.

    The existing SA_ constants are kept for easy transition and will be
    removed after a 6 month grace period.

    Signed-off-by: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "David S. Miller"
    Cc: Benjamin Herrenschmidt
    Cc: "Randy.Dunlap"
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: "Antonino A. Daplas"
    Cc: Greg KH
    Cc: Russell King
    Cc: James Bottomley
    Cc: Kyle McMartin
    Cc: Jeff Garzik
    Cc: Mauro Carvalho Chehab
    Cc: Karsten Keil
    Cc: Jody McIntyre
    Cc: Ben Collins
    Cc: Stefan Richter
    Cc: Alan Cox
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Dave Airlie
    Cc: Jens Axboe
    Cc: Chris Zankel
    Cc: Andi Kleen
    Cc: Miles Bader
    Cc: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Cc: Paul Mundt
    Cc: Kazumoto Kojima
    Cc: Martin Schwidefsky Cc: Heiko Carstens
    Cc: Ralf Baechle
    Cc: Roman Zippel
    Cc: Geert Uytterhoeven
    Cc: Greg Ungerer
    Cc: "Luck, Tony"
    Cc: Yoshinori Sato
    Cc: David Howells
    Cc: Mikael Starvik
    Cc: Russell King
    Cc: Ivan Kokshaysky
    Cc: Richard Henderson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     

29 Apr, 2006

1 commit


28 Apr, 2006

1 commit


25 Apr, 2006

1 commit


29 Mar, 2006

1 commit

  • __exit_signal() is private to release_task() now. I think it is better to
    make it static in kernel/exit.c and export flush_sigqueue() instead - this
    function is much more simple and straightforward.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

09 Jan, 2006

2 commits

  • While rooting aroung in the signal code trying to understand how to fix the
    SIG_IGN ploy (set sig handler to SIG_IGN and flood system with high speed
    repeating timers) I came across what, I think, is a problem in sigaction()
    in that when processing a SIG_IGN request it flushes signals from 1 to
    SIGRTMIN and leaves the rest. Attempt to fix this.

    Signed-off-by: George Anzinger
    Cc: Roland McGrath
    Cc: Linus Torvalds
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    George Anzinger
     
  • Some ARM platforms have the ability to program the interrupt controller to
    detect various interrupt edges and/or levels. For some platforms, this is
    critical to setup correctly, particularly those which the setting is dependent
    on the device.

    Currently, ARM drivers do (eg) the following:

    err = request_irq(irq, ...);

    set_irq_type(irq, IRQT_RISING);

    However, if the interrupt has previously been programmed to be level sensitive
    (for whatever reason) then this will cause an interrupt storm.

    Hence, if we combine set_irq_type() with request_irq(), we can then safely set
    the type prior to unmasking the interrupt. The unfortunate problem is that in
    order to support this, these flags need to be visible outside of the ARM
    architecture - drivers such as smc91x need these flags and they're
    cross-architecture.

    Finally, the SA_TRIGGER_* flag passed to request_irq() should reflect the
    property that the device would like. The IRQ controller code should do its
    best to select the most appropriate supported mode.

    Signed-off-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Russell King
     

31 Oct, 2005

1 commit

  • This lock is used in sigqueue_free(), but it is always equal to
    current->sighand->siglock, so we don't need to keep it in the struct
    sigqueue.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

13 Jun, 2005

1 commit


01 May, 2005

2 commits

  • This patch adds a new function valid_signal() that tests if its argument is
    a valid signal number.

    The reasons for adding this new function are:

    - some code currently testing _NSIG directly has off-by-one errors.
    Using this function instead avoids such errors.

    - some code currently tests unsigned signal numbers for
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • The attached patch moves the IRQ-related SA_xxx flags (namely, SA_PROBE,
    SA_SAMPLE_RANDOM and SA_SHIRQ) from all the arch-specific headers to
    linux/signal.h. This looks like a left-over after the irq-handling code
    was consolidated. The code was moved to kernel/irq/*, but the flags are
    still left per-arch.

    Right now, adding a new IRQ flag to the arch-specific header, like this
    patch does:
    http://cvs.sourceforge.net/viewcvs.py/*checkout*/alsa/alsa-driver/utils/patches/pcsp-kernel-2.6.10-03.diff?rev=1.1
    no longer works, it breaks the compilation for all other arches, unless you
    add that flag to all the other arch-specific headers too. So I think such
    a clean-up makes sense.

    Signed-off-by: Stas Sergeev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stas Sergeev
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds