1. 08 9月, 2005 31 次提交
    • A
      [PATCH] dmi: add onboard devices discovery · ebad6a42
      Andrey Panin 提交于
      This patch adds onboard devices and IPMI BMC discovery into DMI scan code.
      Drivers can use dmi_find_device() function to search for devices by type and
      name.
      Signed-off-by: NAndrey Panin <pazke@donpac.ru>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ebad6a42
    • M
      [PATCH] remove duplicated sys_open32() code from 64bit archs · e922efc3
      Miklos Szeredi 提交于
      64 bit architectures all implement their own compatibility sys_open(),
      when in fact the difference is simply not forcing the O_LARGEFILE
      flag.  So use the a common function instead.
      Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
      Cc: <viro@parcelfarce.linux.theplanet.co.uk>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e922efc3
    • M
      [PATCH] remove duplicated code from proc and ptrace · ab8d11be
      Miklos Szeredi 提交于
      Extract common code used by ptrace_attach() and may_ptrace_attach()
      into a separate function.
      Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
      Cc: <viro@parcelfarce.linux.theplanet.co.uk>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ab8d11be
    • M
      [PATCH] remove iattr.ia_attr_flags · e89bbd3a
      Miklos Szeredi 提交于
      Remove unused ia_attr_flags from struct iattr, and related defines.
      Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e89bbd3a
    • E
      [PATCH] struct dentry: place d_hash close to d_parent and d_name to speedup lookups · 3f4bb1f4
      Eric Dumazet 提交于
      dentry cache uses sophisticated RCU technology (and prefetching if
      available) but touches 2 cache lines per dentry during hlist lookup.
      
      This patch moves d_hash in the same cache line than d_parent and d_name
      fields so that :
      
      1) One cache line is needed instead of two.
      
      2) the hlist_for_each_rcu() prefetching has a chance to bring all the
         needed data in advance, not only the part that includes d_hash.next.
      
      I also changed one old comment that was wrong for 64bits.
      
      A further optimisation would be to separate dentry in two parts, one that
      is mostly read, and one writen (d_count/d_lock) to avoid false sharing on
      SMP/NUMA but this would need different field placement depending on 32bits
      or 64bits platform.
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3f4bb1f4
    • J
      9c1cfda2
    • P
      [PATCH] cpusets: confine oom_killer to mem_exclusive cpuset · ef08e3b4
      Paul Jackson 提交于
      Now the real motivation for this cpuset mem_exclusive patch series seems
      trivial.
      
      This patch keeps a task in or under one mem_exclusive cpuset from provoking an
      oom kill of a task under a non-overlapping mem_exclusive cpuset.  Since only
      interrupt and GFP_ATOMIC allocations are allowed to escape mem_exclusive
      containment, there is little to gain from oom killing a task under a
      non-overlapping mem_exclusive cpuset, as almost all kernel and user memory
      allocation must come from disjoint memory nodes.
      
      This patch enables configuring a system so that a runaway job under one
      mem_exclusive cpuset cannot cause the killing of a job in another such cpuset
      that might be using very high compute and memory resources for a prolonged
      time.
      Signed-off-by: NPaul Jackson <pj@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ef08e3b4
    • P
      [PATCH] cpusets: formalize intermediate GFP_KERNEL containment · 9bf2229f
      Paul Jackson 提交于
      This patch makes use of the previously underutilized cpuset flag
      'mem_exclusive' to provide what amounts to another layer of memory placement
      resolution.  With this patch, there are now the following four layers of
      memory placement available:
      
       1) The whole system (interrupt and GFP_ATOMIC allocations can use this),
       2) The nearest enclosing mem_exclusive cpuset (GFP_KERNEL allocations can use),
       3) The current tasks cpuset (GFP_USER allocations constrained to here), and
       4) Specific node placement, using mbind and set_mempolicy.
      
      These nest - each layer is a subset (same or within) of the previous.
      
      Layer (2) above is new, with this patch.  The call used to check whether a
      zone (its node, actually) is in a cpuset (in its mems_allowed, actually) is
      extended to take a gfp_mask argument, and its logic is extended, in the case
      that __GFP_HARDWALL is not set in the flag bits, to look up the cpuset
      hierarchy for the nearest enclosing mem_exclusive cpuset, to determine if
      placement is allowed.  The definition of GFP_USER, which used to be identical
      to GFP_KERNEL, is changed to also set the __GFP_HARDWALL bit, in the previous
      cpuset_gfp_hardwall_flag patch.
      
      GFP_ATOMIC and GFP_KERNEL allocations will stay within the current tasks
      cpuset, so long as any node therein is not too tight on memory, but will
      escape to the larger layer, if need be.
      
      The intended use is to allow something like a batch manager to handle several
      jobs, each job in its own cpuset, but using common kernel memory for caches
      and such.  Swapper and oom_kill activity is also constrained to Layer (2).  A
      task in or below one mem_exclusive cpuset should not cause swapping on nodes
      in another non-overlapping mem_exclusive cpuset, nor provoke oom_killing of a
      task in another such cpuset.  Heavy use of kernel memory for i/o caching and
      such by one job should not impact the memory available to jobs in other
      non-overlapping mem_exclusive cpusets.
      
      This patch enables providing hardwall, inescapable cpusets for memory
      allocations of each job, while sharing kernel memory allocations between
      several jobs, in an enclosing mem_exclusive cpuset.
      
      Like Dinakar's patch earlier to enable administering sched domains using the
      cpu_exclusive flag, this patch also provides a useful meaning to a cpuset flag
      that had previously done nothing much useful other than restrict what cpuset
      configurations were allowed.
      Signed-off-by: NPaul Jackson <pj@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9bf2229f
    • P
      [PATCH] cpusets: new __GFP_HARDWALL flag · f90b1d2f
      Paul Jackson 提交于
      Add another GFP flag: __GFP_HARDWALL.
      
      A subsequent "cpuset_zone_allowed" patch will use this flag to mark GFP_USER
      allocations, and distinguish them from GFP_KERNEL allocations.
      
      Allocations (such as GFP_USER) marked GFP_HARDWALL are constrainted to the
      current tasks cpuset.  Other allocations (such as GFP_KERNEL) can steal from
      the possibly larger nearest mem_exclusive cpuset ancestor, if memory is tight
      on every node in the current cpuset.
      
      This patch collides with Mel Gorman's patch to reduce fragmentation in the
      standard buddy allocator, which adds two GFP flags.  This was discussed on
      linux-mm in July.  Most likely, one of his flags for user reclaimable memory
      can be the same as my __GFP_HARDWALL flag, under some generic name meaning its
      user address space memory.
      Signed-off-by: NPaul Jackson <pj@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f90b1d2f
    • J
      [PATCH] inotify: fix event loss on hardlinked files · 7ea6040b
      John McCutchan 提交于
      People have run into a problem when they do this:
      
      watch (file1, all_events);
      watch (file2, some_events);
      
      if file2 is a hard link to file1, some events will be missed because by
      default we replace the mask.  The patch below adds a flag IN_MASK_ADD which
      will cause inotify to add to the existing mask if present.
      Signed-off-by: NJohn McCutchan <ttb@tentacle.dhs.org>
      Signed-off-by: NRobert Love <rml@novell.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7ea6040b
    • K
      [PATCH] Remove non-arch consumers of asm/segment.h · 9c45817f
      Kumar Gala 提交于
      asm/segment.h varies greatly on different architectures but is clearly
      deprecated.  Removing all non-architecture consumers will make it easier
      for us to get ride of asm/segment.h all together.
      Signed-off-by: NKumar Gala <kumar.gala@freescale.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9c45817f
    • J
      [PATCH] NTP: ntp-helper functions · b149ee22
      john stultz 提交于
      This patch cleans up a commonly repeated set of changes to the NTP state
      variables by adding two helper inline functions:
      
      ntp_clear(): Clears the ntp state variables
      
      ntp_synced(): Returns 1 if the system is synced with a time server.
      
      This was compile tested for alpha, arm, i386, x86-64, ppc64, s390, sparc,
      sparc64.
      Signed-off-by: NJohn Stultz <johnstul@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b149ee22
    • E
      [PATCH] remove file.f_maxcount · 2832e936
      Eric Dumazet 提交于
      struct file cleanup: f_maxcount has an unique value (INT_MAX).  Just use
      the hard-wired value.
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      2832e936
    • R
      [PATCH] Delete unused do_nanosleep declaration · f23ef184
      Ralf Baechle 提交于
      There is no do_nanosleep function so kill it's declaration in <linux/time.h>.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f23ef184
    • K
      [PATCH] CHECK_IRQ_PER_CPU() to avoid dead code in __do_IRQ() · f26fdd59
      Karsten Wiese 提交于
      IRQ_PER_CPU is not used by all architectures.  This patch introduces the
      macros ARCH_HAS_IRQ_PER_CPU and CHECK_IRQ_PER_CPU() to avoid the generation
      of dead code in __do_IRQ().
      
      ARCH_HAS_IRQ_PER_CPU is defined by architectures using IRQ_PER_CPU in their
      include/asm_ARCH/irq.h file.
      
      Through grepping the tree I found the following architectures currently use
      IRQ_PER_CPU:
      
              cris, ia64, ppc, ppc64 and parisc.
      Signed-off-by: NKarsten Wiese <annabellesgarden@yahoo.de>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f26fdd59
    • A
      [PATCH] modified firmware_class.c to support no hotplug · 6e3eaab0
      Abhay Salunke 提交于
      Upgrade the request_firmware_nowait function to not start the hotplug
      action on a firmware update.
      
      This patch is tested along with dell_rbu driver on i386 and x86-64 systems.
      Signed-off-by: NAbhay Salunke <Abhay_Salunke@dell.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6e3eaab0
    • M
      [PATCH] ipc: convert /proc/sysvipc/* to generic seq_file interface · 19b4946c
      Mike Waychison 提交于
      Change the /proc/sysvipc/shm|sem|msg files to use the generic seq_file
      implementation for struct ipc_ids.
      Signed-off-by: NMike Waychison <mikew@google.com>
      Cc: Manfred Spraul <manfred@colorfullife.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      19b4946c
    • B
      [PATCH] sunrpc: cache_register can use wrong module reference · f35279d3
      Bruce Allan 提交于
      When registering an RPC cache, cache_register() always sets the owner as the
      sunrpc module.  However, there are RPC caches owned by other modules.  With
      the incorrect owner setting, the real owning module can be removed potentially
      with an open reference to the cache from userspace.
      
      For example, if one were to stop the nfs server and unmount the nfsd
      filesystem, the nfsd module could be removed eventhough rpc.idmapd had
      references to the idtoname and nametoid caches (i.e.
      /proc/net/rpc/nfs4.<cachename>/channel is still open).  This resulted in a
      system panic on one of our machines when attempting to restart the nfs
      services after reloading the nfsd module.
      
      The following patch adds a 'struct module *owner' field in struct
      cache_detail.  The owner is further assigned to the struct proc_dir_entry
      in cache_register() so that the module cannot be unloaded while user-space
      daemons have an open reference on the associated file under /proc.
      Signed-off-by: NBruce Allan <bwa@us.ibm.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: Neil Brown <neilb@cse.unsw.edu.au>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f35279d3
    • B
      [PATCH] PNP: make pnp_dbg conditional directly on CONFIG_PNP_DEBUG · e139aa59
      Bjorn Helgaas 提交于
      Seems pointless to require .c files to test CONFIG_PNP_DEBUG and
      conditionally define DEBUG before including <linux/pnp.h>.  Just test
      CONFIG_PNP_DEBUG directly in pnp.h.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Adam Belay <ambx1@neo.rr.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e139aa59
    • E
      [PATCH] sonypi SPIC initialisation fix · d2052c16
      Erik Waling 提交于
      Newer Sony VAIO models (VGN-S480, VGN-S460, VGN-S3XP etc) use a new method to
      initialize the SPIC device.  The new way to initialize (and disable) the
      device comes directly from the AML code in the _CRS, _SRS and _DIS methods
      from the DSDT table.  This patch adds support for the new models.
      Signed-off-by: NErik Waling <erikw@acc.umu.se>
      Signed-off-by: NStelian Pop <stelian@popies.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d2052c16
    • Z
      [PATCH] remove pipe definitions · 2865cf00
      Zhigang Huo 提交于
      These no longer have any users.
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      2865cf00
    • M
      [PATCH] disk quotas fail when /etc/mtab is symlinked to /proc/mounts · 8fc2751b
      Mark Bellon 提交于
      If /etc/mtab is a regular file all of the mount options (of a file system)
      are written to /etc/mtab by the mount command.  The quota tools look there
      for the quota strings for their operation.  If, however, /etc/mtab is a
      symlink to /proc/mounts (a "good thing" in some environments) the tools
      don't write anything - they assume the kernel will take care of things.
      
      While the quota options are sent down to the kernel via the mount system
      call and the file system codes handle them properly unfortunately there is
      no code to echo the quota strings into /proc/mounts and the quota tools
      fail in the symlink case.
      
      The attached patchs modify the EXT[2|3] and JFS codes to add the necessary
      hooks.  The show_options function of each file system in these patches
      currently deal with only those things that seemed related to quotas;
      especially in the EXT3 case more can be done (later?).
      
      Jan Kara also noted the difficulty in moving these changes above the FS
      codes responding similarly to myself to Andrew's comment about possible
      VFS migration. Issue summary:
      
       - FS codes have to process the entire string of options anyway.
      
       - Only FS codes that use quotas must have a show_options function (for
         quotas to work properly) however quotas are only used in a small number
         of FS.
      
       - Since most of the quota using FS support other options these FS codes
         should have the a show_options function to show those options - and the
         quota echoing becomes virtually negligible.
      
      Based on feedback I have modified my patches from the original:
      
         JFS a missing patch has been restored to the posting
         EXT[2|3] and JFS always use the show_options function
             - Each FS has at least one FS specific option displayed
             - QUOTA output is under a CONFIG_QUOTA ifdef
             - a follow-on patch will add a multitude of options for each FS
         EXT[2|3] and JFS "quota" is treated as "usrquota"
         EXT3 journalled data check for journalled quota removed
         EXT[2|3] mount when quota specified but not compiled in
      
       - no changes from my original patch.  I tested the patch and the codes
         warn but
      
       - still mount.  With all due respection I believe the comments
         otherwise were a
      
       - misread of the patch.  Please reread/test and comment.  XFS patch
         removed - the XFS team already made the necessary changes EXT3 mixing
         old and new quotas are handled differently (not purely exclusive)
      
       - if old and new quotas for the same type are used together the old
         type is silently depricated for compatability (e.g.  usrquota and
         usrjquota)
      
       - mixing of old and new quotas is an error (e.g.  usrjquota and
         grpquota)
      Signed-off-by: NMark Bellon <mbellon@mvista.com>
      Acked-by: NDave Kleikamp <shaggy@austin.ibm.com>
      Cc: Jan Kara <jack@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8fc2751b
    • H
      [PATCH] auxiliary vector cleanups · 36d57ac4
      H. J. Lu 提交于
      The size of auxiliary vector is fixed at 42 in linux/sched.h.  But it isn't
      very obvious when looking at linux/elf.h.  This patch adds AT_VECTOR_SIZE
      so that we can change it if necessary when a new vector is added.
      
      Because of include file ordering problems, doing this necessitated the
      extraction of the AT_* symbols into a standalone header file.
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      36d57ac4
    • A
      [PATCH] remove register_ioctl32_conversion and unregister_ioctl32_conversion · 5dd42c26
      Adrian Bunk 提交于
      All users have been converted.
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5dd42c26
    • P
      [PATCH] kill bio->bi_set · 3676347a
      Peter Osterlund 提交于
      Jens:
      
      ->bi_set is totally unnecessary bloat of struct bio.  Just define a proper
      destructor for the bio and it already knows what bio_set it belongs too.
      
      Peter:
      
      Fixed the bugs.
      Signed-off-by: NJens Axboe <axboe@suse.de>
      Signed-off-by: NPeter Osterlund <petero2@telia.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3676347a
    • A
      [PATCH] fs/jbd/: cleanups · 022a4a7b
      Adrian Bunk 提交于
      This patch contains the following cleanups:
      - make needlessly global functions static
      - journal.c: remove the unused global function __journal_internal_check
                   and move the check to journal_init
      - remove the following write-only global variable:
        - journal.c: current_journal
      - remove the following unneeded EXPORT_SYMBOL:
        - journal.c: journal_recover
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Acked-by: NAndreas Dilger <adilger@clusterfs.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      022a4a7b
    • S
      [PATCH] compat: be more consistent about [ug]id_t · 202e5979
      Stephen Rothwell 提交于
      When I first wrote the compat layer patches, I was somewhat cavalier about
      the definition of compat_uid_t and compat_gid_t (or maybe I just
      misunderstood :-)).  This patch makes the compat types much more consistent
      with the types we are being compatible with and hopefully will fix a few
      bugs along the way.
      
      	compat type		type in compat arch
      	__compat_[ug]id_t	__kernel_[ug]id_t
      	__compat_[ug]id32_t	__kernel_[ug]id32_t
      	compat_[ug]id_t		[ug]id_t
      
      The difference is that compat_uid_t is always 32 bits (for the archs we
      care about) but __compat_uid_t may be 16 bits on some.
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      202e5979
    • T
      [PATCH] relayfs · e82894f8
      Tom Zanussi 提交于
      Here's the latest version of relayfs, against linux-2.6.11-mm2.  I'm hoping
      you'll consider putting this version back into your tree - the previous
      rounds of comment seem to have shaken out all the API issues and the number
      of comments on the code itself have also steadily dwindled.
      
      This patch is essentially the same as the relayfs redux part 5 patch, with
      some minor changes based on reviewer comments.  Thanks again to Pekka
      Enberg for those.  The patch size without documentation is now a little
      smaller at just over 40k.  Here's a detailed list of the changes:
      
      - removed the attribute_flags in relay open and changed it to a
        boolean specifying either overwrite or no-overwrite mode, and removed
        everything referencing the attribute flags.
      - added a check for NULL names in relayfs_create_entry()
      - got rid of the unnecessary multiple labels in relay_create_buf()
      - some minor simplification of relay_alloc_buf() which got rid of a
        couple params
      - updated the Documentation
      
      In addition, this version (through code contained in the relay-apps tarball
      linked to below, not as part of the relayfs patch) tries to make it as easy
      as possible to create the cooperating kernel/user pieces of a typical and
      common type of logging application, one where kernel logging is kicked off
      when a user space data collection app starts and stops when the collection
      app exits, with the data being automatically logged to disk in between.  To
      create this type of application, you basically just include a header file
      (relay-app.h, included in the relay-apps tarball) in your kernel module,
      define a couple of callbacks and call an initialization function, and on
      the user side call a single function that sets up and continuously monitors
      the buffers, and writes data to files as it becomes available.  Channels
      are created when the collection app is started and destroyed when it exits,
      not when the kernel module is inserted, so different channel buffer sizes
      can be specified for each separate run via command-line options.  See the
      README in the relay-apps tarball for details.
      
      Also included in the relay-apps tarball are a couple examples
      demonstrating how you can use this to create quick and dirty kernel
      logging/debugging applications.  They are:
      
      - tprintk, short for 'tee printk', which temporarily puts a kprobe on
        printk() and writes a duplicate stream of printk output to a relayfs
        channel.  This could be used anywhere there's printk() debugging code
        in the kernel which you'd like to exercise, but would rather not have
        your system logs cluttered with debugging junk.  You'd probably want
        to kill klogd while you do this, otherwise there wouldn't be much
        point (since putting a kprobe on printk() doesn't change the output
        of printk()).  I've used this method to temporarily divert the packet
        logging output of the iptables LOG target from the system logs to
        relayfs files instead, for instance.
      
      - klog, which just provides a printk-like formatted logging function
        on top of relayfs.  Again, you can use this to keep stuff out of your
        system logs if used in place of printk.
      
      The example applications can be found here:
      
      http://prdownloads.sourceforge.net/dprobes/relay-apps.tar.gz?download
      
      From: Christoph Hellwig <hch@lst.de>
      
        avoid lookup_hash usage in relayfs
      Signed-off-by: NTom Zanussi <zanussi@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e82894f8
    • I
      [PATCH] detect soft lockups · 8446f1d3
      Ingo Molnar 提交于
      This patch adds a new kernel debug feature: CONFIG_DETECT_SOFTLOCKUP.
      
      When enabled then per-CPU watchdog threads are started, which try to run
      once per second.  If they get delayed for more than 10 seconds then a
      callback from the timer interrupt detects this condition and prints out a
      warning message and a stack dump (once per lockup incident).  The feature
      is otherwise non-intrusive, it doesnt try to unlock the box in any way, it
      only gets the debug info out, automatically, and on all CPUs affected by
      the lockup.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Signed-Off-By: NMatthias Urlichs <smurf@smurf.noris.de>
      Signed-off-by: NRichard Purdie <rpurdie@rpsys.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8446f1d3
    • J
      [PATCH] FUTEX_WAKE_OP: pthread_cond_signal() speedup · 4732efbe
      Jakub Jelinek 提交于
      ATM pthread_cond_signal is unnecessarily slow, because it wakes one waiter
      (which at least on UP usually means an immediate context switch to one of
      the waiter threads).  This waiter wakes up and after a few instructions it
      attempts to acquire the cv internal lock, but that lock is still held by
      the thread calling pthread_cond_signal.  So it goes to sleep and eventually
      the signalling thread is scheduled in, unlocks the internal lock and wakes
      the waiter again.
      
      Now, before 2003-09-21 NPTL was using FUTEX_REQUEUE in pthread_cond_signal
      to avoid this performance issue, but it was removed when locks were
      redesigned to the 3 state scheme (unlocked, locked uncontended, locked
      contended).
      
      Following scenario shows why simply using FUTEX_REQUEUE in
      pthread_cond_signal together with using lll_mutex_unlock_force in place of
      lll_mutex_unlock is not enough and probably why it has been disabled at
      that time:
      
      The number is value in cv->__data.__lock.
              thr1            thr2            thr3
      0       pthread_cond_wait
      1       lll_mutex_lock (cv->__data.__lock)
      0       lll_mutex_unlock (cv->__data.__lock)
      0       lll_futex_wait (&cv->__data.__futex, futexval)
      0                       pthread_cond_signal
      1                       lll_mutex_lock (cv->__data.__lock)
      1                                       pthread_cond_signal
      2                                       lll_mutex_lock (cv->__data.__lock)
      2                                         lll_futex_wait (&cv->__data.__lock, 2)
      2                       lll_futex_requeue (&cv->__data.__futex, 0, 1, &cv->__data.__lock)
                                # FUTEX_REQUEUE, not FUTEX_CMP_REQUEUE
      2                       lll_mutex_unlock_force (cv->__data.__lock)
      0                         cv->__data.__lock = 0
      0                         lll_futex_wake (&cv->__data.__lock, 1)
      1       lll_mutex_lock (cv->__data.__lock)
      0       lll_mutex_unlock (cv->__data.__lock)
                # Here, lll_mutex_unlock doesn't know there are threads waiting
                # on the internal cv's lock
      
      Now, I believe it is possible to use FUTEX_REQUEUE in pthread_cond_signal,
      but it will cost us not one, but 2 extra syscalls and, what's worse, one of
      these extra syscalls will be done for every single waiting loop in
      pthread_cond_*wait.
      
      We would need to use lll_mutex_unlock_force in pthread_cond_signal after
      requeue and lll_mutex_cond_lock in pthread_cond_*wait after lll_futex_wait.
      
      Another alternative is to do the unlocking pthread_cond_signal needs to do
      (the lock can't be unlocked before lll_futex_wake, as that is racy) in the
      kernel.
      
      I have implemented both variants, futex-requeue-glibc.patch is the first
      one and futex-wake_op{,-glibc}.patch is the unlocking inside of the kernel.
       The kernel interface allows userland to specify how exactly an unlocking
      operation should look like (some atomic arithmetic operation with optional
      constant argument and comparison of the previous futex value with another
      constant).
      
      It has been implemented just for ppc*, x86_64 and i?86, for other
      architectures I'm including just a stub header which can be used as a
      starting point by maintainers to write support for their arches and ATM
      will just return -ENOSYS for FUTEX_WAKE_OP.  The requeue patch has been
      (lightly) tested just on x86_64, the wake_op patch on ppc64 kernel running
      32-bit and 64-bit NPTL and x86_64 kernel running 32-bit and 64-bit NPTL.
      
      With the following benchmark on UP x86-64 I get:
      
      for i in nptl-orig nptl-requeue nptl-wake_op; do echo time elf/ld.so --library-path .:$i /tmp/bench; \
      for j in 1 2; do echo ( time elf/ld.so --library-path .:$i /tmp/bench ) 2>&1; done; done
      time elf/ld.so --library-path .:nptl-orig /tmp/bench
      real 0m0.655s user 0m0.253s sys 0m0.403s
      real 0m0.657s user 0m0.269s sys 0m0.388s
      time elf/ld.so --library-path .:nptl-requeue /tmp/bench
      real 0m0.496s user 0m0.225s sys 0m0.271s
      real 0m0.531s user 0m0.242s sys 0m0.288s
      time elf/ld.so --library-path .:nptl-wake_op /tmp/bench
      real 0m0.380s user 0m0.176s sys 0m0.204s
      real 0m0.382s user 0m0.175s sys 0m0.207s
      
      The benchmark is at:
      http://sourceware.org/ml/libc-alpha/2005-03/txt00001.txt
      Older futex-requeue-glibc.patch version is at:
      http://sourceware.org/ml/libc-alpha/2005-03/txt00002.txt
      Older futex-wake_op-glibc.patch version is at:
      http://sourceware.org/ml/libc-alpha/2005-03/txt00003.txt
      Will post a new version (just x86-64 fixes so that the patch
      applies against pthread_cond_signal.S) to libc-hacker ml soon.
      
      Attached is the kernel FUTEX_WAKE_OP patch as well as a simple-minded
      testcase that will not test the atomicity of the operation, but at least
      check if the threads that should have been woken up are woken up and
      whether the arithmetic operation in the kernel gave the expected results.
      Acked-by: NIngo Molnar <mingo@redhat.com>
      Cc: Ulrich Drepper <drepper@redhat.com>
      Cc: Jamie Lokier <jamie@shareable.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NYoichi Yuasa <yuasa@hh.iij4u.or.jp>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4732efbe
    • A
      [PATCH] x86/x86_64: deferred handling of writes to /proc/irqxx/smp_affinity · 54d5d424
      Ashok Raj 提交于
      When handling writes to /proc/irq, current code is re-programming rte
      entries directly. This is not recommended and could potentially cause
      chipset's to lockup, or cause missing interrupts.
      
      CONFIG_IRQ_BALANCE does this correctly, where it re-programs only when the
      interrupt is pending. The same needs to be done for /proc/irq handling as well.
      Otherwise user space irq balancers are really not doing the right thing.
      
      - Changed pending_irq_balance_cpumask to pending_irq_migrate_cpumask for
        lack of a generic name.
      - added move_irq out of IRQ_BALANCE, and added this same to X86_64
      - Added new proc handler for write, so we can do deferred write at irq
        handling time.
      - Display of /proc/irq/XX/smp_affinity used to display CPU_MASKALL, instead
        it now shows only active cpu masks, or exactly what was set.
      - Provided a common move_irq implementation, instead of duplicating
        when using generic irq framework.
      
      Tested on i386/x86_64 and ia64 with CONFIG_PCI_MSI turned on and off.
      Tested UP builds as well.
      
      MSI testing: tbd: I have cards, need to look for a x-over cable, although I
      did test an earlier version of this patch.  Will test in a couple days.
      Signed-off-by: NAshok Raj <ashok.raj@intel.com>
      Acked-by: NZwane Mwaikambo <zwane@holomorphy.com>
      Grudgingly-acked-by: NAndi Kleen <ak@muc.de>
      Signed-off-by: NCoywolf Qi Hunt <coywolf@lovecn.org>
      Signed-off-by: NAshok Raj <ashok.raj@intel.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      54d5d424
  2. 06 9月, 2005 9 次提交