1. 19 Oct, 2004 40 commits
    • Antonino Daplas's avatar
      [PATCH] fbdev: Add Tile Blitting support · c76d035d
      Antonino Daplas authored
      Hopefully, this patch fixes one last major regression for one particular
      driver, namely matroxfb.  This drier has 2 versions, one for the kernel and
      another as a '2.4 backport' patch.
      
      This patch adds a tileblitting extension to fbcon.  This extension, in
      summary, is basically a forward-port of the 2.4 fbdev/fbcon framework to 2.6
      but without the fbcon dependency.  Tile blitting is similar to bitblit, except
      that the basic unit is a tile (a bitmap of x-by-y dimensions).  The display,
      instead of being described in terms of pixels and scanlines, are described as
      a region further subdivided into rectangular sections.  In fbcon parlance, a
      tile is a character.
      
      Besides a possible fix for matroxfb, tileblitting can be advantageous for
      hardware that supports some kind of fontcaching mechanism.  Also, in the
      unlikely chance that the console begins supporting multicolored fonts,
      tileblitting is probably more optimal than bitblitting because bitblitting
      will need to push more data through the bus.
      
      To enable support for this extension, a driver needs to:
      
      - enable CONFIG_FB_TILEBLITTING
      - set FBINFO_MISC_TILEBLITTING in info->flags
      - set the required function pointers in struct fb_tileops.  The required
        operations are:
      
        - void (*fb_settile)(struct fb_info *info, struct fb_tilemap *map);
      
          tells driver about the tile characteristics (dimensions, bitdepth) and
          about the tilemap which is an array of bitmaps: display->fontdata
      
        - void (*fb_tilecopy)(struct fb_info *info, struct fb_tilearea *area);
      
          move a rectangular section of tiles (bmove)
      
        - void (*fb_tilefill)(struct fb_info *info, struct fb_tilerect *rect);
      
          fill a rectangular section with a tile (clear)
      
        - void (*fb_tileblit)(struct fb_info *info, struct fb_tileblit *blit);
      
          copy an array of tiles to a rectangular section (putcs)
      
        - void (*fb_tilecursor)(struct fb_info *info, struct fb_tilecursor *cursor);
      
          cursor function
      
      Changes:
      
      Addition of this extension necessitates cleanup of fbcon.c.  The basic drawing
      functions in fbcon are bmove, clear, putcs and cursor (the fbcon_* set).  The
      fbcon_* set are just wrappers to accel_* set.  However, usage is not
      consistent, some functions call the fbcon_* set, others call the accel_* set.
      
      With this patch, a new fbcon-specific structure (struct fbcon_ops) is created.
       Depending on the setting of the hardware, this struct contains pointers to
      either the tileblitting set or the bitblitting set (formerly the accel_* set).
       The tileblitting set is new in this patch.
      
      The vast majority of functions in fbcon will need to only call the fbcon_*
      set.  In turn, it calls functions in struct fbcon_ops.  Knowledge of the
      blitting type is not required.
      
      The accel_* set is renamed to bit_* and is moved into a separate file,
      bitblit.c.  The tile blitting set is in tileblit.c.
      
      In my case at least, the cleanup did produce an unexpected but beneficial
      side effect, a little more speedup.  Not much, < 5%.
      
      Petr, if you have comments, suggestions, or you think this is a bad idea,
      let me know.
      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>
      c76d035d
    • Antonino Daplas's avatar
      [PATCH] fbdev: Pass struct device to class_simple_device_add · 03f779b6
      Antonino Daplas authored
      Swsusp turns off the display when a power-management-enabled framebuffer
      driver is used.  According to Nigel Cunningham <ncunningham@linuxmail.org>,
      the fix may involve the following:
      
      "...I thought the best approach would be to use device classes to find the
      struct dev for the frame buffer driver, and then use the same code I use for
      storage devices to avoid suspending the frame buffer until later..."
      
      Changes:
      
      - pass info->device to class_simple_device_add()
      - add struct device *device to struct fb_info
      - store struct device in framebuffer_alloc()
      - for drivers not using framebuffer_alloc(), store the struct during
        initalization
      - port i810fb and rivafb to use framebuffer_alloc()
      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>
      03f779b6
    • Antonino Daplas's avatar
      [PATCH] fbcon: Fix setup boot options of fbcon · 899a94d1
      Antonino Daplas authored
      This patch fixes the 'fbcon=map:<option>" of fbcon.  (This option has been
      present since 2.4, but got broken in 2.6). This particular option tells
      fbcon what framebuffer device gets mapped to what console. Syntax is:
      
      	fbcon=map:abcd...
      
      	where a, b, c, d,... are framebuffer numbers as it would
      	appear in /proc/fb.
      
      Given only 2 valid fbdevs, 0 and 1, if fbcon=map:0110, then:
      
      tty1 = fb0
      tty2 = fb1
      tty3 = fb1
      tty4 = fb0
      (sequence repeats for the rest of the consoles)
      
      If an invalid framebuffer is used, then the console will be mapped to the
      first user-chosen framebuffer.  Ie: fbcon=map:102
      
      tty1 = fb1
      tty2 = fb0
      tty3 = fb1 <
      899a94d1
    • Antonino Daplas's avatar
      [PATCH] fbdev: fix logo drawing failure for vga16fb · 54f5dd97
      Antonino Daplas authored
      This fixes the logo failing to draw in vga16fb due to faulty boolean logic.
      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>
      54f5dd97
    • Antonino Daplas's avatar
      [PATCH] fbdev: remove unnecessary banshee_wait_idle from tdfxfb · 03808b3f
      Antonino Daplas authored
      - This patch removes the unnecessary call to banshee_wait_idle() from
        tdfxfb_copyarea, imageblit and fillrect.  Removal of the sync will garner
        an additional ~20% in scrolling speed.
      
      - Removes "inverse" which generates a compile warning if modular.
      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>
      03808b3f
    • Marcelo Tosatti's avatar
      [PATCH] Adjust alignment of pagevec structure · afead7df
      Marcelo Tosatti authored
      We can shrink the pagevec structure to cacheline align it.  It is used all
      over VM reclaiming and mpage pagecache read code.
      
      Right now it is 140 bytes on 64-bit and 72 bytes on 32-bit.  Thats just a
      little bit more than a power of 2 (which will cacheline align), so shrink
      it to be aligned: 64 bytes on 32bit and 124bytes on 64-bit. 
      
      It now occupies two cachelines most of the time instead of three. 
      
      I changed nr and cold to "unsigned short" because they'll never reach 2 ^ 16.
      
      Did some reaim benchmarking on 4way PIII (32byte cacheline), with 512MB RAM:
      
      #### stock 2.6.9-rc1-mm4 ####
      
      Peak load Test: Maximum Jobs per Minute 4144.44 (average of 3 runs)
      Quick Convergence Test: Maximum Jobs per Minute 4007.86 (average of 3 runs)
      
      Peak load Test: Maximum Jobs per Minute 4207.48 (average of 3 runs)
      Quick Convergence Test: Maximum Jobs per Minute 3999.28 (average of 3 runs)
      
      #### shrink-pagevec #####
      
      Peak load Test: Maximum Jobs per Minute 4717.88 (average of 3 runs)
      Quick Convergence Test: Maximum Jobs per Minute 4360.59 (average of 3 runs)
      
      Peak load Test: Maximum Jobs per Minute 4493.18 (average of 3 runs)
      Quick Convergence Test: Maximum Jobs per Minute 4327.77 (average of 3 runs)
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      afead7df
    • Christoph Hellwig's avatar
      [PATCH] generic acl support for ->permission · 42017c2e
      Christoph Hellwig authored
      Currently we every filesystem with Posix ACLs has it's own reimplemtation
      of the generic permission checking code with additonal ACL support.  This
      patch
      
      - adds an optional callback to vfs_permission that filesystems can use
        for ACL support (and renames it to generic_permission because the old
        name was wrong - it wasn't like the other vfs_* functions at all)
      
      - uses it in ext2, ext3 and jfs.  XFS will follow a little later as it's
        permission checking is burried under several layers of abstraction.
      
      From: Dave Kleikamp <shaggy@austin.ibm.com>
      
        jfs doesn't currently set MS_POSIXACL (it doesn't require the acl mount
        option), so this test would fail here.  The patch below will set it.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      42017c2e
    • Christoph Hellwig's avatar
      [PATCH] remove set_fs_root/set_fs_pwd · 98291a77
      Christoph Hellwig authored
      Not exactly something we want modules to mess around with.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      98291a77
    • Christoph Hellwig's avatar
      [PATCH] remove wake_up_all_sync · 7a814bf8
      Christoph Hellwig authored
      no user in sight
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      7a814bf8
    • Christoph Hellwig's avatar
      [PATCH] unexport lookup_create · e0f9efde
      Christoph Hellwig authored
      Besides namei.c it's only used in the SN2 hwgraph code which can't be
      modular (and will be removed soon)
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e0f9efde
    • Christoph Hellwig's avatar
      [PATCH] unexport f_delown · d3259ff1
      Christoph Hellwig authored
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d3259ff1
    • Christoph Hellwig's avatar
      [PATCH] unexport files_lock and put_filp · 11dd96e0
      Christoph Hellwig authored
      Rather lowlevel functions that modules shouldn't mess with and fortunately
      currently don't.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      11dd96e0
    • Christoph Hellwig's avatar
      [PATCH] unexport exit_mm · a58eab60
      Christoph Hellwig authored
      Not exactly a thing we want done from modules, and no module uses it
      anyway.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a58eab60
    • Christoph Hellwig's avatar
      [PATCH] unexport do_execve/do_select · 0f20e117
      Christoph Hellwig authored
      These are basically shared code for native/32bit compat code, but as
      CONFIG_COMPAT is a bool there's no need to export them.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      0f20e117
    • Christoph Hellwig's avatar
      [PATCH] unexport devfs_mk_symlink · 239ff74b
      Christoph Hellwig authored
      Only legit user is the partitioning code, in addition some uml code is
      still using despite the uml people beeing told to fix it at least two
      times.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      239ff74b
    • Christoph Hellwig's avatar
      [PATCH] unexport is_subdir and shrink_dcache_anon · b2963232
      Christoph Hellwig authored
      Two dcache.c functions that shouldn't be used by filesystems directly
      (probably a leftover of the intermezzo mess).
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b2963232
    • Christoph Hellwig's avatar
      [PATCH] unexport proc_sys_root · 546f3d24
      Christoph Hellwig authored
      Only used by kernel/sysctl.c which absolutely can't be modular
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      546f3d24
    • Christoph Hellwig's avatar
      c78c27a2
    • Christoph Hellwig's avatar
      [PATCH] remove pm_find, unexport pm_send · 71ccd42c
      Christoph Hellwig authored
      cutting back some unused legacy PM code
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      71ccd42c
    • Christoph Hellwig's avatar
      [PATCH] don't export shmem_file_setup · 733902e4
      Christoph Hellwig authored
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      733902e4
    • Christoph Hellwig's avatar
      [PATCH] remove posix_acl_masq_nfs_mode · abbb0399
      Christoph Hellwig authored
      Completely unused but exported function in fs/posix_acl.c
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      abbb0399
    • Christoph Hellwig's avatar
      [PATCH] remove dead code from fs/mbcache.c · 8704c669
      Christoph Hellwig authored
      mb_cache_entry_takeout and mb_cache_entry_dup are totally unused.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      8704c669
    • Christoph Hellwig's avatar
      [PATCH] don't export blkdev_open and def_blk_ops · 1cd05ead
      Christoph Hellwig authored
      Already since 2.4 all block devices use block_device_operations and
      shouldn't deal with file operations directly.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      1cd05ead
    • Jens Axboe's avatar
      [PATCH] convert jiffies <-> msecs for io schedulers · d55249d3
      Jens Axboe authored
      The various io schedulers don't convert to and from jiffies and ms in their
      sysfs exported values.  This patch adds that.
      Signed-off-by: default avatarJens Axboe <axboe@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d55249d3
    • Jens Axboe's avatar
      [PATCH] cfq-v2 I/O scheduler update · f9887e4a
      Jens Axboe authored
      Here is the next incarnation of the CFQ io scheduler, so far known as
      CFQ v2 locally. It attempts to address some of the limitations of the
      original CFQ io scheduler (hence forth known as CFQ v1). Some of the
      problems with CFQ v1 are:
      
      - It does accounting for the lifetime of the cfq_queue, which is setup
        and torn down for the time when a process has io in flight. For a fork
        heavy work load (such as a kernel compile, for instance), new
        processes can effectively starve io of running processes. This is in
        part due to the fact that CFQ v1 gives preference to a new processes
        to get better latency numbers. Removing that heuristic is not an
        option exactly because of that.
      
      - It makes no attempts to address inter-cfq_queue fairness.
      
      - It makes no attempt to limit upper latency bound of a single request.
      
      - It only provides per-tgid grouping. You need to change the source to
        group on a different criteria.
      
      - It uses a mempool for the cfq_queues. Theoretically this could
        deadlock if io bound processes never exit.
      
      - The may_queue() logic can be unfair since it fluctuates quickly, thus
        leaving processes sleeping while new processes are allowed to allocate
        a request.
      
      CFQ v2 attempts to fix these issues. It uses the process io_context
      logic to maintain a cfq_queue lifetime of the duration of the process
      (and its io). This means we can now be a lot more clever in deciding
      which process is allowed to queue or dispatch io to the device. The
      cfq_io_context is per-process per-queue, this is an extension to what AS
      currently does in that we truly do have a unique per-process identifier
      for io grouping. Busy queues are sorted by service time used, sub sorted
      by in_flight requests. Queues that have no io in flight are also
      preferred at dispatch time.
      
      Accounting is done on completion time of a request, or with a fixed cost
      for tagged command queueing. Requests are fifo'ed like with deadline, to
      make sure that a single request doesn't stay in the io scheduler for
      ages.
      
      Process grouping is selectable at runtime. I provide 4 grouping
      criterias: process group, thread group id, user id, and group id.
      
      As usual, settings are sysfs tweakable in /sys/block/<dev>/queue/iosched
      
      axboe@apu:[.]s/block/hda/queue/iosched $ ls
      back_seek_max      fifo_batch_expire  find_best_crq  queued
      back_seek_penalty  fifo_expire_async  key_type       show_status
      clear_elapsed      fifo_expire_sync   quantum        tagged
      
      In order, each of these settings control:
      
      back_seek_max
      back_seek_penalty:
      	Useful logic stolen from AS that allow small backwards seeks in
      	the io stream if we deem them useful. CFQ uses a strict
      	ascending elevator otherwise. _max controls the maximum allowed
      	backwards seek, defaulting to 16MiB. _penalty denotes how
      	expensive we account a backwards seek compared to a forward
      	seek. Default is 2, meaning it's twice as expensive.
      
      clear_elapsed:
      	Really a debug switch, will go away in the future. It clears the
      	maximum values for completion and dispatch time, shown in
      	show_status.
      
      fifo_batch_expire
      fifo_batch_async
      fifo_batch_sync:
      	The settings for the expiry fifo. batch_expire is how often we
      	allow the fifo expire to control which request to select.
      	Default is 125ms. _async is the deadline for async requests
      	(typically writes), _sync is the deadline for sync requests
      	(reads and sync writes). Defaults are, respectively, 5 seconds
      	and 0.5 seconds.
      
      key_type:
      	The grouping key. Can be set to pgid, tgid, uid, or gid. The
      	current value is shown bracketed:
      
      	axboe@apu:[.]s/block/hda/queue/iosched $ cat key_type
      	[pgid] tgid uid gid
      
      	Default is tgid. To set, simply echo any of the 4 words into the
      	file.
      
      quantum:
      	The amount of requests we select for dispatch when the driver
      	asks for work to do and the current pending list is empty.
      	Default is 4.
      
      queued:
      	The minimum amount of requests a group is allowed to queue.
      	Default is 8.
      
      show_status:
      	Debug output showing the current state of the queues.
      
      tagged:
      	Set this to 1 if the device is using tagged command queueing.
      	This cannot be reliably detected by CFQ yet, since most drivers
      	don't use the block layer (well it could, by looking at number
      	of requests being between dispatch and completion. but not
      	completely reliably). Default is 0.
      
      The patch is a little big, but works reliably here on my laptop. There
      are a number of other changes and fixes in there (like converting to
      hlist for hashes). The code is commented a lot better, CFQ v1 has
      basically no comments (reflecting that it was writting in one go, no
      touched or tuned much since then). This is of course only done to
      increase the AAF, akpm acceptance factor. Since I'm on the road, I
      cannot provide any really good numbers of CFQ v1 compared to v2, maybe
      someone will help me out there.
      Signed-off-by: default avatarJens Axboe <axboe@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      f9887e4a
    • Jens Axboe's avatar
      [PATCH] switchable and modular io schedulers · df02202c
      Jens Axboe authored
      This patch modularizes the io schedulers completely, allowing them to be
      modular.  Additionally it enables online switching of io schedulers.  See
      also http://lwn.net/Articles/102593/ .
      
      
      There's a scheduler file in the sysfs directory for the block device
      queue:
      
      axboe@router:/sys/block/hda/queue> ls
      iosched            max_sectors_kb  read_ahead_kb
      max_hw_sectors_kb  nr_requests     scheduler
      
      If you list the contents of the file, it will show available schedulers
      and the active one:
      
      axboe@router:/sys/block/hda/queue> cat scheduler
      [cfq]
      
      Lets load a few more.
      
      router:/sys/block/hda/queue # modprobe deadline-iosched
      router:/sys/block/hda/queue # modprobe as-iosched
      router:/sys/block/hda/queue # cat scheduler
      [cfq] deadline anticipatory
      
      Changing is done with
      
      router:/sys/block/hda/queue # echo deadline > scheduler
      router:/sys/block/hda/queue # cat scheduler
      cfq [deadline] anticipatory
      
      deadline is now the new active io scheduler for hda.
      Signed-off-by: default avatarJens Axboe <axboe@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      df02202c
    • Andrew Morton's avatar
      [PATCH] unreachable code in ext3_direct_IO() · 3d3d8747
      Andrew Morton authored
      davej points out that in this code local variable `ret' is already known to be
      positive non-zero, so this test is meaningless.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      3d3d8747
    • Andrew Morton's avatar
      [PATCH] jbd wakeup fix · 91cd0c2b
      Andrew Morton authored
      Processes can sleep in do_get_write_access(), waiting for buffers to be
      removed from the BJ_Shadow state.  We did this by doing a wake_up_buffer() in
      the commit path and sleeping on the buffer in do_get_write_access().
      
      With the filtered bit-level wakeup code this doesn't work properly any more -
      the wake_up_buffer() accidentally wakes up tasks which are sleeping in
      lock_buffer() as well.  Those tasks now implicitly assume that the buffer came
      unlocked.  Net effect: Bogus I/O errors when reading journal blocks, because
      the buffer isn't up to date yet.  Hence the recently spate of journal_bmap()
      failure reports.
      
      The patch creates a new jbd-private BH flag purely for this wakeup function.
      So a wake_up_bit(..., BH_Unshadow) doesn't wake up someone who is waiting for
      a wake_up_bit(BH_Lock).
      
      JBD was the only user of wake_up_buffer(), so remove it altogether.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      91cd0c2b
    • William Lee Irwin III's avatar
      [PATCH] document wake_up_bit()'s requirement for preceding memory barriers · a8589849
      William Lee Irwin III authored
      Document the requirement to use a memory barrier prior to wake_up_bit().
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a8589849
    • William Lee Irwin III's avatar
      [PATCH] reduce number of parameters to __wait_on_bit() and __wait_on_bit_lock() · 9659cc89
      William Lee Irwin III authored
      Some of the parameters to __wait_on_bit() and __wait_on_bit_lock() are
      redundant, as the wait_bit_queue parameter holds the flags word and the bit
      number.  This patch updates __wait_on_bit() and __wait_on_bit_lock() to
      fetch that information from the wait_bit_queue passed to them and so reduce
      the number of parameters so that -mregparm may be more effective.
      
      Incremental atop the complete out-of-lining of the contention cases and the
      fastcall and wait_on_bit_lock()/test_and_set_bit() fixes.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      9659cc89
    • William Lee Irwin III's avatar
      [PATCH] move wait ops' contention case completely out of line · bc341c61
      William Lee Irwin III authored
      Move the slow paths of wait_on_bit() and wait_on_bit_lock() out of line.
      Also uninline wake_up_bit() to reduce the number of callsites generated,
      and adjust loop startup in __wait_on_bit_lock() to properly reflect its
      usage in the contention case.
      
      Incremental atop the fastcall and wait_on_bit_lock()/test_and_set_bit()
      fixes.  Successfully tested on x86-64.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      bc341c61
    • William Lee Irwin III's avatar
      [PATCH] eliminate inode waitqueue hashtable · 493267b6
      William Lee Irwin III authored
      Eliminate the inode waitqueue hashtable using bit_waitqueue() via
      wait_on_bit() and wake_up_bit() to locate the waitqueue head associated
      with a bit.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      493267b6
    • William Lee Irwin III's avatar
      [PATCH] eliminate bh waitqueue hashtable · 525b64cd
      William Lee Irwin III authored
      Eliminate the bh waitqueue hashtable using bit_waitqueue() via
      wait_on_bit() and wake_up_bit() to locate the waitqueue head associated
      with a bit.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      525b64cd
    • William Lee Irwin III's avatar
      [PATCH] consolidate bit waiting code patterns · baa896b3
      William Lee Irwin III authored
      Consolidate bit waiting code patterns for page waitqueues using
      __wait_on_bit() and __wait_on_bit_lock().
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      baa896b3
    • William Lee Irwin III's avatar
      [PATCH] standardize bit waiting data type · fd4d36bf
      William Lee Irwin III authored
      Eliminate specialized page and bh waitqueue hashing structures in favor of
      a standardized structure, using wake_up_bit() to wake waiters using the
      standardized wait_bit_key structure.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      fd4d36bf
    • William Lee Irwin III's avatar
      [PATCH] move waitqueue functions to kernel/wait.c · d7988992
      William Lee Irwin III authored
      The following patch series consolidates the various instances of waitqueue
      hashing to use a uniform structure and share the per-zone hashtable among all
      waitqueue hashers.  This is expected to increase the number of hashtable
      buckets available for waiting on bh's and inodes and eliminate statically
      allocated kernel data structures for greater node locality and reduced kernel
      image size.  Some attempt was made to look similar to Oleg Nesterov's
      suggested API in order to provide some kind of credit for independent
      invention of something very similar (the original versions of these patches
      predated my public postings on the subject of filtered waitqueues).
      
      These patches have the further benefit and intention of enabling aio to use
      filtered wakeups by standardizing the data structure passed to wake functions
      so that embedded waitqueue elements in aio structures may be succesfully
      passed to the filtered wakeup wake functions, though this patch series doesn't
      implement that particular functionality.
      
      Successfully stress-tested on x86-64, and ia64 in recent prior versions.
      
      
      This patch:
      
      Move waitqueue -related functions not needing static functions in sched.c
      to kernel/wait.c
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d7988992
    • Olaf Dabrunz's avatar
      [PATCH] TIOCCONS security · d05dd6d0
      Olaf Dabrunz authored
      The ioctl TIOCCONS allows any user to redirect console output to another
      tty.  This allows anyone to suppress messages to the console at will.
      
      AFAIK nowadays not many programs write to /dev/console, except for start
      scripts and the kernel (printk() above console log level).
      
      Still, I believe that administrators and operators would not like any user
      to be able to hijack messages that were written to the console.
      
      The only user of TIOCCONS that I am aware of is bootlogd/blogd, which runs
      as root.  Please comment if there are other users.
      
      Is there any reason why normal users should be able to use TIOCCONS?
      
      Otherwise I would suggest to restrict access to root (CAP_SYS_ADMIN), e.g. 
      with this patch.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d05dd6d0
    • Paulo Marques's avatar
      [PATCH] kallsyms data size reduction / lookup speedup · e1039211
      Paulo Marques authored
      This patch is an improvement over my first kallsyms speedup patch posted about
      2 weeks ago.
      
      It changes scripts/kallsyms as to produce a different format for
      kallsyms_names and extra data to speedup lookups.  The compression algorithm
      is quite simple: it uses all the char codes not actually used in symbols to
      build a lookup table that translates these codes into small strings.  For
      instance, in my test runs the code 0xFE was being translated into "acpi_"
      giving a 4 byte save on every translation.
      
      The advantage of this algorithm is that to translate a symbol we only require
      information that is stored on that symbol position, and never need to go back
      on the compressed stream to get information from other symbols.
      
      To give an idea about the benefits of this algorithm here are some benchmark
      results on a P4 2.8GHz with a symbol table with 10000 entries:
      
      kallsyms_lookup average time:
        vanilla           1346.0 us
        speedup             14.4 us
        with this patch      0.5 us
      
      total data produced by scripts/kallsyms:
        uncompressed         169 Kb
        vanilla              134 Kb
        with this patch       91 Kb
      
      (speedup was my latest patch, that only changed the way kallsyms_lookup worked
      and not the data format)
      
      I removed a cond_resched() from the proc/kallsyms handling code path, because
      using stem compression, if the current position went backwards, the hole
      stream would be uncompressed up to the current position.  It seemed that by
      removing this loop it would be safe to remove the conditional reschedule
      altogether.
      
      There is just one catch with this patch: the time it takes to compile the
      kernel goes up just a bit (about 0.8s on a P4 2.8GHz with defconfig).  If this
      delay is not acceptable I can change the compression algorithm so that it can
      use the previous table (calculating a new table is what consumes most of the
      time, and not doing the actual compression) and check to see if it obtains a
      similar compression ratio.  If it does, then this is a sign that the symbol
      patterns haven't changed that much and this table is still good to use.  This
      would not only cut the time down to half on any compilation (because of the 2
      pass symbol build method), but in frequent cases where a developer is
      compiling a single file and linking everything over and over again, the table
      optimization process would never run.
      
      I'm CC'ing Brent Casavant on this email, because last june he sent a patch
      trying a different approach that used a 32 entry symbol cache, because there
      was a problem with the time "top" took to read "proc/<pid>/wchan".  I was
      hopping he would be willing to test this patch and comment on the results.
      Signed-off-by: default avatarPaulo Marques <pmarques@grupopie.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e1039211
    • David Howells's avatar
      [PATCH] implement in-kernel keys & keyring management · e4262f59
      David Howells authored
      The feature set the patch includes:
      
       - Key attributes:
         - Key type
         - Description (by which a key of a particular type can be selected)
         - Payload
         - UID, GID and permissions mask
         - Expiry time
       - Keyrings (just a type of key that holds links to other keys)
       - User-defined keys
       - Key revokation
       - Access controls
       - Per user key-count and key-memory consumption quota
       - Three std keyrings per task: per-thread, per-process, session
       - Two std keyrings per user: per-user and default-user-session
       - prctl() functions for key and keyring creation and management
       - Kernel interfaces for filesystem, blockdev, net stack access
       - JIT key creation by usermode helper
      
      There are also two utility programs available:
      
       (*) http://people.redhat.com/~dhowells/keys/keyctl.c
      
           A comprehensive key management tool, permitting all the interfaces
           available to userspace to be exercised.
      
       (*) http://people.redhat.com/~dhowells/keys/request-key
      
           An example shell script (to be installed in /sbin) for instantiating a
           key.
      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>
      e4262f59
    • David Howells's avatar
      [PATCH] keys: new error codes for Alpha, MIPS, PA-RISC, Sparc & Sparc64 · 322f317d
      David Howells authored
      The attached patch adds the new error codes I added for key-related errors to
      those archs that don't make use of <asm-generic/errno.h>, including Alpha,
      MIPS, PA-RISC, Sparc and Sparc64.  This is required to compile with
      CONFIG_KEYS on those platforms.
      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>
      322f317d