2007-06-17 03:34:17

by Linus Torvalds

[permalink] [raw]
Subject: And now for something _totally_ different: Linux v2.6.22-rc5


In a stunning turn of events, I've actually been able to make another -rc
release despite all the discussion (*cough*flaming*cough*) about other
issues, and we now have a brand-spanking-new Linux 2.6.22-rc5 release
out there!

As usual, you get *five* kernels for the price of one! You can get the
tar-ball, the patches, or the git tree. And the tar-balls and patches come
not just in the old gzipped format, you can have them bzip2'd too! So you
have an incredible selection of kernels to choose from, fresh from the
oven!

By a happy turn of events, we have even succeeded in solving a number of
annoying regressions! Special thanks go to Tejun Heo, who worked night and
day, and finally reproduced and fixed the odd suspend/resume problems in
the ATA layer that got introduced by some previous cleanups.

But that's not all! We have other regressions fixed, and we have a bonus
round of random architecture fixes, and an extra-bonus round of Blackfin
updates.

[ Ok, so I can't really call the Blackfin fixes for regressions, but let's
face it, it's not like anybody is actually going to care. So doing the
Blackfin merge at this point may not be strictly proper -rc policy, but
hey, it's a new architecture. It certainly won't cause any more
regressions, if only because there's not a whole lot to regress there.

The same largely goes for the libertas wireless driver ;^/ ]

On a more serious note, I have to admit that I'm a bit unhappy with the
pure *volume* of changes this late in the game. I was really wanting to
stop some of the merges, but while not all of it really fixed regressions,
there really are a lot of bugfixes in there.

Yeah, the *bulk* of the patch is things like PA-RISC, Blackfin and the
libertas driver, but I really *really* wish people would also more
obviously be working on the regression list.

On that note - I doubly appreciate the people who *did* work on
regressions. Thanks, guys,

Linus
---
Adam Litke (1):
hugetlb: fix get_policy for stacked shared memory files

Adrian Bunk (1):
[RXRPC] net/rxrpc/ar-connection.c: fix NULL dereference

Akinobu Mita (2):
[CIFS] fix mempool destroy done in wrong order in cifs error path
[NETFILTER]: nf_conntrack_amanda: fix textsearch_prepare() error check

Alan Cox (3):
MAINTAINERS: corrections
libata-core/sff: Fix multiple assumptions about DMA
libata: Correct abuse of language

Alan Stern (2):
USB: Fix up bogus bInterval values in endpoint descriptors
OHCI: Fix machine check in ohci_hub_status_data

Albert Lee (6):
libata: print device model and firmware revision for ATAPI devices
libata passthru: update protocol numbers
libata passthru: support PIO multi commands
libata passthru: map UDMA protocols
libata passthru: always enforce correct DEV bit
libata passthru: update cached device paramters

Alexandr Andreev (1):
parisc: sync compat getdents

Alexey Dobriyan (3):
parisc: make command_line[] static
parisc: convert /proc/gsc/pcxl_dma to seq_file
fuse: ->fs_flags fixlet

Alexey Kuznetsov (1):
pi-futex: fix exit races and locking problems

Andrea Righi (1):
[AVR32] ratelimit segfault reporting rate

Andrew Morton (3):
V4L/DVB (5699): Cinergyt2: fix file release handler
document Acked-by:
x86_64: oops_begin() fix

Andrew Victor (3):
[ARM] 4418/1: AT91: Number of programmable clocks differs
[ARM] 4419/1: AT91: SAM9 USB clocks check for suspending
[ARM] 4421/1: AT91: Value of _KEY fields.

Andy Whitcroft (4):
checkpatch.pl: should be executable
update checkpatch.pl to version 0.03
update feature-removal-schedule.txt to include deprecated functions
update checkpatch.pl to version 0.04

Antonino Daplas (3):
[VIDEO] ffb: The pseudo_palette is only 16 elements long
[VIDEO] sunxvr2500fb: Fix pseudo_palette array size
[VIDEO] sunxvr500fb: Fix pseudo_palette array size

Arnd Bergmann (2):
[POWERPC] spufs: Refuse to load the module when not running on cell
[POWERPC] Fix pci_setup_phb_io_dynamic for pci_iomap

Atsushi Nemoto (5):
[MIPS] Drop __ARCH_WANT_SYS_FADVISE64
[MIPS] Fix some system calls with long long arguments
[MIPS] Fix warning by moving do_default_vi into CONFIG_CPU_MIPSR2_SRS
[MIPS] Wire up utimensat, signalfd, timerfd, eventfd
[MIPS] Fix IP27 build

Aubrey Li (2):
Blackfin arch: DMA code minor naming convention fix
Blackfin arch: try to split up functions like this into smaller units according to LKML review

Aurelien Jarno (1):
[PARISC] Disable LWS debugging

Avi Kivity (1):
KVM: Prevent guest fpu state from leaking into the host

Badari Pulavarty (1):
Restore shmid as inode# to fix /proc/pid/maps ABI breakage

Bartlomiej Zolnierkiewicz (4):
serverworks: remove crappy code
serverworks: fix CSB6 tuning logic
it821x: RAID mode fixes
ide-scsi: fix OOPS in idescsi_expiry()

Ben Collins (1):
USB: UNUSUAL_DEV: Sync up some reported devices from Ubuntu

Ben Dooks (4):
[ARM] 4442/1: OSIRIS: Fix CPLD register definitions
[ARM] 4443/1: OSIRIS: Add watchdog device to machine devices
[ARM] 4444/2: OSIRIS: CPLD suspend fix
[ARM] 4445/1: ANUBIS: Fix CPLD registers

Benjamin Herrenschmidt (1):
Rework ptep_set_access_flags and fix sun4c

Bill Gatliff (1):
[ARM] 4422/1: Fix default value handling in gpio_direction_output (PXA)

Bj?rn Steinbrink (3):
i386: fix NMI watchdog not reserving its MSRs
i386: use the right wrapper to disable the NMI watchdog
perfctr-watchdog: fix interchanged parameters to release_{evntsel,perfctr}_nmi

Bob Picco (1):
fix sysrq-m oops

Brian King (2):
ibmveth: Fix h_free_logical_lan error on pool resize
ibmveth: Automatically enable larger rx buffer pools for larger mtu

Brice Goglin (3):
myri10ge: limit the number of recoveries
myri10ge: report when the link partner is running in Myrinet mode
myri10ge: update driver version

Bryan Wu (3):
RAMFS NOMMU: missed POSIX UID/GID inode attribute checking
Blackfin arch: fixup Blackfin MAINTIANERS team member list
Blackfin SPI driver: fix bug SPI DMA incomplete transmission

Catalin Marinas (1):
[ARM] 4392/2: Do not corrupt the SP register in compressed/head.S

Chris Ball (1):
libertas: wakeup both mesh and normal wakeup when getting out of scan

Chris Dearman (6):
[MIPS] Remove duplicate fpu enable hazard code.
[MIPS] Always install the DSP exception handler.
[MIPS] SMTC: Fix build error caused by nonsense code.
[MIPS] Malta: Fix for SOCitSC based Maltas
[MIPS] Separate performance counter interrupts
[MIPS] Fix builds where MSC01E_xxx is undefined.

Chris Zankel (8):
[XTENSA] fix bit operations in bitops.h
[XTENSA] Spelling fixes in arch/xtensa
[XTENSA] fix sources using deprecated assembler directive
[XTENSA] Remove multi-exported symbols from xtensa_ksyms.c
[XTENSA] Use generic 64-bit division
[XTENSA] clean-up header files
[XTENSA] Move common sections into bss sections
[XTENSA] Remove non-rt signal handling

Christoph Hellwig (5):
[POWERPC] spufs: Hook up spufs_release_mem
[POWERPC] spufs: Synchronize pte invalidation vs ps close
[POWERPC] spufs scheduler: Fix wakeup races
[POWERPC] scc_sio: Fix link failure
[POWERPC] spufs: Don't yield nosched context

Christoph Lameter (4):
slab: fix alien cache handling
SLUB: return ZERO_SIZE_PTR for kmalloc(0)
SLUB slab validation: Alloc while interrupts are disabled must use GFP_ATOMIC
SLUB: minimum alignment fixes

Dan Williams (26):
libertas: call SET_NETDEV_DEV from common code
libertas: replace 'macaddress' with 'bssid'
libertas: correctly unregister mesh netdev on error
libertas: don't tear down netdev in libertas_activate_card
libertas: make scan result handling more flexible
libertas: fix 'keep previous scan' behavior
libertas: move channel changing into association framework
libertas: make association paths consistent
libertas: use MAC_FMT and MAC_ARG where appropriate
libertas: use compare_ether_addr() rather than memcmp() where appropriate
libertas: fix debug enter/leave prints for libertas_execute_next_command
libertas: correctly balance locking in libertas_process_rx_command
libertas: correct error report paths for wlan_fwt_list_ioctl
libertas: fix deadlock SIOCGIWSCAN handler
libertas: fix default adhoc channel
libertas: honor specific channel requests during association
libertas: send SIOCGIWSCAN event after partial scans too
libertas: debug print spacing fixes in assoc.c
libertas: add more verbose debugging to libertas_cmd_80211_authenticate
libertas: Make WPA work through supplicant handshake
libertas: sparse fixes
libertas: tweak association debug output
libertas: remove structure WLAN_802_11_SSID and libertas_escape_essid
libertas: remove WPA_SUPPLICANT structure
libertas: reduce SSID and BSSID mixed-case abuse
libertas: actually send mesh frames to mesh netdev

Dave Airlie (1):
drm: fix radeon setparam on 32/64 bit systems.

Dave Jones (1):
typo in via-velocity.c

David Brownell (4):
update Documentation/driver-model/platform.txt
USB: usb gadgets avoid le{16,32}_to_cpup()
[AVR32] gpio_*_cansleep() fix
spi doc updates

David Lamparter (1):
cfg80211: fix signed macaddress in sysfs

David Miller (2):
[SPARC64]: Fix service channel hypervisor function names.
[SPARC64]: Provide mmu statistics via sysfs.

