1. 12 Apr, 2004 40 commits
    • Andrew Morton's avatar
      [PATCH] Fix huge sparse tmpfs files · 7feebd5c
      Andrew Morton authored
      From: Hugh Dickins <hugh@veritas.com>
      
      Kevin P.  Fleming pointed out that the 2.6 tmpfs does not allow writing huge
      sparse files.  This is an unintended side-effect of the strict memory commit
      changes: which should make no difference.
      
      The solution is to treat the tmpfs files (of variable size) and the shmem
      objects (of fixed size) differently: sounds nasty but works out well.  The
      shmem objects follow the VM preallocation convention as before, but the tmpfs
      files revert to allocation on demand as a filesystem would.  If there's not
      enough memory to write to a tmpfs hole, it is reported as -ENOSPC rather than
      -ENOMEM, so the mmap writer gets SIGBUS rather than everyone else getting
      OOM-killed.
      7feebd5c
    • Andrew Morton's avatar
      [PATCH] Remove bitmap_shift_*() bitmap length limits · 77c8efae
      Andrew Morton authored
      From: William Lee Irwin III <wli@holomorphy.com>
      
      Chang bitmap_shift_left()/bitmap_shift_right() to have O(1) stackspace
      requirements.
      
      Given zeroed tail preconditions these implementations satisfy zeroed tail
      postconditions, which makes them compatible with whatever changes from Paul
      Jackson one may want to merge in the future.  No particular effort was
      required to ensure this.
      
      A small (but hopefully forgiveable) cleanup is a spelling correction:
      s/bitmap_shift_write/bitmap_shift_right/ in one of the kerneldoc comments.
      
      The primary effect of the patch is to remove the MAX_BITMAP_BITS
      limitation, so restoring the NR_CPUS to be limited only by stackspace and
      slab allocator maximums.  They also look vaguely more efficient than the
      current code, though as this was not done for performance reasons, no
      performance testing was done.
      77c8efae
    • Andrew Morton's avatar
      [PATCH] Support for floppies whose sectors are numbered from zero instead of one · 387f7c83
      Andrew Morton authored
      From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
      
      From: Alain Knaff <alain.knaff@lll.lu>
      
      This patch adds support for floppy disks whose sectors are numbered
      starting at 0 rather than 1 as usual disks would be.  This format is used
      for some CP/M disks, and also for certain music samplers (such as Ensoniq
      Ensoniq EPS 16plus).
      
      In order to use it, you need an fdutils with the current patch from
      http://fdutils.linux.lu as well, and then do setfdrpm /dev/fd0 dd zerobased
      sect=10 or setfdprm /dev/fd0 hd zerobased sect.
      
      In addtion, the patch also fixes my email addresses.  I no longer use
      pobox.com.
      387f7c83
    • Andrew Morton's avatar
      [PATCH] fix modversions now __this_module is created only in .ko · 7fdaa121
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      Brian Gerst's patch which moved __this_module out from module.h into the
      module post-processing had a side effect.  genksyms didn't see the
      undefined symbols for modules without a module_init (or module_exit), and
      hence didn't generate a version for them, causing the kernel to be tainted.
      
      The simple solution is to always include the versions for these functions. 
      Also includes two cleanups:
      
      1) alloc_symbol is easier to use if it populates ->next for us.
      
      2) add_exported_symbol should set owner to module, not head of module
         list (we don't use this field in entries in that list, fortunately).
      7fdaa121
    • Andrew Morton's avatar
      [PATCH] Move __this_module to modpost · 7ee168c0
      Andrew Morton authored
      From: Brian Gerst <bgerst@didntduck.org>
      
      Move the __this_module structure to the modpost code where it really
      belongs.
      7ee168c0
    • Andrew Morton's avatar
      [PATCH] speed up fget() and fget_light() · a05fc485
      Andrew Morton authored
      Eric Dumazet <dada1@cosmosbay.com>
      
      We can avoid evaluating `current' in a few places.
      a05fc485
    • Andrew Morton's avatar
      [PATCH] cpu5wdt.c warning fix · a18fde09
      Andrew Morton authored
      From: Heiko Ronsdorf <hero@persua.de>
      
      - Remvoe a volatile which causes a warning via module_param()
      
      - Remove an unused variable.
      a18fde09
    • Andrew Morton's avatar
      [PATCH] /dev/urandom scalability improvement · 47b54fbf
      Andrew Morton authored
      From: David Mosberger <davidm@napali.hpl.hp.com>
      
      Somebody recently pointed out a performance-anomaly to me where an unusual
      amount of time was being spent reading from /dev/urandom.  The problem
      isn't really surprising as it happened only on >= 4-way machines and the
      random driver isn't terribly scalable the way it is written today.  If
      scalability _really_ mattered, I suppose per-CPU data structures would be
      the way to go.  However, I found that at least for 4-way machines,
      performance can be improved considerably with the attached patch.  In
      particular, I saw the following performance on a 4-way ia64 machine:
      
      Test: 3 tasks running "dd if=/dev/urandom of=/dev/null bs=1024":
      
      			throughput:
      			
      47b54fbf
    • Andrew Morton's avatar
      [PATCH] export complete_all() · ce334bb8
      Andrew Morton authored
      From: Mike Waychison <Michael.Waychison@Sun.COM>
      
      Export complete_all for module use.
      ce334bb8
    • Andrew Morton's avatar
      [PATCH] i830 DRM missing put_user · 50a1d632
      Andrew Morton authored
      From: Arjan van de Ven <arjanv@redhat.com>
      
      The patch below adds a few missing put_user()'s to the i810/i830 drm
      modules.  Users reported oopses with 4g/4g split in action, and sparse
      annotations indeed found the offender in the function in question.  I've
      kept the sparse __user annotations since those are generally useful anyway.
       I can't test it myself but a few people reported that the oopses went away
      so far.
      50a1d632
    • Andrew Morton's avatar
      [PATCH] Update Documentation/Changes · 1079b187
      Andrew Morton authored
      From: Trivial Patch Monkey <trivial@rustcorp.com.au>
      
      From:  Thomas Molina <tmolina@cablespeed.com>
      1079b187
    • Andrew Morton's avatar
      [PATCH] ne2k-pci.c compile fix on ppc[64] · 73007d9b
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      These macros are redefined here.  Previously definitions are in
      asm-ppc(64)/io.h
      73007d9b
    • Andrew Morton's avatar
      [PATCH] Add CC Trivial Patch Monkey to SubmittingPatches · 64ea79c7
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From: maximilian attems <janitor@sternwelten.at>
      
      Add the Monkey to SubmittingPatches.
      64ea79c7
    • Andrew Morton's avatar
      [PATCH] Use valid node number when unmapping x86 CPUs · 7275fb97
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From:  colpatch@us.ibm.com
      
      The cpu_2_node[] array for i386 is initialized to all 0's, meaning that
      until modified at CPU bring-up, all CPUs are mapped to node 0.
      
      When CPUs are brought online, they are mapped to the appropriate node by
      various mechanisms, depending on the underlying hardware.
      
      When we unmap CPUs (hotplug time), we should return the mapping for the CPU
      that is going away to its original state, ie: 0.
      
      When this code was initially submitted, the misguided poster (me) made the
      mistake of putting a -1 in the cpu_2_node[] array for the CPU going away.
      
      This patch fixes this mistake, and allows code to get a valid node number
      for all valid CPU numbers.  This is important, because most (if not all)
      callers do not error check the value returned by the cpu_to_node() macro,
      and they should not have to.  The API specifies that a valid node number be
      returned for any valid CPU number.
      7275fb97
    • Andrew Morton's avatar
      [PATCH] Kill duplicate #include <linux_ioport.h> · 3a2d85ea
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      include/linux/device.h includes include/linux/ioport.h twice.
      3a2d85ea
    • Andrew Morton's avatar
      [PATCH] updating email info in CREDITS · 17ec30a3
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From:  Thomas Molina <tmolina@cablespeed.com>
      17ec30a3
    • Andrew Morton's avatar
      [PATCH] CONFIG_X86_GENERIC description fixup · e1319f38
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From:  Stewart Smith <stewart@linux.org.au>
      
      A better explanation of the X86_GENERIC config option follows.
      e1319f38
    • Andrew Morton's avatar
      [PATCH] Fix genksyms parsing · f17ea056
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From: Andreas Schwab <schwab@suse.de> I'm getting a warning when building
      for ia64 with MODVERSIONS enabled.  This is a bug in genksyms, it can't
      cope with some arguments of __typeof__.
      
      The following patch will fix that.  Actually the argument of __typeof__ is
      an abstract declarator, but the genksyms parser has no production for that;
      decl_specifier_seq also matches some invalid constructs, but I don't think
      this is a problem in practice, since the compiler will reject them.
      f17ea056
    • Andrew Morton's avatar
      [PATCH] Trivial Patch Monkey should be in MAINTAINERS · fa79e47b
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From:  Petri Koistinen <petri.koistinen@iki.fi>
      fa79e47b
    • Andrew Morton's avatar
      [PATCH] Fix firmware loader docs · f333f50d
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From:  Pavel Machek <pavel@ucw.cz>
      
      sysfs should be mounted on /sys these days.
      f333f50d
    • Andrew Morton's avatar
      [PATCH] i386 irq.c ifdef cleanup · bc344a64
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From:  Josef 'Jeff' Sipek <jeffpc@optonline.net>
      
      I just noticed the nested ifdefs, and made it little more readable.
      bc344a64
    • Andrew Morton's avatar
      [PATCH] fix sch_ingress help · 387ec9eb
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From:  John Levon <levon@movementarian.org>
      387ec9eb
    • Andrew Morton's avatar
      [PATCH] SGML: close tag with ">" · bd9646e6
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From:  Hans Ulrich Niedermann <linux-kernel@n-dimensional.de>
      
      doc patch: close tag with ">"
      bd9646e6
    • Andrew Morton's avatar
      [PATCH] Consistently use quotes for SGML attributes · c02dc9a8
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From:  Hans Ulrich Niedermann <linux-kernel@n-dimensional.de>
      
      doc patch: Consistently use quotes for SGML attributes This makes it
      possible to process the SGML files without SHORTTAG YES.
      c02dc9a8
    • Andrew Morton's avatar
      [PATCH] document unused pte bits on i386 · 2b5f9408
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From:  Ed L Cashin <ecashin@uga.edu>
      
      This small patch documents that bits 9, 10, and 11 are unused by the Linux
      kernel.  The IA-32 Intel Architecture Software Developer's Manual says that
      these bits are available for programmer use.
      2b5f9408
    • Andrew Morton's avatar
      [PATCH] Update CodingStyle hints for Emacs users. · b4ecf1b0
      Andrew Morton authored
      From: Trivial Patch Monkey <trivial@rustcorp.com.au>
      
      From:  Ben Greear <greearb@candelatech.com>
      
      Depending on one's default emacs settings, the suggestion in the
      CodingStyle may or may not work.  This patch adds a few more commands to
      ensure it works in more cases.
      b4ecf1b0
    • Andrew Morton's avatar
      [PATCH] ver_linux fix · 3bca5aa3
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From:  Adrian Bunk <bunk@fs.tum.de>
      
      Some versions of ps print non-version lines when ps --version is invoked.
      grep them out.
      3bca5aa3
    • Andrew Morton's avatar
      [PATCH] Broken bitmap_parse for ncpus > 32 · f9511792
      Andrew Morton authored
      From: Joe Korty <joe.korty@ccur.com>
      
      This patch replaces the call to bitmap_shift_right() in bitmap_parse() with
      bitmap_shift_left().
      
      I also prepended comments to the bitmap_shift_* functions defining what
      'left' and 'right' means.  This is under the theory that if I and all the
      reviewers were bamboozled, others in the future occasionally might be too.
      f9511792
    • Andrew Morton's avatar
      [PATCH] Fix sys_time() to get subtick correction from the new xtime · 5362a354
      Andrew Morton authored
      From: "La Monte H.P. Yarroll" <piggy@timesys.com>
      
      This is a Scott Wood patch against 2.6.3.
      
      
      Use gettimeofday() rather than xtime.tv_sec in sys_time(), since
      sys_stime() uses settimeofday() and thus subtracts the subtick correction
      from the new xtime.
      
      stime() used settimeofday(), but time() did not use gettimeofday().  Since
      settimeofday() subtracts out the current intra-tick correction, and nsec
      was 0 (since stime() only allows seconds), this resulted in xtime being
      slightly earlier than the time that was set.
      
      If time() had used gettimeofday(), the correction would have been applied,
      and everything would be fine.  However, instead time just reads the current
      xtime.tv_sec, so if time() is called immediately after stime(), you'll
      usually get a value one second earlier.
      5362a354
    • Andrew Morton's avatar
      [PATCH] add file_operations.fcntl · cea39746
      Andrew Morton authored
      From: Chuck Lever <cel@citi.umich.edu>
      
      O_DIRECT|O_APPEND cannot possibly work on NFS, so NFS needs some way of
      preventing the user from setting this combination.  We felt that the best
      way of implementing this restriction is to allow the filesytem to implement
      its own fcntl() handler.
      
      This patch does, that, and provide the appropriate handler for NFS.
      
      Additional details from Chuck:
      
      Forgetting O_DIRECT for a moment, O_APPEND writes on NFS don't work in any
      case when multiple clients are writing to a file, since an NFS client can
      never guarantee it knows where the true end of file is 100% of the time.
      it works as expected iff only one client writes to an O_APPEND file at a
      time.
      
      Multi-client O_APPEND writing doesn't seem to be a problem for any
      application I'm aware of.  Since it can be made to behave in the
      multi-client case with careful application logic or by using file locking,
      I don't think we should disallow it.
      
      I want to drop the inode semaphore when doing NFS direct I/O because it is
      synchronous; holding the i_sem means we reduce direct I/O concurrency to
      one I/O per file at a time.  the important thing sct was worried about was
      the case where a single client is writing with O_APPEND and O_DIRECT, and
      we don't hold the i_sem during the write.
      
      We must at least hold the i_sem when determining where the end of file is
      to do the O_APPEND write.  In 2.6, I believe that is handled correctly in
      the VFS layer, so this is not an issue for 2.6, right?
      cea39746
    • Andrew Morton's avatar
      [PATCH] pmdisk: fix strcmp in sysfs store · 3f66b056
      Andrew Morton authored
      From: Herbert Xu <herbert@gondor.apana.org.au>
      
      This patch fixes the sysfs store functions for pmdisk when the input
      contains a trailing newline.
      3f66b056
    • Andrew Morton's avatar
      [PATCH] sb_mixer bounds checking · 77abb2f0
      Andrew Morton authored
      From: Muli Ben-Yehuda <mulix@mulix.org>
      
      This patch add proper bounds checking to the sb_mixer.c code, found by the
      stanford checker[0].  It fixes bugzilla bugs 252[1], 253[2] and 254[3]. 
      Patch is against 2.6.5-rc2.  It was tested by Rene Herman on SN AWE64 gold
      and sound still works.  The issue was previously discussed on lkml[4], but
      apparently no fix was applied.
      
      The patch is a bit more intrusive than I would've liked, but I don't think
      it can be helped without really intrusive changes.  sb_devc has a pointer
      to an array (iomap) that is set at run time to point to arrays of variable
      sizes.  The patch adds an 'iomap_sz' member to sb_devc that is set to the
      length of the array, and does bounds checking in sb_common_mixer_set() and
      smw_mixer_set() agains that.
      77abb2f0
    • Andrew Morton's avatar
      [PATCH] fs/proc/proc_tty.c comment fixes · 59b46ce5
      Andrew Morton authored
      From: Marc-Christian Petersen <m.c.p@wolk-project.de>
      59b46ce5
    • Andrew Morton's avatar
      [PATCH] set mod->waiter before calling stop_machine · 07ebe427
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      mod->waiter needs to be set before we try to stop the module: setting it in
      __try_stop_module means it gets set to the kthread, not rmmod.
      07ebe427
    • Andrew Morton's avatar
      [PATCH] slab: updates for per-arch alignments · b9e55f3d
      Andrew Morton authored
      From: Manfred Spraul <manfred@colorfullife.com>
      
      Description:
      
      Right now kmem_cache_create automatically decides about the alignment of
      allocated objects. The automatic decisions are sometimes wrong:
      
      - for some objects, it's better to keep them as small as possible to
        reduce the memory usage.  Ingo already added a parameter to
        kmem_cache_create for the sigqueue cache, but it wasn't implemented.
      
      - for s390, normal kmalloc must be 8-byte aligned.  With debugging
        enabled, the default allocation was 4-bytes.  This means that s390 cannot
        enable slab debugging.
      
      - arm26 needs 1 kB aligned objects.  Previously this was impossible to
        generate, therefore arm has its own allocator in
        arm26/machine/small_page.c
      
      - most objects should be cache line aligned, to avoid false sharing.  But
        the cache line size was set at compile time, often to 128 bytes for
        generic kernels.  This wastes memory.  The new code uses the runtime
        determined cache line size instead.
      
      - some caches want an explicit alignment.  One example are the pte_chain
        objects: they must find the start of the object with addr&mask.  Right
        now pte_chain objects are scaled to the cache line size, because that was
        the only alignment that could be generated reliably.
      
      The implementation reuses the "offset" parameter of kmem_cache_create and
      now uses it to pass in the requested alignment.  offset was ignored by the
      current implementation, and the only user I found is sigqueue, which
      intended to set the alignment.
      
      In the long run, it might be interesting for the main tree: due to the 128
      byte alignment, only 7 inodes fit into one page, with 64-byte alignment, 9
      inodes - 20% memory recovered for Athlon systems.
      
      
      
      For generic kernels  running on P6 cpus (i.e. 32 byte cachelines), it means
      
      Number of objects per page:
      
       ext2_inode_cache: 8 instead of 7
       ext3_inode_cache: 8 instead of 7
       fat_inode_cache: 9 instead of 7
       rpc_tasks: 24 instead of 15
       tcp_tw_bucket: 40 instead of 30
       arp_cache: 40 instead of 30
       nfs_write_data: 9 instead of 7
      b9e55f3d
    • Andrew Morton's avatar
      [PATCH] Fix scripts/kernel-doc to handle __attribute__ · 1aa6c0d1
      Andrew Morton authored
      From: Tom Rini <trini@kernel.crashing.org>
      
      The following patch is needed so that kernel-doc can handle functions which
      have __attribute__'s on them (such as __attribute__ ((weak))).
      1aa6c0d1
    • Andrew Morton's avatar
      [PATCH] readv/writev range checking fix · fb14ef35
      Andrew Morton authored
      do-readv_writev() is trying to fail if
      
      a) any of the segments have a length < 0 or
      
      b) the sum of the segments wraps negative.
      
      But it gets b) wrong because local variable tot_len is unsigned.
      
      Fix that up.
      fb14ef35
    • Andrew Morton's avatar
      [PATCH] jbd: fix I/O error handling · b1ee3fea
      Andrew Morton authored
      Fix a few buglets spotted by Jeff Mahoney <jeffm@suse.com>.  We're currently
      only checking for I/O errors against journal buffers if they were locked when
      they were first inspected.
      
      We need to check buffer_uptodate() even if the buffers were already unlocked.
      b1ee3fea
    • Andrew Morton's avatar
      [PATCH] JBD: ordered-data commit cleanup · 2b38960c
      Andrew Morton authored
      For data=ordered, kjournald at commit time has to write out and wait upon a
      long list of buffers.  It does this in a rather awkward way with a single
      list.  it causes complexity and long lock hold times, and makes the addition
      of rescheduling points quite hard
      
      So what we do instead (based on Chris Mason's suggestion) is to add a new
      buffer list (t_locked_list) to the journal.  It contains buffers which have
      been placed under I/O.
      
      So as we walk the t_sync_datalist list we move buffers over to t_locked_list
      as they are written out.
      
      When t_sync_datalist is empty we may then walk t_locked_list waiting for the
      I/O to complete.
      
      As a side-effect this means that we can remove the nasty synchronous wait in
      journal_dirty_data which is there to avoid the kjournald livelock which would
      otherwise occur when someone is continuously dirtying a buffer.
      2b38960c
    • Andrew Morton's avatar
      [PATCH] jbd: fix ordered-data writeout logic · 376fd482
      Andrew Morton authored
      There's some nasty code in commit which deals with a lock ranking problem. 
      Currently if it fails to get the lock when and local variable `bufs' is zero
      we forget to write out some ordered-data buffers.  So a subsequent
      crash+recovery could yield stale data in existing files.
      
      Fix it by correctly restarting the t_sync_datalist search.
      376fd482