1. 31 Aug, 2004 40 commits
    • Martin Schwidefsky's avatar
      [PATCH] s390: zfcp host adapater · 6da0044c
      Martin Schwidefsky authored
      zfcp host adapater changes:
       - Add ability to enqueue other WKA ports besides the nameserver port.
       - Document and cleanup sg_list functions.
       - Add get_port_by_did/get_adapater_by_busid functions.
       - Improve documentation of some functions and structures.
       - Fix error handling for nameserver requests.
       - Correct size check in zfcp_sg_list_copy_to_user.
       - Correct parameter description for loglevel parameter.
       - Remove unsused code, types and definitions.
       - Add support for exchange_port_data command.
       - Add infrastructure to set timers for ELS and SCSI commands.
       - Avoid adapter shutdown after receiving FSF_SQ_ULP_PROGRAMMING_ERROR.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6da0044c
    • Martin Schwidefsky's avatar
      [PATCH] s390: kernel stack options. · ce1cd4f3
      Martin Schwidefsky authored
      This adds support for the new compiler options -mkernel-backchain,
      -mstack-size, -mstack-guard, -mwarn-dynamicstack and -mwarn-framesize.
      
      The option -mkernel-backchain enables the use of modified layout for the
      stack frames of kernel functions.  This breaks the ABI, modules compiled
      with the option won't work on a kernel compiled with the option and vice
      versa.  The positive effect of the option is a drastic reduction of kernel
      stack use.  The trick is that the new frame layout allows to overlap the 96
      (31 bit)/160 (64 bit) byte bias areas of the functions on the call chain.
      This lowers the minimal stack usage of a function from 96 bytes to 16 bytes
      (31 bit) and 160 bytes to 24 bytes (64 bit).  The kernel stack use is
      decreased to a point where it is possible to use 4K (31 bit) / 8K (64 bit)
      stacks.  The split into process stack and interrupt stack is already in
      place.
      
      The options -mstack-size and -mstack-guard are used to detect kernel stack
      overflows.  The compiler adds code to the prolog of every function that
      causes an illegal operation if the kernel stack is about to overflow.
      
      The options -mwarn-dynamicstack and -mwarn-framesize cause the compiler to
      emit warnings if a function uses dynamic stack allocation or if the
      function frame size is bigger then a specified limit.
      
      To play safe all the new options are configurable.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      ce1cd4f3
    • Martin Schwidefsky's avatar
      [PATCH] s390: core changes · bcc61d78
      Martin Schwidefsky authored
      s390 core changes:
       - Fix a race condition between kernel thread creation and preemption.
       - Fix idal_is_needed for the border case 0x7ffff000.
       - Get rid of compiler warnings in compat_signal.c and profile.c.
       - Regenerate default configuration.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      bcc61d78
    • Jacek Poplawski's avatar
      [PATCH] stv0299 device naming fix · dc4ff161
      Jacek Poplawski authored
      Name of device has been changed in 2.6.9-rc1 to "SkyStar2", but module stv0299
      still compares name with "Technisat SkyStar2 driver", strings are different,
      and result is that stv0299 detects invalid tuner type.
      
      Cc: Johannes Stezenbach <js@linuxtv.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      dc4ff161
    • Luiz Capitulino's avatar
    • Gerd Knorr's avatar
      [PATCH] v4l/bttv: add sanity check (bug #3309) · 139bd0a4
      Gerd Knorr authored
      Missing sanity check, overlay is supported for packed pixel formats only.
      Patch below.  It's not API related btw, the bug can be triggered using the
      v4l2 API as well.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      139bd0a4
    • Antonino Daplas's avatar
      [PATCH] fbdev: fix copy_to/from_user in fbmem.c:fb_read/write · 39939350
      Antonino Daplas authored
      This patch fixes a problem reported by David S. Miller <davem@redhat.com>
      
      "I just noticed that fb_{read,write}() uses copy_*_user() with
       the kernel buffer being the frame buffer.  It needs to use
       the proper device address accessor functions."
      
      The patch will do an intermediate copy of the contents to a page-sized,
      kmalloc'ed buffer.
      Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      39939350
    • Antonino Daplas's avatar
      [PATCH] fbdev: fix kernel panic from FBIO_CURSOR ioctl · 6254ea38
      Antonino Daplas authored
      1. This fixes a kernel oops when issuing an FBIO_CURSOR ioctl if struct
         fb_cursor_user is filled with zero/NULLs.  Reported by Yuval Kogman
         <nothingmuch@woobling.org>.
      
      2. This also fixes the cursor corruption in soft_cursor when
         sprite.scan_align != 1.
      Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6254ea38
    • Vegard Wærp's avatar
      [PATCH] BeFS: load default nls if none is specified in mount options · 12a88695
      Vegard Wærp authored
      Makes the BeOS File Systen driver load the default nls if none is specified
      in the "iocharset" mount option.
      Signed-off-by: default avatarVegard Wærp <vegarwa@online.no>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      12a88695
    • Christoph Hellwig's avatar
      [PATCH] fix devfs name for microcode driver · 44a4ce89
      Christoph Hellwig authored
      Seem like devfsd expects it in /dev/cpu/microcode and Debian users do
      as well.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      44a4ce89
    • William Lee Irwin III's avatar
      336843dd
    • Christoph Hellwig's avatar
      [PATCH] mark pcxx as broken · 0f10193f
      Christoph Hellwig authored
      It's already marked BROKEN_ON_SMP, but even a UP compile yields tons of
      errors.  While those aren't deeply complicated to fix having them for over
      a year now is a pretty good indicator no one cares.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      0f10193f
    • Christoph Hellwig's avatar
      [PATCH] hfs/hfsplus is missing .sendfile · 23db2f30
      Christoph Hellwig authored
      There seem to be some crazy mac users that want to use the loop driver
      on hfsplus.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      23db2f30
    • Ronald Bultje's avatar
      [PATCH] zr36067 driver - correct subfrequency carrier · 98088ec9
      Ronald Bultje authored
      attached patch changes the subfrequency carrier value in the adv7175
      video output driver which is part of the zr36067 driver package. The
      practical consequence is that the picture will be more stable on
      non-passthrough video mode in NTSC. It does not affect PAL/SECAM. Patch
      originally submitted by Douglas Fraser <ds-fraser@comcast.net> (8/21).
      Signed-off-by: default avatarRonald Bultje <rbultje@ronald.bitfreak.net>
      Signed-off-by: default avatarDouglas Fraser <ds-fraser@comcast.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      98088ec9
    • Ronald Bultje's avatar
      [PATCH] zr36067 driver - use msleep() instead of schedule_timeout() · 1cbe8fd7
      Ronald Bultje authored
      attached patch makes the zr36067 driver use msleep() instead of
      schedule_timeout() with uninterruptible state. Patch originally
      submitted by Nishanth Aravamudan <nacc@us.ibm.com> (7/26).
      Signed-off-by: default avatarRonald Bultje <rbultje@ronald.bitfreak.net>
      Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      1cbe8fd7
    • Ronald Bultje's avatar
      [PATCH] zr36067 driver - correct i2c-algo-bit dependency in Kconfig · 95a99251
      Ronald Bultje authored
      attached patch correctly makes the zr36067 driver depend on i2c-ago-bit in
      the kernel config.  Bug reported and patch sent to me by Adrian Bunk
      <bunk@fs.tum.de> (6/21).  It wasn't signed off.
      Signed-off-by: default avatarRonald Bultje <rbultje@ronald.bitfreak.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      95a99251
    • Brian Gerst's avatar
      [PATCH] Fix hardcoded value in vsyscall.lds · abee6121
      Brian Gerst authored
      The last attempt to clean this up still left a hardcoded constant (the
      offset from __FIXADDR_TOP).  This patch moves VSYSCALL_BASE to
      asm-offsets.c.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      abee6121
    • Joshua Kwan's avatar
      [PATCH] export more symbols on sparc32 · 9411fcb2
      Joshua Kwan authored
      Cc: William Lee Irwin III <wli@holomorphy.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      9411fcb2
    • Andrew Morton's avatar
      [PATCH] remove ext2_panic() prototype · 39881855
      Andrew Morton authored
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      39881855
    • Ryan S. Arnold's avatar
      [PATCH] interrupt driven hvc_console as vio device · 1fd6c4af
      Ryan S. Arnold authored
      This is an hvc_console patch which provides driver and ppc64 architecture
      fixes to enable the hvc_console driver to register itself as a vio device
      with the vio bus, provide hotplug add/remove for vty adapters, and act as
      an interrupt driven driver on Power-5 hardware or remain as a polling
      driver on Power-4 hardware.
      
      arch/ppc64/kernel/hvconsole.c
      =============================
      
      - Changed hvc_get_chars() and hvc_put_chars() api to take vtermno rather
        than index number.
      
      - Added hvc_find_vtys() function which walks the bus looking for
        vterm/vty devices to callback to the hvc_console driver.  This provides
        console output functionality prior to early console init (pre mem init
        and pre device probe).
      
      include/asm-ppc64/hvconsole.h
      =============================
      
      - Changed hvc_get_chars() and hvc_put_chars() api to take vtermno rather
        than index number.
      
      - Added hvc_find_vtys() function.
      
      - Added hvc_instantiate() function which is implemented by a console
        driver wanting to receive a callback of and early console init.
      
      drivers/char/hvc_console.c
      ==========================
      
      - Switch khvcd from kernel_threads to kthreads which got rid of
        deprecated daemonize().
      
      - Added module exit clause to be thorough (not terribly necessary with a
        console driver of course)
      
      - Added early discovery of vterm/vty adapters by doing a bus walk on
        early console init which results in hvc_instantiate() callback and
        addition of the vtermno into a static array of vtermnos supported as
        console adapters (meaning the console api's work against these vtermnos
        prior to full console initialization).
      
      - This driver is now registered as a vio driver which means that vty
        adapters are now managed via probe/remove.  This means hvc_console
        supports hotplug vty adapters.
      
      - Driver now requests more device nodes than what was found on the
        initial bus walk when registered as a tty driver to make room for hotplug
        vty adapters.  These secondary vty adapters provide a tty tunnel between
        partitions.
      
      - Removed static hvc_struct array and replaced with a linux list that has
        elements (hvc_struct instances) added/removed on probe/remove AFTER early
        console init.  This is important because kmalloc can't be done at early
        console init.
      
      - Driver now either runs in interrupt driven mode or in polling mode on
        older hardware.  The khvcd is smart enough to not 'schedule()' when there
        are no interrupts.
      
      - kobjects are now used for ref counting on the hvc_struct instances.
      
      - This driver puts the tty layer to sleep on hvc_close() if there are
        pending data writes being blocked by firmware.
      
      - Removed useless spinlocks in hvc_chars_in_buffer() and hvc_write_room.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarRyan S. Arnold <rsa@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      1fd6c4af
    • Paul Fulghum's avatar
      [PATCH] synclinkmp transmit eom fix · 43eef00a
      Paul Fulghum authored
      Bug Fixes:
      
      * Fix transmit end of message (EOM) processing to work correctly with
        hardware auto CTS feature
      
      * Fix oops in error path if hardware diags fail during device
        initialization
      
      Cosmetic change:
      
      * Use existing macros for address space size instead of hardcoded values
      Signed-off-by: default avatarPaul Fulghum <paulkf@microgate.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      43eef00a
    • David Howells's avatar
      [PATCH] Fix a NULL pointer bug in do_generic_file_read() · a3f5b14e
      David Howells authored
      The attached patch fixes a bug introduced into do_generic_mapping_read() by
      which a file pointer becomes required.  I'd arranged things so that the
      file pointer was optional so that I could call the function directly on an
      inode.
      Signed-Off-By: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a3f5b14e
    • H. Peter Anvin's avatar
      [PATCH] Make i386 signal delivery work with -mregparm · 9691cc0d
      H. Peter Anvin authored
      This patch allows i386 signal delivery to work correctly when userspace is
      compiled with -mregparm.  This is somewhat hacky: it passes the arguments
      *both* on the stack and in registers, but it works because there are only
      one or three (depending on SA_SIGINFO) official arguments.  If you're
      relying on the unofficial arguments then you're doing something nonportable
      anyway and can put in the __attribute__((cdecl,regparm(0))) in the correct
      place.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      9691cc0d
    • Jeff Moyer's avatar
      [PATCH] netpoll: fix up trapped logic · 26fec91d
      Jeff Moyer authored
      This patch contains the updates necessary to fix the hangs in netconsole.
      This includes the changing of trapped to an atomic_t, and the addition of a
      netpoll_poll_lock.  It also turns dev->netpoll_rx into a bitfield which is
      used to keep from running the networking code from the netpoll_poll call path.
      Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      26fec91d
    • Jeff Moyer's avatar
      [PATCH] netpoll: increase NAPI budget · 5b9c63bc
      Jeff Moyer authored
      I've upped the poll budget to 16 and added a comment explaining why.  I
      definitely ran into this problem when testing netdump.
      Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      5b9c63bc
    • Jeff Moyer's avatar
      [PATCH] netpoll: kill CONFIG_NETPOLL_RX · e3c265bc
      Jeff Moyer authored
      This patch removes CONFIG_NETPOLL_RX, as discussed.
      Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e3c265bc
    • Matt Mackall's avatar
      [PATCH] netpoll: revert queue stopped change · a668a6b0
      Matt Mackall authored
      Here's the first of the broken out patch set.  This puts the check for
      netif_queue_stopped back into netpoll_send_skb.  Network drivers are not
      designed to have their hard_start_xmit routines called when the queue is
      stopped.
      Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a668a6b0
    • Matt Mackall's avatar
      [PATCH] netpoll: fix unaligned accesses · 76bd9baa
      Matt Mackall authored
      Avoid some alignment traps.
      Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      76bd9baa
    • Paolo Ornati's avatar
      [PATCH] tdfx linkage fix · 4dca0193
      Paolo Ornati authored
      drivers/built-in.o(.data+0x40a68): undefined reference to `cfb_fillrect'
      drivers/built-in.o(.data+0x40a6c): undefined reference to `cfb_copyarea'
      
      3dfx framebuffer driver depends on "cfb_fillrect.c" and "cfb_copyarea.c" if
      it's compiled without CONFIG_FB_3DFX_ACCEL turned on...
      Signed-off-by: default avatarPaolo Ornati <ornati@fastwebnet.it>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      4dca0193
    • Andy Whitcroft's avatar
      [PATCH] use page_to_nid · 12bf4a56
      Andy Whitcroft authored
      There are a couple of places where we seem to go round the houses to get
      the numa node id from a page.  We have a macro for this so it seems
      sensible to use that.
      
      Both lookup_node and enqueue_huge_page use page_zone() to locate the zone,
      that to locate node pgdat_t and that to get the node_id.  Its more
      efficient to use page_to_nid() which gets the nid from the page flags,
      especially if we are not using the zone for anything else it.  Change these
      to use page_to_nid().
      Signed-off-by: default avatarAndy Whitcroft <apw@shadowen.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      12bf4a56
    • Andy Whitcroft's avatar
      [PATCH] i386 bootmem restrictions · b1480d3f
      Andy Whitcroft authored
      (Comment changes only)
      
      The bootmem allocator is initialised before the kernel virtual address
      space has been fully established.  As a result, any allocations which are
      made before paging_init() has completed may point to invalid kernel
      addresses.  This patch notes this limitation and indicates where the
      allocator is fully available.
      Signed-off-by: default avatarAndy Whitcroft <apw@shadowen.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b1480d3f
    • Rusty Russell's avatar
      [PATCH] Don't OOPS on stripped modules · 758638eb
      Rusty Russell authored
      Don't want to go overboard with the checks, but this is simple and
      reasonable.
      
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (modified)
      Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      758638eb
    • Olaf Kirch's avatar
      [PATCH] Prevent memory leak in devpts · 8cc42321
      Olaf Kirch authored
      There is a dentry refcount leak in devpts_get_tty.
      
      struct tty_struct *devpts_get_tty(int number)
      {
              struct dentry *dentry = get_node(number);
              struct tty_struct *tty;
      
              tty = (IS_ERR(dentry) || !dentry->d_inode) ? NULL :
                              dentry->d_inode->u.generic_ip;
      
              up(&devpts_root->d_inode->i_sem);
              return tty;
      }
      
      The get_node function does a lookup on /dev/pts/<number> and returns the
      dentry, taking a reference.  We should dput the dentry after extracting the
      tty pointer.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      8cc42321
    • Joanne Dow's avatar
      [PATCH] Amiga partition reading fix · b13b24e7
      Joanne Dow authored
      I have a large archive of files stored on Amiga volumes.  Many of these
      volumes are on Fujitsu magneto-optical disks with 2k sector size.  The
      existing partitioning code cannot properly read them since it appears the
      OS automatically deblocks the large sectors into logical 512 byte sectors,
      something AmigaDOS never did.  I arranged the partitioning code to handle
      this situation.
      
      Second I have some rather strange test case disks, including my largest
      storage partition, that have somewhat unusual partition values.  As such I
      needed additional information in addition to the first and last block
      number information.  AmigaDOS reserves N blocks, with N greater than or
      equal to 1 and less than the size of the partition, for some boot time
      information and signatures.  I have some partitions that use other than the
      usual value of 2.
      
      There is one more "fix" that could be put in if someone needs it.  Another
      value in the "Rigid Disk Blocks" description of a partition is a "PreAlloc"
      value.  It defines a number of blocks at the end of the disk that are not
      considered to be a real part of the partition.  This was "important" in the
      days of 20 meg and 40 meg hard disks.  It is hardly important and not used
      on modern drives without special user intervention.
      
      This partitioning information is known correct.  I wrote the low level
      portion of the hard disk partitioning code for AmigaDOS 3.5 and 3.9.  I am
      also responsible for one of the more frequently used partitioning tools,
      RDPrepX, before that.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b13b24e7
    • Nick Piggin's avatar
      33982f7f
    • Nick Piggin's avatar
      [PATCH] use hlist for pid hash · f59ad67e
      Nick Piggin authored
      Use hlists for the PID hashes.  This halves the memory footprint of these
      hashes.  No benchmarks, but I think this is a worthy improvement because
      the hashes are something that would be likely to have significant portions
      loaded into the cache of every CPU on some workloads.
      
      This comes at the "expense" of
      	1. reintroducing the memory  prefetch into the hash traversal loop;
      	2. adding new pids to the head of the list instead of the tail. I
      	   suspect that if this was a big problem then the hash isn't sized
      	   well or could benefit from moving hot entries to the head.
      
      Also, account for all the pid hashes when reporting hash memory usage.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      f59ad67e
    • Nick Piggin's avatar
      [PATCH] fix PID hash sizing · 2c05d9eb
      Nick Piggin authored
      A 4GB, 4-way Opteron would create the smallest size table (16 entries) because
      pidhash_init is called before mem_init which is where x86-64 sets up max_pfn.
      
      nr_kernel_pages is setup by paging_init, called from setup_arch, which is also
      where i386 sets up max_pfn.
      
      So export nr_kernel_pages, nr_all_pages.  Use nr_kernel_pages when sizing the
      PID hash.  This fixes the problem.
      
      This also makes the pid hash dependant on the size of ZONE_NORMAL instead of
      total size of memory.
      Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      2c05d9eb
    • Roland McGrath's avatar
      [PATCH] fix rusage semantics · 497c9d68
      Roland McGrath authored
      This patch changes the rusage bookkeeping and the semantics of the
      getrusage and times calls in a couple of ways.
      
      The first change is in the c* fields counting dead child processes.  POSIX
      requires that children that have died be counted in these fields when they
      are reaped by a wait* call, and that if they are never reaped (e.g.
      because of ignoring SIGCHLD, or exitting yourself first) then they are
      never counted.  These were counted in release_task for all threads.  I've
      changed it so they are counted in wait_task_zombie, i.e.  exactly when
      being reaped.
      
      POSIX also specifies for RUSAGE_CHILDREN that the report include the reaped
      child processes of the calling process, i.e.  whole thread group in Linux,
      not just ones forked by the calling thread.  POSIX specifies tms_c[us]time
      fields in the times call the same way.  I've moved the c* fields that
      contain this information into signal_struct, where the single set of
      counters accumulates data from any thread in the group that calls wait*.
      
      Finally, POSIX specifies getrusage and times as returning cumulative totals
      for the whole process (aka thread group), not just the calling thread.
      I've added fields in signal_struct to accumulate the stats of detached
      threads as they die.  The process stats are the sums of these records plus
      the stats of remaining each live/zombie thread.  The times and getrusage
      calls, and the internal uses for filling in wait4 results and siginfo_t,
      now iterate over the threads in the thread group and sum up their stats
      along with the stats recorded for threads already dead and gone.
      
      I added a new value RUSAGE_GROUP (-3) for the getrusage system call rather
      than changing the behavior of the old RUSAGE_SELF (0).  POSIX specifies
      RUSAGE_SELF to mean all threads, so the glibc getrusage call will just
      translate it to RUSAGE_GROUP for new kernels.  I did this thinking that
      someone somewhere might want the old behavior with an old glibc and a new
      kernel (it is only different if they are using CLONE_THREAD anyway). 
      However, I've changed the times system call to conform to POSIX as well and
      did not provide any backward compatibility there.  In that case there is
      nothing easy like a parameter value to use, it would have to be a new
      system call number.  That seems pretty pointless.  Given that, I wonder if
      it is worth bothering to preserve the compatible RUSAGE_SELF behavior by
      introducing RUSAGE_GROUP instead of just changing RUSAGE_SELF's meaning.
      Comments?
      
      I've done some basic testing on x86 and x86-64, and all the numbers come
      out right after these fixes.  (I have a test program that shows a few
      Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      497c9d68
    • Roland McGrath's avatar
      [PATCH] waitid system call · ca3f74aa
      Roland McGrath authored
      This patch adds a new system call `waitid'.  This is a new POSIX call that
      subsumes the rest of the wait* family and can do some things the older
      calls cannot.  A minor addition is the ability to select what kinds of
      status to check for with a mask of independent bits, so you can wait for
      just stops and not terminations, for example.  A more significant
      improvement is the WNOWAIT flag, which allows for polling child status
      without reaping.  This interface fills in a siginfo_t with the same details
      that a SIGCHLD for the status change has; some of that info (e.g.  si_uid)
      is not available via wait4 or other calls.
      
      I've added a new system call that has the parameter conventions of the
      POSIX function because that seems like the cleanest thing.  This patch
      includes the actual system call table additions for i386 and x86-64; other
      architectures will need to assign the system call number, and 64-bit ones
      may need to implement 32-bit compat support for it as I did for x86-64. 
      The new features could instead be provided by some new kludge inventions in
      the wait4 system call interface (that's what BSD did).  If kludges are
      preferable to adding a system call, I can work up something different.
      
      I added a struct rusage field si_rusage to siginfo_t in the SIGCHLD case
      (this does not affect the size or layout of the struct).  This is not part
      of the POSIX interface, but it makes it so that `waitid' subsumes all the
      functionality of `wait4'.  Future kernel ABIs (new arch's or whatnot) can
      have only the `waitid' system call and the rest of the wait* family
      including wait3 and wait4 can be implemented in user space using waitid.
      There is nothing in user space as yet that would make use of the new field.
      
      Most of the new functionality is implemented purely in the waitid system
      call itself.  POSIX also provides for the WCONTINUED flag to report when a
      child process had been stopped by job control and then resumed with
      SIGCONT.  Corresponding to this, a SIGCHLD is now generated when a child
      resumes (unless SA_NOCLDSTOP is set), with the value CLD_CONTINUED in
      siginfo_t.si_code.  To implement this, some additional bookkeeping is
      required in the signal code handling job control stops.
      
      The motivation for this work is to make it possible to implement the POSIX
      semantics of the `waitid' function in glibc completely and correctly.  If
      changing either the system call interface used to accomplish that, or any
      details of the kernel implementation work, would improve the chances of
      getting this incorporated, I am more than happy to work through any issues.
      Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      ca3f74aa
    • Anton Blanchard's avatar
      [PATCH] Using get_cycles for add_timer_randomness · 4c746d40
      Anton Blanchard authored
      I tested how long it took to do a dd from /dev/random on ppc64 before and
      after this patch, while doing a ping flood from another machine.
      
      before:
      # /usr/bin/time dd if=/dev/random of=/dev/zero count=1k
      0+51 records in
      Command terminated by signal 2
      0.00user 0.00system 19:18.46elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
      
      I gave up after 19 minutes.
      
      after:
      # /usr/bin/time dd if=/dev/random of=/dev/zero count=1k
      0+1024 records in
      0.00user 0.00system 0:33.38elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
      
      Just over 33 seconds. Better.
      
      From: Arnd Bergmann <arnd@arndb.de>
      
      I noticed that only i386 and x86-64 are currently using a high resolution
      timer source when adding randomness.  Since many architectures have a
      working get_cycles() implementation, it seems rather straightforward to use
      that.
      
      Has this been discussed before, or can anyone comment on the implementation
      below?
      
      This patch attempts to take into account the size of cycles_t, which is
      either 32 or 64 bits wide but independent of the architecture's word size.
      
      The behavior should be nearly identical to the old one on i386, x86-64 and
      all architectures without a time stamp counter, while finding more entropy
      on the other architectures.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      4c746d40