David S. Miller (18):
[SPARC64]: Move topology init code into new file, sysfs.c
[SPARC64]: Export basic cpu properties via sysfs.
[SPARC64]: Proper multi-core scheduling support.
[SPARC64]: Make core and sibling groups equal on UltraSPARC-IV.
[SPARC64]: Fix {mc,smt}_capable().
[SPARC64]: Fill in gaps in non-PCI dma_*() NOP implementation.
[ATA]: Back out bogus (SPARC64 && !PCI) Kconfig depends.
[TCP] tcp_probe: Attach printf attribute properly to printl().
[UDP]: Revert 2-pass hashing changes.
[SPARC64]: Fix 2 bugs in PCI Sabre bus scanning.
[SPARC64]: Fix SBUS IRQ regression caused by PCI-E driver.
[SPARC64]: Handle PCI bridges without 'ranges' property.
[TCP]: Disable TSO if MD5SIG is enabled.
[SPARC64]: Wire up cookie based sun4v interrupt registry.
[SPARC64]: Fix IO/MEM space sizing for PCI.
[SPARC64]: Really fix parport.
[SPARC64]: Fix args to sun4v_ldc_revoke().
[TCP]: Set initial_ssthresh default to zero in Cubic and BIC.

David Woodhouse (7):
libertas: fix character set in README
libertas: first pass at fixing up endianness issues
libertas: More endianness fixes.
libertas: more endianness fixes, in tx.c this time
libertas: don't byte-swap firmware version number. It's a byte array.
libertas: fix big-endian associate command.
fix radeon setparam on 32/64 systems, harder.

Denis Cheng (1):
[NET]: Merge dst_discard_in and dst_discard_out.

Dmitry Mishin (1):
[NETFILTER]: ip_tables: fix compat related crash

Dmitry Torokhov (3):
Input: i8042 - add ASUS P65UP5 to the noloop list
Input: i8042 - add ULI EV4873 to noloop list
Input: move input-polldev to drivers/input

Eli Cohen (1):
mlx4_core: Fix CQ context layout

Eric Dumazet (1):
[TCP]: Use LIMIT_NETDEBUG in tcp_retransmit_timer().

Eric Sandeen (1):
sysfs: store sysfs inode nrs in s_ino to avoid readdir oopses

Eric W. Biederman (1):
shm: fix the filename of hugetlb sysv shared memory

G. Liakhovetski (2):
[IrDA]: Fix Rx/Tx path race.
[IrDA]: f-timer reloading when sending rejected frames.

Grant Grundler (2):
[PARISC] remove remnants of parisc-specific softirq code
[PARISC] remove global_ack_eiem

Greg Kroah-Hartman (1):
kobject: use the proper printk level for kobject error

Greg Ungerer (2):
m68knommu: fix ColdFire timer off by 1
nommu: report correct errno in message

Haavard Skinnemoen (2):
[AVR32] STK1000: Set SPI_MODE_3 in the ltv350qv board info
[AVR32] Define ARCH_KMALLOC_MINALIGN to L1_CACHE_BYTES

Hans Verkuil (6):
V4L/DVB (5675): Move big PIO accesses from the interrupt handler to a workhandler
V4L/DVB (5730): Remove unused V4L2_CAP_VIDEO_OUTPUT_POS
V4L/DVB (5732): Add ivtv CROPCAP support and fix ivtv S_CROP for video output.
V4L/DVB (5736): Add V4L2_FBUF_CAP/FLAG_LOCAL/GLOBAL_INV_ALPHA
V4L/DVB (5673): Fix audio stuttering for saa711x/ivtv when in radio mode.
V4L/DVB (5751): Ivtv: fix ia64 printk format warnings.

Helge Deller (10):
[PARISC] fix lasi_82596 build
[PARISC] fix section mismatch in parport_gsc
[PARISC] fix section mismatch in parisc STI video drivers
[PARISC] fix section mismatch in ccio-dma
[PARISC] fix section mismatches in arch/parisc/kernel
[PARISC] fix section mismatch in parisc eisa driver
[PARISC] fix section mismatch in superio serial drivers
[PARISC] Wire up utimensat/signalfd/timerfd/eventfd syscalls
[PARISC] fix "ENTRY" macro redefinition
[PARISC] fix section mismatch in smp.c

Herbert Xu (6):
[IPV4]: Only panic if inetdev_init fails for loopback
[IPV4]: Convert IPv4 devconf to an array
[IPV4]: Add default config support after inetdev_init
[IPV4]: Restore old behaviour of default config values
[IPV4]: Do not remove idev when addresses are cleared
[IPV6] addrconf: Fix IPv6 on tuntap tunnels

Holger Schurig (23):
libertas: rename wlan_association_worker
libertas: a debug output was missing a newline
libertas: fix removal of all debugfs files
libertas: remove __FILE__ from debug output
libertas: remove unused/superfluous definitions of DEV_NAME_LEN
libertas: move vendor & product id's into if_usb.c
libertas: make libertas_wlan_data_rates static
libertas: exclude non-used code when PROC_DEBUG is not set
libertas: make debug configurable
libertas: tune debug code
libertas: single out mesh code
libertas: change debug output of libertas_interrupt()
libertas: get rid of libertas_sbi_get_priv()
libertas: fix SSID output
libertas: changed some occurences of kmalloc() + memset(&a,0,sz) to kzalloc()
libertas: move reset_device() code main.c to if_usb.c
libertas: split wlan_add_card()
libertas: indirect all hardware access via hw_XXXX functions
libertas: move contents of fw.h to decl.h
libertas: split module into two (libertas.ko and usb8xxx.ko)
libertas: fix RESET logic at unload time
libertas: let DRV_NAME be overridable
libertas: remove unused variables in wlan_dev_t

Hugh Dickins (3):
splice: __generic_file_splice_read: fix i_size_read() length checks
mount -t tmpfs -o mpol=: check nodes online
i386 mm: use pte_update() in ptep_test_and_clear_dirty()

Ilpo J?rvinen (4):
[TCP]: Fix left_out setting during FRTO
[TCP]: Add missing break to TCP option parsing code
[TCP]: Congestion control API RTT sampling fix
[TCP]: Fix logic breakage due to DSACK separation

Ivo van Doorn (1):
[RFKILL]: Make rfkill->name const

Jack Morgenstein (2):
mlx4_core: Don't set MTT address in dMPT entries with PA set
IB/mlx4: Fix zeroing of rnr_retry value in ib_modify_qp()

Jan Kara (1):
udf: fix possible leakage of blocks

Javier Cardona (2):
libertas: fixed transmission flow control on the mesh interface
libertas: added transmission failures to mesh statistics

Jean-Christian de Rivaz (1):
Blackfin SMC91X ethernet supporting driver: SMC91C111 LEDs are note drived in the kernel like in uboot

Jeff Dike (4):
uml: fix kernel stack size on x86_64
uml: get declaration of simple_strtoul
uml: remove PAGE_SIZE from libc code
uml: kill x86_64 STACK_TOP_MAX

Jeff Garzik (1):
Revert "[netdrvr e100] experiment with doing RX in a similar manner to eepro100"

Jeff Mahoney (1):
reiserfs: mailing list has moved

Jens Axboe (8):
splice: move inode size check into generic_file_splice_read()
splice: remove do_splice_direct() symbol export
pipe: move pipe_inode_info structure decleration up before it's used
splice: move balance_dirty_pages_ratelimited() outside of splice actor
splice: __generic_file_splice_read: fix read/truncate race
splice: adjust balance_dirty_pages_ratelimited() call
splice: fix leak of pages on short splice to pipe
splice: only check do_wakeup in splice_to_pipe() for a real pipe

Jeremy Kerr (1):
[POWERPC] spufs: Fix gang destroy leaks

Jiri Slaby (4):
ide: generic IDE PCI driver, add another device exception
Char: stallion, don't fail with less than max panels
Char: stallion, alloc tty before pci devices init
Char: stallion, proper fail return values

Johannes Berg (1):
mac80211: fix debugfs tx power reduction output

Joy Latten (1):
xfrm: Add security check before flushing SAD/SPD

Kay Sievers (2):
Driver core: keep PHYSDEV for old struct class_device
USB: set default y for CONFIG_USB_DEVICE_CLASS

Ken Chen (1):
loop: preallocate eight loop devices

Kim Phillips (1):
phylib: add RGMII-ID mode to the Marvell m88e1111 PHY to fix broken ucc_geth

Konstantin Sharlaimov (1):
[PPP_MPPE]: Fix "osize too small" check.

Kyle McMartin (11):
[PARISC] Move #undef to end of syscall table
[PARISC] Wire up kexec_load syscall
[PARISC] Let PA-8900 processors boot
[PARISC] kobject is embedded in subsys, not kset
[PARISC] Build fixes for power.c
[PARISC] fix trivial spelling nit in asm/linkage.h
[PARISC] fix null ptr deref in unwind.c
[PARISC] fix "reduce size of task_struct on 64-bit machines" fallout
[PARISC] be more defensive in process.c::get_wchan
[PARISC] Fix bug when syscall nr is __NR_Linux_syscalls
[PARISC] Fix kernel panic in check_ivt

Lee Trager (1):
ide: HPA detect from resume

Linus Torvalds (1):
Linux 2.6.22-rc5

Luis Carlos (1):
libertas: convert libertas_mpp into anycast_mask

Luis Carlos Cobo (4):
libertas: fixed incorrect assigment of fcs errors to frag errors
libertas: add URB debug info
libertas: fixed kernel oops on module/card removal
libertas: updated mesh commands for 5.220.9.p11

Luis Carlos Cobo Rus (8):
libertas: version bump (321p0) and cmds update for new fw (5.220.10.p0)
libertas: cleanup of fwt_list_route processing
libertas: updated readme file
libertas: make mac address configuration work with mesh interface too
libertas: split wext for eth and msh
libertas: support for mesh autostart on firmware 5.220.11
libertas: pull current channel from firmware on mesh autostart
libertas: deauthenticate from AP in channel switch

Maciej W. Rozycki (1):
[MIPS] Fix KMODE for the R3000

Marc Pignat (1):
mmc-atmel: remove linux/mmc/protocol.h dependencies

Marcelo Tosatti (5):
libertas: scan two channels per scan command
libertas: remove deprecated pm_register and associated code
libertas: fix scanning from associate path
libertas: fix error handling of card initialization
libertas: fix oops on rmmod

Mark Fasheh (1):
ocfs2: Fix invalid assertion during write on 64k pages

Markus Rechberger (1):
firmware: remove orphaned Email

Matt Mackall (1):
random: fix output buffer folding

Mattias Nissler (1):
mac80211: Don't stop tx queue on master device while scanning.

Mauro Carvalho Chehab (2):
V4L/DVB (5702): Fix Kconfig items to avoid linkedition errors
V4L/DVB (5761): Fix broken b2c2 dependency on non x86 architectures

Michael Chan (5):
[BNX2]: Fix netdev watchdog on 5708.
[BNX2]: Add missing wait in bnx2_init_5709_context().
[BNX2]: Enable DMA on 5709.
[BNX2]: Fix occasional counter corruption on 5708.
[BNX2]: Update version and reldate.

Michael Hennerich (3):
Blackfin arch: As Mike pointed out range goes form m..MAX_BLACKFIN_GPIO -1
Blackfin arch: add missing gpio.h header to fix compiling in some pm configurations
Blackfin arch: fix bug can not wakeup from sleep via push buttons

Mike Accetta (1):
md: fix bug in error handling during raid1 repair

Mike Frysinger (19):
Blackfin arch: remove defconfig file
Blackfin arch: mark our memory init functions with __init so they get freed after init
Blackfin arch: implement a basic /proc/sram file for L1 allocation visibility
Blackfin arch: scrub old console defines
Blackfin arch: update defconfigs
Blackfin arch: unify differences between our diff head.S files -- no functional changes
Blackfin arch: move more of our startup code to .init so it can be freed once we are up and running
Blackfin arch: add proper ENDPROC()
Blackfin arch: fix spelling typo in output
Blackfin arch: add support for Alon Bar-Lev's dynamic kernel command-line
Blackfin arch: make sure we initialize our L1 Data B section properly based on the linked kernel
Blackfin arch: redo our linker script a bit
Blackfin arch: move HI/LO macros into blackfin.h and punt the rest of macros.h as it includes VDSP macros we never use
Blackfin serial driver: hook up our UARTs STP bit with userspaces CMSPAR
Blackfin serial driver: ignore framing and parity errors
Blackfin serial driver: actually implement the break_ctl() function
Blackfin serial driver: decouple PARODD and CMSPAR checking from PARENB
Blackfin RTC drivers: update MAINTAINERS information
Blackfin SPI driver: tweak spi cleanup function to match newer kernel changes

Miklos Szeredi (1):
[AF_UNIX]: Fix stream recvmsg() race.

Milind Arun Choudhary (2):
[PARISC] ROUND_UP macro cleanup in arch/parisc
[PARISC] ROUNDUP macro cleanup in drivers/parisc

Milton Miller (1):
[POWERPC] Fix console output getting dropped on platforms without udbg_putc

Mithlesh Thukral (3):
NetXen: Fix ping issue after reboot on Blades with 3.4.19 firmware
NetXen: Fix compile failure seen on PPC architecture
NetXen: Fix link status messages

NeilBrown (1):
md: fix two raid10 bugs

Oliver Endriss (1):
V4L/DVB (5716): Tda10086,tda826x: fix tuning, STR/SNR values

Olof Johansson (2):
[POWERPC] pasemi: Fix iommu + 64K PAGE_SIZE bug
libata: fix probe time irq printouts

Ondrej Zary (1):
Input: usbtouchscreen - fix fallout caused by move from drivers/usb

Patrick McHardy (4):
[TCP]: Honour sk_bound_dev_if in tcp_v4_send_ack
[NETLINK]: Mark netlink policies const
[RTNETLINK]: ifindex 0 does not exist
[NET_SCHED]: Fix filter double free

Patrick McHarrdy (1):
[NETFILTER]: nf_conntrack: fix helper module unload races

Paul Fulghum (1):
tty: restore locked ioctl file op

Paul Jackson (1):
cpuset: zero malloc - fix for old cpusets

Paul Mackerras (2):
[POWERPC] Fix building of COFF zImages
[POWERPC] Fix per-cpu allocation on oldworld SMP powermacs

Paul Moore (2):
[NetLabel]: consolidate the struct socket/sock handling to just struct sock
[CIPSO]: Fix several unaligned kernel accesses in the CIPSO engine.

Paul Mundt (7):
sh: Fix in_nmi symbol build error.
sh: microdev: Fix compile warnings.
sh: Fix SH4-202 clock fwk set_rate() mismatch.
sh: voyagergx: Fix build warnings.
sh: ioremap() through PMB needs asm/mmu.h.
sh: Fix se73180 platform device registration.
mm: Fix memory/cpu hotplug section mismatch and oops.

Peer Chen (3):
Add the PATA controller device ID to pci_ids.h for MCP73/MCP77.
ide: Add the MCP73/77 support to PATA driver
ahci: Add MCP73/MCP77 support to AHCI driver

Pete Zaitcev (1):
usblp: Don't let suspend to kill ->used

Peter Zijlstra (1):
frv: build fix

Pierre Ossman (3):
mmc: fix broken if clause
mmc: don't call switch on old cards
mmc: get back read-only switch function

Rafael J. Wysocki (2):
Resume from RAM on HPC nx6325 broken
swsusp: Fix userland interface

Ragner Magalhaes (1):
mmc-omap: fix sd response type 6 vs. 1

Ralf Baechle (9):
[MIPS] Atlas, Malta, SEAD: Remove scroll from interrupt handler.
[MIPS] Remove prototype for deleted function qemu_handle_int
[MIPS] SMTC: Don't set and restore irqregs ptr from self_ipi.
[MIPS] Atlas: Fix build.
[MIPS] SMTC: Fix warning.
[MIPS] SMTC: Don't continue in set_vi_srs_handler on detected bad arguments.
[MIPS] SMTC: The MT ASE requires to initialize c0_pagemask and c0_wired.
[MIPS] Fix modpost warnings by making start_secondary __cpuinit
[MIPS] Fix smp barriers in test_and_{change,clear,set}_bit

Randy Dunlap (4):
isdn/diva: fix section mismatch
checkpatch: produce fewer lines of output
hexdump: more output formatting
toshiba_acpi: fix section mismatch in allyesconfig

Ratnadeep Joshi (1):
Documentation/atomic_ops.txt typo fix

Robert P. J. Day (4):
[MIPS] Fix some minor typoes in arch/mips/Kconfig.
au1xmmc: Replace C code with call to ARRAY_SIZE() macro.
[SPARC64]: Include <linux/rwsem.h> instead of <asm/rwsem.h>.
Protect <linux/console_struct.h> from multiple inclusion

Robin Getz (1):
Blackfin arch: all symbols were offset by 4k, since we didn't have the __text label.

Roland Dreier (5):
mlx4_core: Initialize ctx_list and ctx_lock earlier
mlx4_core: Free catastrophic error MSI-X interrupt with correct dev_id
IB/mthca, mlx4_core: Fix typo in comment
mlx4_core: Check firmware command interface revision
IB/mlx4: Make sure RQ allocation is always valid

Roland McGrath (1):
Restrict clearing TIF_SIGPENDING

Roy Huang (1):
Blackfin arch: fix bug ad1836 fails to build properly for BF533-EZKIT

Russell King (5):
[ARM] Solve buggy smp_processor_id() usage
[ARM] Fix 4417/1: Serial: Fix AMBA drivers locking
[ARM] pxa: fix pxa27x keyboard driver
V4L/DVB (5700): Saa7111: fix picture settings cache bug
[ARM] VFP: fix section mismatch error

Sam Ravnborg (3):
[VIDEO]: Fix section mismatch warning in promcon.
net: fix typo in drivers/net/usb/Kconfig
kbuild: fix sh64 section mismatch problems

Sean Hefty (1):
RDMA/cma: Fix initialization of next_port

Sebastian Siewior (2):
[POWERPC] spufs: Free mm if spufs_fill_dir() failed
[POWERPC] spufs: Fix error handling in spufs_fill_dir()

Sergei Shtylyov (2):
[MIPS] EMMA2RH: remove dead KGDB code
hpt366: disallow Ultra133 for HPT374

Simon Arlott (5):
[PARISC] spelling fixes: arch/parisc/
USB: cxacru: add Documentation file
USB: cxacru: create sysfs attributes in atm_start instead of bind
USB: cxacru: ignore error trying to start ADSL in atm_start
Blackfin arch: spelling fixes

Stephen Hemminger (1):
Driver core: kill unused code

Stephen Rothwell (2):
Xtensa: use asm-generic/fcntl.h
Move three functions that are only needed for CONFIG_MEMORY_HOTPLUG

Steve French (5):
[CIFS] Fix oops on failed cifs mount (in kthread_stop)
[CIFS] typo in previous patch
[CIFS] whitespace cleanup
[CIFS] whitespace cleanup part 2
[CIFS] CIFS should honour umask

Steven Rostedt (1):
enable interrupts in user path of page fault.

Stuart Yoder (2):
[POWERPC] Fix typo in booting-without-of-txt section numbering
[POWERPC] Add table of contents to booting-without-of.txt

Tejun Heo (8):
sata_promise: use TF interface for polling NODATA commands
libata: disable NCQ for HITACHI HTS541680J9SA00/SB21C7EP
libata: fix hw_sata_spd_limit initialization
libata: force PIO on IOMEGA ZIP 250 ATAPI
libata: limit post SRST nsect/lbal wait to ~100ms
sysfs: fix condition check in sysfs_drop_dentry()
sysfs: fix race condition around sd->s_dentry, take#2
block: always requeue !fs requests at the front

Thierry Merle (1):
V4L/DVB (5720): Usbvision: fix urb allocation and submits

Thomas Bogendoerfer (3):
[MIPS] RM300: Fix MMIO problems by marking the PCI INT ACK region busy
[MIPS] Fix VGA corruption on RM300C
[MIPS] Make dma_map_sg handle sg elements which are longer than one page

Thomas Gleixner (2):
rt-mutex: fix stale return value
rt-mutex: fix chain walk early wakeup bug

Thomas Graf (1):
[NET]: Avoid duplicate netlink notification when changing link state

Thomas Klein (1):
ehea: Fixed possible kernel panic on VLAN packet recv

Thomas Renninger (1):
[POWERPC] cbe_cpufreq: Limit frequency via cpufreq notifier chain

Tiger Yang (1):
ocfs2: Fix masklog breakage

Vlad Yasevich (6):
[SCTP]: Correctly set daddr for IPv6 sockets during peeloff
[SCTP]: Allow unspecified port in sctp_bindx()
[SCTP] Fix leak in sctp_getsockopt_local_addrs when copy_to_user fails
[SCTP] Update pmtu handling to be similar to tcp
[SCTP] Flag a pmtu change request
[SCTP] Don't disable PMTU discovery when mtu is small

Wang Zhenyu (8):
[AGPGART] intel_agp: cleanup intel private data
[AGPGART] intel_agp: use table for device probe
[AGPGART] intel_agp: add support for 965GME/GLE
[AGPGART] intel_agp: add support for 945GME
[AGPGART] intel_agp: Add support for G33, Q33 and Q35 chipsets
i915: add new pciids for 945GME, 965GME/GLE
drm/i915: Add support for the G33, Q33, and Q35 chipsets.
[AGPGART] intel_agp: fix device probe

Yehuda Sadeh Weinraub (1):
[CIFS] Missing flag on negprot needed for some servers to force packet signing

Yoann Padioleau (1):
potential parse error in ifdef part 3

Yoichi Yuasa (1):
remove unused variable in pata_isapnp


2007-06-17 07:15:16

by Nicholas Miell

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5

On Sat, 2007-06-16 at 20:33 -0700, Linus Torvalds wrote:
> In a stunning turn of events, I've actually been able to make another -rc
> release despite all the discussion (*cough*flaming*cough*) about other
> issues, and we now have a brand-spanking-new Linux 2.6.22-rc5 release
> out there!
>

signalfd still has the broken behavior w.r.t. signal delivery to
threads.

Is this going to get fixed before 2.6.22 proper is released, or should
it just be disabled entirely so no userspace apps grow to depend on
current wrong behavior?

--
Nicholas Miell <[email protected]>

2007-06-17 17:01:33

by Davide Libenzi

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5

On Sun, 17 Jun 2007, Nicholas Miell wrote:

> On Sat, 2007-06-16 at 20:33 -0700, Linus Torvalds wrote:
> > In a stunning turn of events, I've actually been able to make another -rc
> > release despite all the discussion (*cough*flaming*cough*) about other
> > issues, and we now have a brand-spanking-new Linux 2.6.22-rc5 release
> > out there!
> >
>
> signalfd still has the broken behavior w.r.t. signal delivery to
> threads.
>
> Is this going to get fixed before 2.6.22 proper is released, or should
> it just be disabled entirely so no userspace apps grow to depend on
> current wrong behavior?

At the moment, with Ben's patch applied, signalfd can see all group-sent
signals, and locally-directed thread signals.
Linus, we can leave this as is, or we can use the ququed-signalfd that was
implemented in the first versions of signalfd. In such case, since
signalfd hooks to the sighand, all signals will be visible to signalfd and
they will not compete against dequeue_signal with the tasks. So there will
be no races in the queue retrieval. The issue that remained to be solved
was a simple way to limit memory allocated by the queue.
What do you prefer?



- Davide


2007-06-17 19:26:58

by Nicholas Miell

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5

On Sun, 2007-06-17 at 10:01 -0700, Davide Libenzi wrote:
> On Sun, 17 Jun 2007, Nicholas Miell wrote:
>
> > On Sat, 2007-06-16 at 20:33 -0700, Linus Torvalds wrote:
> > > In a stunning turn of events, I've actually been able to make another -rc
> > > release despite all the discussion (*cough*flaming*cough*) about other
> > > issues, and we now have a brand-spanking-new Linux 2.6.22-rc5 release
> > > out there!
> > >
> >
> > signalfd still has the broken behavior w.r.t. signal delivery to
> > threads.
> >
> > Is this going to get fixed before 2.6.22 proper is released, or should
> > it just be disabled entirely so no userspace apps grow to depend on
> > current wrong behavior?
>
> At the moment, with Ben's patch applied, signalfd can see all group-sent
> signals, and locally-directed thread signals.

But there's still no way for multiple threads to read from a single
signalfd and get their own thread-specific signals in addition to
process-wide signals, right? I think this was agreed to be the least
surprising behavior.

> Linus, we can leave this as is, or we can use the ququed-signalfd that was
> implemented in the first versions of signalfd. In such case, since
> signalfd hooks to the sighand, all signals will be visible to signalfd and
> they will not compete against dequeue_signal with the tasks. So there will
> be no races in the queue retrieval. The issue that remained to be solved
> was a simple way to limit memory allocated by the queue.
> What do you prefer?
>
>
>
> - Davide

--
Nicholas Miell <[email protected]>

2007-06-17 23:49:56

by Davide Libenzi

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5

On Sun, 17 Jun 2007, Nicholas Miell wrote:

> On Sun, 2007-06-17 at 10:01 -0700, Davide Libenzi wrote:
> > On Sun, 17 Jun 2007, Nicholas Miell wrote:
> >
> > > On Sat, 2007-06-16 at 20:33 -0700, Linus Torvalds wrote:
> > > > In a stunning turn of events, I've actually been able to make another -rc
> > > > release despite all the discussion (*cough*flaming*cough*) about other
> > > > issues, and we now have a brand-spanking-new Linux 2.6.22-rc5 release
> > > > out there!
> > > >
> > >
> > > signalfd still has the broken behavior w.r.t. signal delivery to
> > > threads.
> > >
> > > Is this going to get fixed before 2.6.22 proper is released, or should
> > > it just be disabled entirely so no userspace apps grow to depend on
> > > current wrong behavior?
> >
> > At the moment, with Ben's patch applied, signalfd can see all group-sent
> > signals, and locally-directed thread signals.
>
> But there's still no way for multiple threads to read from a single
> signalfd and get their own thread-specific signals in addition to
> process-wide signals, right? I think this was agreed to be the least
> surprising behavior.

Multiple threads can wait on the signalfd. Each one will dequeue either
its own private signals (tsk->pending) or the process shared ones
(tsk->signal->shared_pending). This will be the behaviour once Ben's patch
is applied.



- Davide


2007-06-18 00:13:42

by Nicholas Miell

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5

On Sun, 2007-06-17 at 16:49 -0700, Davide Libenzi wrote:
> On Sun, 17 Jun 2007, Nicholas Miell wrote:
>
> > On Sun, 2007-06-17 at 10:01 -0700, Davide Libenzi wrote:
> > > On Sun, 17 Jun 2007, Nicholas Miell wrote:
> > >
> > > > On Sat, 2007-06-16 at 20:33 -0700, Linus Torvalds wrote:
> > > > > In a stunning turn of events, I've actually been able to make another -rc
> > > > > release despite all the discussion (*cough*flaming*cough*) about other
> > > > > issues, and we now have a brand-spanking-new Linux 2.6.22-rc5 release
> > > > > out there!
> > > > >
> > > >
> > > > signalfd still has the broken behavior w.r.t. signal delivery to
> > > > threads.
> > > >
> > > > Is this going to get fixed before 2.6.22 proper is released, or should
> > > > it just be disabled entirely so no userspace apps grow to depend on
> > > > current wrong behavior?
> > >
> > > At the moment, with Ben's patch applied, signalfd can see all group-sent
> > > signals, and locally-directed thread signals.
> >
> > But there's still no way for multiple threads to read from a single
> > signalfd and get their own thread-specific signals in addition to
> > process-wide signals, right? I think this was agreed to be the least
> > surprising behavior.
>
> Multiple threads can wait on the signalfd. Each one will dequeue either
> its own private signals (tsk->pending) or the process shared ones
> (tsk->signal->shared_pending). This will be the behaviour once Ben's patch
> is applied.
>

Ah, ok, that's great.

I didn't see anything like that in linux.git, missed Ben's patch to the
list, and mixed up your description with the original TIF_SIGPENDING
work.

Sorry for the confusion.

--
Nicholas Miell <[email protected]>

2007-06-18 00:20:32

by Davide Libenzi

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5

On Sun, 17 Jun 2007, Nicholas Miell wrote:

> Ah, ok, that's great.
>
> I didn't see anything like that in linux.git, missed Ben's patch to the
> list, and mixed up your description with the original TIF_SIGPENDING
> work.

They will still race on the signal queue though. That is, if you create a
signalfd and three threads are doing a read(2) over it, if a signal is
sent to the thread group (tsk->signal->shared_pending), only one will
fetch the signal. I think that's the correct behaviour anyway.
Andrew or Linus, did you get Ben's patch?



- Davide


2007-06-18 00:43:39

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5

On Sun, 2007-06-17 at 17:20 -0700, Davide Libenzi wrote:
> >
> > I didn't see anything like that in linux.git, missed Ben's patch to
> the
> > list, and mixed up your description with the original TIF_SIGPENDING
> > work.
>
> They will still race on the signal queue though. That is, if you
> create a
> signalfd and three threads are doing a read(2) over it, if a signal
> is
> sent to the thread group (tsk->signal->shared_pending), only one will
> fetch the signal. I think that's the correct behaviour anyway.
> Andrew or Linus, did you get Ben's patch?

It might have been missed... I can resend later today.

Ben.


2007-06-18 00:47:37

by Davide Libenzi

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5

On Mon, 18 Jun 2007, Benjamin Herrenschmidt wrote:

> On Sun, 2007-06-17 at 17:20 -0700, Davide Libenzi wrote:
> > >
> > > I didn't see anything like that in linux.git, missed Ben's patch to
> > the
> > > list, and mixed up your description with the original TIF_SIGPENDING
> > > work.
> >
> > They will still race on the signal queue though. That is, if you
> > create a
> > signalfd and three threads are doing a read(2) over it, if a signal
> > is
> > sent to the thread group (tsk->signal->shared_pending), only one will
> > fetch the signal. I think that's the correct behaviour anyway.
> > Andrew or Linus, did you get Ben's patch?
>
> It might have been missed... I can resend later today.

Try to put a "GPLV3" somewhere in the subject. It might have better
chances to get through Linus radar these days :D



- Davide


2007-06-18 13:42:30

by Oleg Nesterov

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5

On 06/17, Davide Libenzi wrote:
>
> On Sun, 17 Jun 2007, Nicholas Miell wrote:
> >
> > But there's still no way for multiple threads to read from a single
> > signalfd and get their own thread-specific signals in addition to
> > process-wide signals, right? I think this was agreed to be the least
> > surprising behavior.
>
> Multiple threads can wait on the signalfd. Each one will dequeue either
> its own private signals (tsk->pending) or the process shared ones
> (tsk->signal->shared_pending). This will be the behaviour once Ben's patch
> is applied.

What if we pass a signalfd to another process with unix socket? Which signals
should be dequeued in that case? Only shared ones?

I tried to follow this discussion, but I can't understans why the current
behaviour is bad.

Yes, a thread has to create its own signalfd if it wants to dequeue private
signals. But this is simple and understandable. May be I missed something
else ?

Oleg.

2007-06-18 17:15:22

by Linus Torvalds

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5



On Mon, 18 Jun 2007, Benjamin Herrenschmidt wrote:
> On Sun, 2007-06-17 at 17:20 -0700, Davide Libenzi wrote:
> >
> > Andrew or Linus, did you get Ben's patch?
>
> It might have been missed... I can resend later today.

I did indeed just miss it. I intended to apply it (and actually thought I
had), but I see it's still just an email in that long thread.

(It's often a good idea to re-write the subject line and make it be that
standard "[PATCH] ..description..", because that just makes it show up
much better when I go through my unread emails.. Not that that is any
kind of *guarantee* that I won't miss it).

Anyway, no need to re-send, it's now *really* in my queue of things to
apply.

Linus

2007-06-19 09:14:40

by Oleg Nesterov

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On 06/18, Linus Torvalds wrote:
>
> On Mon, 18 Jun 2007, Benjamin Herrenschmidt wrote:
> > On Sun, 2007-06-17 at 17:20 -0700, Davide Libenzi wrote:
> > >
> > > Andrew or Linus, did you get Ben's patch?
> >
> > It might have been missed... I can resend later today.
>
> I did indeed just miss it. I intended to apply it (and actually thought I
> had), but I see it's still just an email in that long thread.
>
> (It's often a good idea to re-write the subject line and make it be that
> standard "[PATCH] ..description..", because that just makes it show up
> much better when I go through my unread emails.. Not that that is any
> kind of *guarantee* that I won't miss it).
>
> Anyway, no need to re-send, it's now *really* in my queue of things to
> apply.

>From another message on this thread,

Davide Libenzi wrote:
>
> On Sun, 17 Jun 2007, Nicholas Miell wrote:
>
> > But there's still no way for multiple threads to read from a single
> > signalfd and get their own thread-specific signals in addition to
> > process-wide signals, right? I think this was agreed to be the least
> > surprising behavior.
>
> Multiple threads can wait on the signalfd. Each one will dequeue either
> its own private signals (tsk->pending) or the process shared ones
> (tsk->signal->shared_pending). This will be the behaviour once Ben's patch
> is applied.

The commited "Fix signalfd interaction with thread-private signals"
(commit caec4e8dc85e0644ec24aeb36285e1ba02da58cc) doesn't implement
this.

We can do something like

int signalfd_dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
{
if (tsk->tgid == current->tgid)
tsk = current;

return dequeue_signal(tsk, mask, info);
}

(still I can't understand why should we change signalfd).

Oleg.

2007-06-19 12:10:22

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Tue, 2007-06-19 at 13:14 +0400, Oleg Nesterov wrote:

> The commited "Fix signalfd interaction with thread-private signals"
> (commit caec4e8dc85e0644ec24aeb36285e1ba02da58cc) doesn't implement
> this.

Indeed, if you want what Davide described, you need to also change
signalfd side. The patch I did merely prevents another thread from
dequeuing somebody else private signals. As it stands, signalfd will
still try it... and only get the shared ones. It will not however get
the private signals of the caller if it is different from the context
associated with the signalfd.

Ben.


2007-06-19 14:06:25

by Oleg Nesterov

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On 06/19, Benjamin Herrenschmidt wrote:
>
> On Tue, 2007-06-19 at 13:14 +0400, Oleg Nesterov wrote:
>
> > The commited "Fix signalfd interaction with thread-private signals"
> > (commit caec4e8dc85e0644ec24aeb36285e1ba02da58cc) doesn't implement
> > this.
>
> Indeed, if you want what Davide described, you need to also change
> signalfd side. The patch I did merely prevents another thread from
> dequeuing somebody else private signals.

Yes I see, but why do we need this change? Yes, we can dequeue SIGSEGV
from another thread. Just don't do it if you have a handler for SIGSEGV?

Oleg.

2007-06-19 19:44:16

by Davide Libenzi

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Tue, 19 Jun 2007, Oleg Nesterov wrote:

> The commited "Fix signalfd interaction with thread-private signals"
> (commit caec4e8dc85e0644ec24aeb36285e1ba02da58cc) doesn't implement
> this.
>
> We can do something like
>
> int signalfd_dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
> {
> if (tsk->tgid == current->tgid)
> tsk = current;
>
> return dequeue_signal(tsk, mask, info);
> }
>
> (still I can't understand why should we change signalfd).

Yes, of course. I was waiting for Ben's patch to go in, before fixing
signalfd. I did not know if Linus would have acked that.



- Davide


2007-06-19 19:53:46

by Davide Libenzi

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Tue, 19 Jun 2007, Oleg Nesterov wrote:

> On 06/19, Benjamin Herrenschmidt wrote:
> >
> > On Tue, 2007-06-19 at 13:14 +0400, Oleg Nesterov wrote:
> >
> > > The commited "Fix signalfd interaction with thread-private signals"
> > > (commit caec4e8dc85e0644ec24aeb36285e1ba02da58cc) doesn't implement
> > > this.
> >
> > Indeed, if you want what Davide described, you need to also change
> > signalfd side. The patch I did merely prevents another thread from
> > dequeuing somebody else private signals.
>
> Yes I see, but why do we need this change? Yes, we can dequeue SIGSEGV
> from another thread. Just don't do it if you have a handler for SIGSEGV?

I believe it can be confusing to have private signals dequeued from
another thread. The kernel expect those to be dequeued by the target
thread.


- Davide


2007-06-19 19:59:41

by Oleg Nesterov

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On 06/19, Davide Libenzi wrote:
>
> On Tue, 19 Jun 2007, Oleg Nesterov wrote:
>
> > The commited "Fix signalfd interaction with thread-private signals"
> > (commit caec4e8dc85e0644ec24aeb36285e1ba02da58cc) doesn't implement
> > this.
> >
> > We can do something like
> >
> > int signalfd_dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
> > {
> > if (tsk->tgid == current->tgid)
> > tsk = current;
> >
> > return dequeue_signal(tsk, mask, info);
> > }
> >
> > (still I can't understand why should we change signalfd).
>
> Yes, of course. I was waiting for Ben's patch to go in, before fixing
> signalfd. I did not know if Linus would have acked that.

OK, this means that signalfd becomes "thread group wide". In that case
I'd suggest to also change sys_signalfd(-1),

- ctx->tsk = current;
+ ctx->tsk = current->group_leader;

Oleg.

2007-06-19 20:08:16

by Oleg Nesterov

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On 06/19, Davide Libenzi wrote:
>
> On Tue, 19 Jun 2007, Oleg Nesterov wrote:
>
> > On 06/19, Benjamin Herrenschmidt wrote:
> > >
> > > On Tue, 2007-06-19 at 13:14 +0400, Oleg Nesterov wrote:
> > >
> > > > The commited "Fix signalfd interaction with thread-private signals"
> > > > (commit caec4e8dc85e0644ec24aeb36285e1ba02da58cc) doesn't implement
> > > > this.
> > >
> > > Indeed, if you want what Davide described, you need to also change
> > > signalfd side. The patch I did merely prevents another thread from
> > > dequeuing somebody else private signals.
> >
> > Yes I see, but why do we need this change? Yes, we can dequeue SIGSEGV
> > from another thread. Just don't do it if you have a handler for SIGSEGV?
>
> I believe it can be confusing to have private signals dequeued from
> another thread. The kernel expect those to be dequeued by the target
> thread.

Well, I think the kernel doesn't make any assumptions on that. It can't
guarantee the signal will be actually dequeued, to begin with.

(That said, I probably missed something, in that case I'd like to be
educated. This is the real reason why I am making the noise :)

Oleg.

2007-06-19 21:38:19

by Mariusz Kozlowski

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5

Hello,

MAINTAINERS says riscom8 is orphaned so not sure
if anybody cares. Spotted this when playing with modprobe
walking /lib/modules/`uname -r`/kernel in a loop ;)

BUG: sleeping function called from invalid context at kernel/mutex.c:86
in_atomic():0, irqs_disabled():1
[<c0104542>] show_trace_log_lvl+0x1a/0x30
[<c01050d0>] show_trace+0x12/0x14
[<c010515b>] dump_stack+0x15/0x17
[<c0112bd4>] __might_sleep+0xa8/0xae
[<c04148ff>] mutex_lock+0x15/0x1f
[<c015f82f>] __unregister_chrdev_region+0x1a/0x85
[<c015f8f7>] unregister_chrdev_region+0x2f/0x3e
[<c029c710>] tty_unregister_driver+0x30/0x100
[<df082011>] rc_release_drivers+0x11/0x20 [riscom8]
[<df08960c>] riscom8_init_module+0x539/0x57a [riscom8]
[<c01345c2>] sys_init_module+0x11b/0x167e
[<c0103ee6>] sysenter_past_esp+0x5f/0x85
=======================

Regards,

Mariusz

2007-06-19 21:49:14

by Linus Torvalds

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5



On Tue, 19 Jun 2007, Mariusz Kozlowski wrote:
>
> MAINTAINERS says riscom8 is orphaned so not sure
> if anybody cares. Spotted this when playing with modprobe
> walking /lib/modules/`uname -r`/kernel in a loop ;)

Oh wow.

I wonder why it does that. The code literally does:

save_flags(flags);
cli();
tty_unregister_driver(riscom_driver);
put_tty_driver(riscom_driver);
restore_flags(flags);

and I don't see the point.

(And that's what then causes the warning: tty_unregister_driver will
eventually get a mutex, but the caller had disabled hardware interrupts..

I see absolutely *zero* reason for that whole save_flags/cli/restore_flags
dance at all, so I think the right thing to do is to just remove it.

I'm Cc'ing Alan, in case he cares.

Mariusz, if you actually *use* the dang thing, and really care, you can
send me a tested patch. I can pretty much guarantee that removing those
irq games won't make things any worse, but no way am I going to just
remove it on my own without any users or any testing.

Linus

2007-06-19 22:31:30

by Mariusz Kozlowski

[permalink] [raw]
Subject: Re: And now for something _totally_ different: Linux v2.6.22-rc5

> > MAINTAINERS says riscom8 is orphaned so not sure
> > if anybody cares. Spotted this when playing with modprobe
> > walking /lib/modules/`uname -r`/kernel in a loop ;)
>
> Oh wow.
>
> I wonder why it does that. The code literally does:
>
> save_flags(flags);
> cli();
> tty_unregister_driver(riscom_driver);
> put_tty_driver(riscom_driver);
> restore_flags(flags);
>
> and I don't see the point.
>
> (And that's what then causes the warning: tty_unregister_driver will
> eventually get a mutex, but the caller had disabled hardware interrupts..
>
> I see absolutely *zero* reason for that whole save_flags/cli/restore_flags
> dance at all, so I think the right thing to do is to just remove it.
>
> I'm Cc'ing Alan, in case he cares.
>
> Mariusz, if you actually *use* the dang thing, and really care, you can
> send me a tested patch. I can pretty much guarantee that removing those
> irq games won't make things any worse, but no way am I going to just
> remove it on my own without any users or any testing.

Unfortunately I can test it only the way I did it so far. That means no real
hardware :-/ This also implies I do care but not that much ;-) If you want any
patches to be tested that way -> feel free to mail me.

Mariusz

2007-06-19 23:16:44

by Davide Libenzi

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Wed, 20 Jun 2007, Oleg Nesterov wrote:

> Well, I think the kernel doesn't make any assumptions on that. It can't
> guarantee the signal will be actually dequeued, to begin with.
>
> (That said, I probably missed something, in that case I'd like to be
> educated. This is the real reason why I am making the noise :)

What happens if a task gets a page fault that results in a SIGSEGV, and
another task steals the SIGSEGV using a signalfd, before the faulted task
has the chance to get into do_notify_resume() and notice it? ;)



- Davide


2007-06-19 23:24:57

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Tue, 2007-06-19 at 18:06 +0400, Oleg Nesterov wrote:
> On 06/19, Benjamin Herrenschmidt wrote:
> >
> > On Tue, 2007-06-19 at 13:14 +0400, Oleg Nesterov wrote:
> >
> > > The commited "Fix signalfd interaction with thread-private signals"
> > > (commit caec4e8dc85e0644ec24aeb36285e1ba02da58cc) doesn't implement
> > > this.
> >
> > Indeed, if you want what Davide described, you need to also change
> > signalfd side. The patch I did merely prevents another thread from
> > dequeuing somebody else private signals.
>
> Yes I see, but why do we need this change? Yes, we can dequeue SIGSEGV
> from another thread. Just don't do it if you have a handler for SIGSEGV?

Well, for such synchronous signals, it's a fairly stupid idea,
especially since you can't predict who will get it. Signals such as SEGV
are forced-in, which means they are force-unblocked. Thus, you can't
know for sure whome of signalfd or the target thread will get it first,
depending on who catches the siglock first I suppose. In one case,
you'll manage to steal it, in the other, you'll thread will be killed.

Ben.


2007-06-19 23:49:18

by Davide Libenzi

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Tue, 19 Jun 2007, Oleg Nesterov wrote:

> The commited "Fix signalfd interaction with thread-private signals"
> (commit caec4e8dc85e0644ec24aeb36285e1ba02da58cc) doesn't implement
> this.
>
> We can do something like
>
> int signalfd_dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
> {
> if (tsk->tgid == current->tgid)
> tsk = current;
>
> return dequeue_signal(tsk, mask, info);
> }
>
> (still I can't understand why should we change signalfd).

Actually, I think signalfd is fine as is, with Ben's patch applied.
Signalfd should only fetch shared signals, not specific ones (in any
case).



- Davide


2007-06-20 01:26:12

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Tue, 2007-06-19 at 16:49 -0700, Davide Libenzi wrote:

> Actually, I think signalfd is fine as is, with Ben's patch applied.
> Signalfd should only fetch shared signals, not specific ones (in any
> case).

The only advantage of that additional patch is that it will allow any
thread to fetch its own private signals via signalfd, regardless of what
context is attached to the signalfd in the first place.

Without the patch (with what's currently in Linus tree), a thread will
only get its own private signals if it's also the thread that created
the signalfd (and thus is attached to the signalfd "context").

I don't mind either way, up to you guys to decide what semantics you
want.

Ben.


2007-06-20 02:16:01

by Davide Libenzi

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Wed, 20 Jun 2007, Benjamin Herrenschmidt wrote:

> On Tue, 2007-06-19 at 16:49 -0700, Davide Libenzi wrote:
>
> > Actually, I think signalfd is fine as is, with Ben's patch applied.
> > Signalfd should only fetch shared signals, not specific ones (in any
> > case).
>
> The only advantage of that additional patch is that it will allow any
> thread to fetch its own private signals via signalfd, regardless of what
> context is attached to the signalfd in the first place.
>
> Without the patch (with what's currently in Linus tree), a thread will
> only get its own private signals if it's also the thread that created
> the signalfd (and thus is attached to the signalfd "context").
>
> I don't mind either way, up to you guys to decide what semantics you
> want.

Ok, why instead don't we go for something like the attached patch?
We exclude sync signals from signalfd, but we don't limit signalfd to
shared signals. Ie, we should be able to fetch a signal sent with
sys_tkill() to threads different from "current", that otherwise we would
not be able to fetch.
Ben, sorry but my memory sucks ... the "notifier" thing was fine in that
case, no?




- Davide



---
fs/signalfd.c | 10 +++++++++-
kernel/signal.c | 6 +-----
2 files changed, 10 insertions(+), 6 deletions(-)

Index: linux-2.6.mod/fs/signalfd.c
===================================================================
--- linux-2.6.mod.orig/fs/signalfd.c 2007-06-19 18:58:15.000000000 -0700
+++ linux-2.6.mod/fs/signalfd.c 2007-06-19 19:02:57.000000000 -0700
@@ -26,6 +26,14 @@
#include <linux/anon_inodes.h>
#include <linux/signalfd.h>

+/*
+ * Signals that a signalfd should never fetch.
+ */
+#define SIGNALFD_EXCLUDE_MASK (sigmask(SIGILL) | sigmask(SIGKILL) | \
+ sigmask(SIGSTOP) | sigmask(SIGTRAP) | \
+ sigmask(SIGFPE) | sigmask(SIGSEGV) | \
+ sigmask(SIGBUS))
+
struct signalfd_ctx {
struct list_head lnk;
wait_queue_head_t wqh;
@@ -320,7 +328,7 @@
if (sizemask != sizeof(sigset_t) ||
copy_from_user(&sigmask, user_mask, sizeof(sigmask)))
return error = -EINVAL;
- sigdelsetmask(&sigmask, sigmask(SIGKILL) | sigmask(SIGSTOP));
+ sigdelsetmask(&sigmask, SIGNALFD_EXCLUDE_MASK);
signotset(&sigmask);

if (ufd == -1) {
Index: linux-2.6.mod/kernel/signal.c
===================================================================
--- linux-2.6.mod.orig/kernel/signal.c 2007-06-19 18:55:07.000000000 -0700
+++ linux-2.6.mod/kernel/signal.c 2007-06-19 18:58:43.000000000 -0700
@@ -365,11 +365,7 @@
{
int signr = 0;

- /* We only dequeue private signals from ourselves, we don't let
- * signalfd steal them
- */
- if (tsk == current)
- signr = __dequeue_signal(&tsk->pending, mask, info);
+ signr = __dequeue_signal(&tsk->pending, mask, info);
if (!signr) {
signr = __dequeue_signal(&tsk->signal->shared_pending,
mask, info);

2007-06-20 03:47:52

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Tue, 2007-06-19 at 19:15 -0700, Davide Libenzi wrote:

> Ok, why instead don't we go for something like the attached patch?
> We exclude sync signals from signalfd, but we don't limit signalfd to
> shared signals. Ie, we should be able to fetch a signal sent with
> sys_tkill() to threads different from "current", that otherwise we would
> not be able to fetch.
> Ben, sorry but my memory sucks ... the "notifier" thing was fine in that
> case, no?

I'm generally nervous about the idea of letting signalfd dequeue
somebody else private signals... even if we filter out SEGV's and
friends but I'll let Linus decide there.

Regarding the notifier, it's dodgy in most cases I'd say but I suppose
it should be allright to only worry about "current" and not the target
task there.

Ben.

2007-06-20 11:14:23

by Oleg Nesterov

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On 06/20, Benjamin Herrenschmidt wrote:
>
> On Tue, 2007-06-19 at 18:06 +0400, Oleg Nesterov wrote:
> > On 06/19, Benjamin Herrenschmidt wrote:
> > >
> > > On Tue, 2007-06-19 at 13:14 +0400, Oleg Nesterov wrote:
> > >
> > > > The commited "Fix signalfd interaction with thread-private signals"
> > > > (commit caec4e8dc85e0644ec24aeb36285e1ba02da58cc) doesn't implement
> > > > this.
> > >
> > > Indeed, if you want what Davide described, you need to also change
> > > signalfd side. The patch I did merely prevents another thread from
> > > dequeuing somebody else private signals.
> >
> > Yes I see, but why do we need this change? Yes, we can dequeue SIGSEGV
> > from another thread. Just don't do it if you have a handler for SIGSEGV?
>
> Well, for such synchronous signals, it's a fairly stupid idea,
> especially since you can't predict who will get it. Signals such as SEGV
> are forced-in, which means they are force-unblocked. Thus, you can't
> know for sure whome of signalfd or the target thread will get it first,
> depending on who catches the siglock first I suppose. In one case,
> you'll manage to steal it, in the other, you'll thread will be killed.

Yes. As I said, I think this falls into the "just don't do that" category.
But nothing bad happens from the kernel POV.

Also, suppose that some thread does

for (;;)
signal(SIGSEGV, SIG_IGN);

Now we have the same situation. do_sigaction() can steal SIGSEGV from
another thread.


Perhaps, the proposed behaviour

> Multiple threads can wait on the signalfd. Each one will dequeue either
> its own private signals (tsk->pending) or the process shared ones
> (tsk->signal->shared_pending).

is more convenient, I can't judge. If we implement this, sys_signalfd(-1) in
essence means "attach to the thread group, not current". This also makes sense.
But what we have now (with this patch applied) is a bit strange, imho.

Oleg.

2007-06-20 15:54:27

by Davide Libenzi

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Wed, 20 Jun 2007, Benjamin Herrenschmidt wrote:

> On Tue, 2007-06-19 at 19:15 -0700, Davide Libenzi wrote:
>
> > Ok, why instead don't we go for something like the attached patch?
> > We exclude sync signals from signalfd, but we don't limit signalfd to
> > shared signals. Ie, we should be able to fetch a signal sent with
> > sys_tkill() to threads different from "current", that otherwise we would
> > not be able to fetch.
> > Ben, sorry but my memory sucks ... the "notifier" thing was fine in that
> > case, no?
>
> I'm generally nervous about the idea of letting signalfd dequeue
> somebody else private signals... even if we filter out SEGV's and
> friends but I'll let Linus decide there.
>
> Regarding the notifier, it's dodgy in most cases I'd say but I suppose
> it should be allright to only worry about "current" and not the target
> task there.

I believe that once we exclude synchronous signals from being dequeued, we
should be fine. Limiting all signals sent with sys_tkill() from being
dequeued with a signalfd is a too restricting behaviour IMO.


- Davide

2007-06-20 17:38:27

by Linus Torvalds

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals



On Wed, 20 Jun 2007, Oleg Nesterov wrote:
>
> Also, suppose that some thread does
>
> for (;;)
> signal(SIGSEGV, SIG_IGN);
>
> Now we have the same situation. do_sigaction() can steal SIGSEGV from
> another thread.

Actually, that shouldn't be possible.

See "force_sig_info()". It does not allow blocking or ignoring forced
signals. We will reset such a signal handler to SIG_DFL, and unlock it.

So if you get a SIGSEGV while SIGSEGV's are blocked or ignored, the kernel
*will* kill you. No questions asked.

Linus

2007-06-21 08:25:17

by Oleg Nesterov

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On 06/20, Linus Torvalds wrote:
>
> On Wed, 20 Jun 2007, Oleg Nesterov wrote:
> >
> > Also, suppose that some thread does
> >
> > for (;;)
> > signal(SIGSEGV, SIG_IGN);
> >
> > Now we have the same situation. do_sigaction() can steal SIGSEGV from
> > another thread.
>
> Actually, that shouldn't be possible.
>
> See "force_sig_info()". It does not allow blocking or ignoring forced
> signals. We will reset such a signal handler to SIG_DFL, and unlock it.
>
> So if you get a SIGSEGV while SIGSEGV's are blocked or ignored, the kernel
> *will* kill you. No questions asked.

Yes, and no.

Yes, force_sig() unblocks and un-ignores the signal. However, unlike group-wide
signals, thread-specific signals do not convert themselves to SIGKILL on delivery.
The target thread should dequeue SIGSEGV and then it calls do_group_exit().
Before it does so, another thread doing signal(SIGSEGV, SIG_IGN) can steal
the signal.

Of course, this is unlikely, and the target thread will take page fault again.
The same for signalfd.

Oleg.

2007-06-21 18:02:34

by Linus Torvalds

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals



On Thu, 21 Jun 2007, Oleg Nesterov wrote:
>
> Yes, force_sig() unblocks and un-ignores the signal. However, unlike group-wide
> signals, thread-specific signals do not convert themselves to SIGKILL on delivery.
> The target thread should dequeue SIGSEGV and then it calls do_group_exit().

No it couldn't.

Why? Because the target thread is the one that *caused* the SIGSEGV in the
first place. It's not going to dequeue *anything*. It's either going to
take the SIGSEGV, or it's going to get another SIGSEGV and now it's no
longer masked/handled and it's going to die.

Linus

2007-06-21 18:23:52

by Oleg Nesterov

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On 06/21, Linus Torvalds wrote:
>
> On Thu, 21 Jun 2007, Oleg Nesterov wrote:
> >
> > Yes, force_sig() unblocks and un-ignores the signal. However, unlike group-wide
> > signals, thread-specific signals do not convert themselves to SIGKILL on delivery.
> > The target thread should dequeue SIGSEGV and then it calls do_group_exit().
>
> No it couldn't.
>
> Why? Because the target thread is the one that *caused* the SIGSEGV in the
> first place. It's not going to dequeue *anything*. It's either going to
> take the SIGSEGV,

Hmm, can't understand.

Yes, the target thread is the one that caused the SIGSEGV, it sends the signal
to itself. entry.S:ret_from_exception should notice this signal and _dequeue_
it, no? This signal could be stealed by signal(SIG_IGN) which runs after it
was delivered.

> or it's going to get another SIGSEGV and now it's no
> longer masked/handled and it's going to die.

Yes sure. As I said,

> and the target thread will take page fault again.

My point was that it is _possible_ to steal a thread-local SIGSEGV even without
signalfd, nothing bad should happen.

Oleg.

2007-06-21 18:36:22

by Linus Torvalds

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals



On Thu, 21 Jun 2007, Oleg Nesterov wrote:
>
> Yes, the target thread is the one that caused the SIGSEGV, it sends the signal
> to itself. entry.S:ret_from_exception should notice this signal and _dequeue_
> it, no? This signal could be stealed by signal(SIG_IGN) which runs after it
> was delivered.

Right. But it will dequeue it by *taking* it.

IOW, this has absolutely nothing to do with signalfd.

That's all I mean.

> My point was that it is _possible_ to steal a thread-local SIGSEGV even without
> signalfd, nothing bad should happen.

That makes no sense.

You don't "steal" it. You take it. It's what SIGSEGV (and _any_ signal)
has always been about. You get the signal, enter the signal handler, and
handle it.

No "stealing". No signalfd, no *nothing*. Just normal signal behaviour.

Linus

2007-06-21 18:58:49

by Oleg Nesterov

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On 06/21, Linus Torvalds wrote:
>
> On Thu, 21 Jun 2007, Oleg Nesterov wrote:
> >
> > Yes, the target thread is the one that caused the SIGSEGV, it sends the signal
> > to itself. entry.S:ret_from_exception should notice this signal and _dequeue_
> > it, no? This signal could be stealed by signal(SIG_IGN) which runs after it
> > was delivered.
>
> Right. But it will dequeue it by *taking* it.
>
> IOW, this has absolutely nothing to do with signalfd.
>
> That's all I mean.

Yes.

> > My point was that it is _possible_ to steal a thread-local SIGSEGV even without
> > signalfd, nothing bad should happen.
>
> That makes no sense.
>
> You don't "steal" it. You take it. It's what SIGSEGV (and _any_ signal)
> has always been about. You get the signal, enter the signal handler, and
> handle it.
>
> No "stealing". No signalfd, no *nothing*. Just normal signal behaviour.

_Another_ thread could steal SIGSEGV via read(signalfd) without Ben's patch.
This is what Ben and Davide are worried about. I think we should not worry,
we have the same situation if this "another" thread does

for (;;)
signal(SIGSEGV, SIG_IGN);

do_sigaction() does rm_from_queue_full().

Oleg.

2007-06-21 23:30:57

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Thu, 2007-06-21 at 22:58 +0400, Oleg Nesterov wrote:
>
> > No "stealing". No signalfd, no *nothing*. Just normal signal
> behaviour.
>
> _Another_ thread could steal SIGSEGV via read(signalfd) without Ben's patch.
> This is what Ben and Davide are worried about. I think we should not worry,
> we have the same situation if this "another" thread does
>
> for (;;)
> signal(SIGSEGV, SIG_IGN);
>
> do_sigaction() does rm_from_queue_full().

Yeah well... I wanted to have the least surprise path... that is,
without my patch, signalfd will "sometimes" steal the SIGSEGV depending
on who races to the lock first, thus causing the target thread to
re-execute the faulting instruction and taking another SIGSEGV, and
sometimes not. It's bad from both the faulting thread point of view and
the signalfd use who gets signals "sometimes" without any guarantee.

I like the current code that at least implement a precise semantic for
all thread local signals -> they are only ever delivered to that thread,
period. If you really want to do funky things from outside, you can
still do ptrace ;-)

Ben.


2007-06-21 23:46:49

by Linus Torvalds

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals



On Fri, 22 Jun 2007, Benjamin Herrenschmidt wrote:
>
> Yeah well... I wanted to have the least surprise path... that is,
> without my patch, signalfd will "sometimes" steal the SIGSEGV depending
> on who races to the lock first

Oh, absolutely. I thought we all agreed that Ben's patch was the right
thing. It's been merged for some time now (even if it hasn't been merged
for as long as I initially _thought_, since I had forgotten to apply the
the first time around ;)

So yes, all my emails have been about the _current_ code.

Linus

2007-06-22 08:40:36

by Oleg Nesterov

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On 06/22, Benjamin Herrenschmidt wrote:
>
> Yeah well... I wanted to have the least surprise path... that is,
> without my patch, signalfd will "sometimes" steal the SIGSEGV depending
> on who races to the lock first, thus causing the target thread to
> re-execute the faulting instruction and taking another SIGSEGV, and
> sometimes not. It's bad from both the faulting thread point of view and
> the signalfd use who gets signals "sometimes" without any guarantee.
>
> I like the current code that at least implement a precise semantic for
> all thread local signals -> they are only ever delivered to that thread,
> period. If you really want to do funky things from outside, you can
> still do ptrace ;-)

OK. But in that case I think we should go further, and make signalfd
"per process", not "per thread", see

http://marc.info/?l=linux-kernel&m=118241815219430

Every thread gets its own local signals plus shared ones.

(I promise, this is the last piece of spam from me on this topic, but
please-please-please nack this patch explicitly if you don't like it :)

Oleg.

2007-06-22 11:42:07

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals


> OK. But in that case I think we should go further, and make signalfd
> "per process", not "per thread", see
>
> http://marc.info/?l=linux-kernel&m=118241815219430
>
> Every thread gets its own local signals plus shared ones.
>
> (I promise, this is the last piece of spam from me on this topic, but
> please-please-please nack this patch explicitly if you don't like it :)

No, I think your patch do make sense.

That is, it -does- make sense to be able to create a signal singalfd in
a process and have N threads reading from it and getting either shared
signals or their local private signals.

I just don't like the actual implementation of it by changing the task
pointer on the fly...

My main issue is a matter of consistency of the signalfd API as a
whole... the whole bloody thing is instanciated & attached to a thread
in the first place. Maybe we should change that and say that one
instanciates a signalfd on a thread group... that is, it always gets
attached to the leader.

It might well be that signalfd's concept of context is wrong in the
first place and it should be attached to processes rather than threads
and that made more explicit in the first place... but that leaves the
door open to what a write() API should be ...

Ben.


2007-06-22 16:03:34

by Oleg Nesterov

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On 06/22, Benjamin Herrenschmidt wrote:
>
> That is, it -does- make sense to be able to create a signal singalfd in
> a process and have N threads reading from it and getting either shared
> signals or their local private signals.

Great.

> I just don't like the actual implementation of it by changing the task
> pointer on the fly...
>
> My main issue is a matter of consistency of the signalfd API as a
> whole... the whole bloody thing is instanciated & attached to a thread
> in the first place. Maybe we should change that and say that one
> instanciates a signalfd on a thread group... that is, it always gets
> attached to the leader.

It does exactly so, please note this chunk

@@ -330,7 +339,7 @@ asmlinkage long sys_signalfd(int ufd, si

init_waitqueue_head(&ctx->wqh);
ctx->sigmask = sigmask;
- ctx->tsk = current;
+ ctx->tsk = current->group_leader;

> It might well be that signalfd's concept of context is wrong in the
> first place and it should be attached to processes rather than threads
> and that made more explicit in the first place...

Exactly!

Oleg.

2007-06-22 22:34:06

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals


>
> It does exactly so, please note this chunk
>
> @@ -330,7 +339,7 @@ asmlinkage long sys_signalfd(int ufd, si
>
> init_waitqueue_head(&ctx->wqh);
> ctx->sigmask = sigmask;
> - ctx->tsk = current;
> + ctx->tsk = current->group_leader;
>
> > It might well be that signalfd's concept of context is wrong in the
> > first place and it should be attached to processes rather than threads
> > and that made more explicit in the first place...

Yup, looks like I was looking at a wrong patch... I think it's the right
thing to do indeed.

Ben.


2007-06-22 22:47:36

by Linus Torvalds

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals



On Sat, 23 Jun 2007, Benjamin Herrenschmidt wrote:
>
> >
> > It does exactly so, please note this chunk
> >
> > @@ -330,7 +339,7 @@ asmlinkage long sys_signalfd(int ufd, si
> >
> > init_waitqueue_head(&ctx->wqh);
> > ctx->sigmask = sigmask;
> > - ctx->tsk = current;
> > + ctx->tsk = current->group_leader;
> >
> > > It might well be that signalfd's concept of context is wrong in the
> > > first place and it should be attached to processes rather than threads
> > > and that made more explicit in the first place...
>
> Yup, looks like I was looking at a wrong patch... I think it's the right
> thing to do indeed.

Quite frankly, it strikes me that if we want to do this, then we shouldn't
save the _process_ information at all, we should save the "sighand"
instead.

So either we save the process info, or we save the sighand, but saving the
"group_leader" seems totally bogus. Especially as the group leader can
change (by execve()).

One thing that strikes me as I look at that function is that the whole
signalfd thing doesn't seem to do any reference counting. Ie it looks
totally buggy wrt passing the resulting fd off to somebody else, and then
exiting in the original process.

What did I miss?

Linus

2007-06-22 23:01:36

by Davide Libenzi

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Fri, 22 Jun 2007, Linus Torvalds wrote:

> Quite frankly, it strikes me that if we want to do this, then we shouldn't
> save the _process_ information at all, we should save the "sighand"
> instead.
>
> So either we save the process info, or we save the sighand, but saving the
> "group_leader" seems totally bogus. Especially as the group leader can
> change (by execve()).
>
> One thing that strikes me as I look at that function is that the whole
> signalfd thing doesn't seem to do any reference counting. Ie it looks
> totally buggy wrt passing the resulting fd off to somebody else, and then
> exiting in the original process.
>
> What did I miss?

We intercept the sighand going out of business, and we do not access it
anymore after that (by the mean of signalfd_lock() returning zero).
I'd be OK with Oleg patch, although I really prefer signalfd being more
flexible (that is, with sync signals disabled in signalfd, and with Ben's
patch reverted). Unless clear point of breakage are shown with such
approach.



- Davide


2007-06-22 23:16:50

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Fri, 2007-06-22 at 15:47 -0700, Linus Torvalds wrote:
> Quite frankly, it strikes me that if we want to do this, then we shouldn't
> save the _process_ information at all, we should save the "sighand"
> instead.
>
> So either we save the process info, or we save the sighand, but saving the
> "group_leader" seems totally bogus. Especially as the group leader can
> change (by execve()).
>
> One thing that strikes me as I look at that function is that the whole
> signalfd thing doesn't seem to do any reference counting. Ie it looks
> totally buggy wrt passing the resulting fd off to somebody else, and then
> exiting in the original process.
>
> What did I miss?

Probably nothing... doesn't look good. What are the lifetime rules of a
struct sighand tho ?

Ben.


2007-06-22 23:19:52

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Sat, 2007-06-23 at 09:16 +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2007-06-22 at 15:47 -0700, Linus Torvalds wrote:
> > Quite frankly, it strikes me that if we want to do this, then we shouldn't
> > save the _process_ information at all, we should save the "sighand"
> > instead.
> >
> > So either we save the process info, or we save the sighand, but saving the
> > "group_leader" seems totally bogus. Especially as the group leader can
> > change (by execve()).
> >
> > One thing that strikes me as I look at that function is that the whole
> > signalfd thing doesn't seem to do any reference counting. Ie it looks
> > totally buggy wrt passing the resulting fd off to somebody else, and then
> > exiting in the original process.
> >
> > What did I miss?
>
> Probably nothing... doesn't look good. What are the lifetime rules of a
> struct sighand tho ?

Ah got it, signalfd_detach() in include/linux/signalfd.h from
exit_signal plus some rcu bits in signalfd lock/unlock.

Ben.


2007-06-22 23:52:24

by Nicholas Miell

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Sat, 2007-06-23 at 09:19 +1000, Benjamin Herrenschmidt wrote:
> On Sat, 2007-06-23 at 09:16 +1000, Benjamin Herrenschmidt wrote:
> > On Fri, 2007-06-22 at 15:47 -0700, Linus Torvalds wrote:
> > > Quite frankly, it strikes me that if we want to do this, then we shouldn't
> > > save the _process_ information at all, we should save the "sighand"
> > > instead.
> > >
> > > So either we save the process info, or we save the sighand, but saving the
> > > "group_leader" seems totally bogus. Especially as the group leader can
> > > change (by execve()).
> > >
> > > One thing that strikes me as I look at that function is that the whole
> > > signalfd thing doesn't seem to do any reference counting. Ie it looks
> > > totally buggy wrt passing the resulting fd off to somebody else, and then
> > > exiting in the original process.
> > >
> > > What did I miss?
> >
> > Probably nothing... doesn't look good. What are the lifetime rules of a
> > struct sighand tho ?
>
> Ah got it, signalfd_detach() in include/linux/signalfd.h from
> exit_signal plus some rcu bits in signalfd lock/unlock.

You could just get rid of the process/sighand/whatever reference
entirely and just make reads on a signalfd always dequeue signals for
the current thread.

You'd lose the ability to pass signalfds around to other processes, but
I'm not convinced that is even useful. (But I'm sure somebody smarter
than me has a valid use case and would love to share :-)

--
Nicholas Miell <[email protected]>

2007-06-23 00:12:18

by Davide Libenzi

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Fri, 22 Jun 2007, Nicholas Miell wrote:

> You could just get rid of the process/sighand/whatever reference
> entirely and just make reads on a signalfd always dequeue signals for
> the current thread.

Duh?! ...


> You'd lose the ability to pass signalfds around to other processes, but
> I'm not convinced that is even useful. (But I'm sure somebody smarter
> than me has a valid use case and would love to share :-)

Wasn't it you that bitched (just a few days ago) because multiple threads
could not use the same signalfd and they (by your initial thought) had to
create one per thread?



- Davide


2007-06-23 01:20:59

by Nicholas Miell

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Fri, 2007-06-22 at 17:12 -0700, Davide Libenzi wrote:
> On Fri, 22 Jun 2007, Nicholas Miell wrote:
>
> > You could just get rid of the process/sighand/whatever reference
> > entirely and just make reads on a signalfd always dequeue signals for
> > the current thread.
>
> Duh?! ...
>
> > You'd lose the ability to pass signalfds around to other processes, but
> > I'm not convinced that is even useful. (But I'm sure somebody smarter
> > than me has a valid use case and would love to share :-)
>
> Wasn't it you that bitched (just a few days ago) because multiple threads
> could not use the same signalfd and they (by your initial thought) had to
> create one per thread?

Nevermind, I wasn't entirely clear on the reason why signalfd_ctx had a
tsk pointer. (I wrongly thought it was a vestige of the mechanism for
the original delivery semantics.)

--
Nicholas Miell <[email protected]>

2007-06-23 06:05:33

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Fri, 2007-06-22 at 17:12 -0700, Davide Libenzi wrote:
> Wasn't it you that bitched (just a few days ago) because multiple
> threads
> could not use the same signalfd and they (by your initial thought) had
> to
> create one per thread?

He said multiple process and you say multiple threads...

If signalfd isn't attached to any context, it would then be useable by
all threads in a process, delivering them their private signals and the
process shared signals. Makes sense to me.

By removing that context thing, you lose the ability to listen to some
other -process- signals, which is probably a bad idea in the first place
anyway... if you're going to do that, use ptrace (yuck) :-)

Now, you -might- have valid uses for that later ability, but if not, it
then makes some sense to only "attach" when an actual read or poll is
done and only for the duration of that read/poll and only for that
reader/poller (not the whole signalfd instance).

I think that's what Nicholas means... and it may even simplify the code.

Ben.


2007-06-23 16:35:29

by Oleg Nesterov

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On 06/22, Linus Torvalds wrote:
>
> On Sat, 23 Jun 2007, Benjamin Herrenschmidt wrote:
> >
> > >
> > > It does exactly so, please note this chunk
> > >
> > > @@ -330,7 +339,7 @@ asmlinkage long sys_signalfd(int ufd, si
> > >
> > > init_waitqueue_head(&ctx->wqh);
> > > ctx->sigmask = sigmask;
> > > - ctx->tsk = current;
> > > + ctx->tsk = current->group_leader;
> > >
> > > > It might well be that signalfd's concept of context is wrong in the
> > > > first place and it should be attached to processes rather than threads
> > > > and that made more explicit in the first place...
> >
> > Yup, looks like I was looking at a wrong patch... I think it's the right
> > thing to do indeed.
>
> Quite frankly, it strikes me that if we want to do this, then we shouldn't
> save the _process_ information at all, we should save the "sighand"
> instead.

Yes, unless we pass signalfd to another process.

> So either we save the process info, or we save the sighand, but saving the
> "group_leader" seems totally bogus. Especially as the group leader can
> change (by execve()).

Note that exec() can change ->sighand as well, so in general this can't help.

Currently not a problem, exec() detaches process from signalfd anyway.


This reminds me, we have a similar problem with !CPUCLOCK_PERTHREAD()
cpu-timers, iirc. They can survive after exec(), but only if it was
->group_leader who does exec.

Oleg.

2007-06-23 22:55:17

by Nicholas Miell

[permalink] [raw]
Subject: Re: Fix signalfd interaction with thread-private signals

On Sat, 2007-06-23 at 16:05 +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2007-06-22 at 17:12 -0700, Davide Libenzi wrote:
> > Wasn't it you that bitched (just a few days ago) because multiple
> > threads
> > could not use the same signalfd and they (by your initial thought) had
> > to
> > create one per thread?
>
> He said multiple process and you say multiple threads...
>
> If signalfd isn't attached to any context, it would then be useable by
> all threads in a process, delivering them their private signals and the
> process shared signals. Makes sense to me.
>
> By removing that context thing, you lose the ability to listen to some
> other -process- signals, which is probably a bad idea in the first place
> anyway... if you're going to do that, use ptrace (yuck) :-)
>
> Now, you -might- have valid uses for that later ability, but if not, it
> then makes some sense to only "attach" when an actual read or poll is
> done and only for the duration of that read/poll and only for that
> reader/poller (not the whole signalfd instance).
>
> I think that's what Nicholas means... and it may even simplify the code.
>

That is what I was suggesting, but I don't understand the internals of
Linux signal delivery enough to know if it is possible without
unpleasant contortions to make it work.

--
Nicholas Miell <[email protected]>