1. 07 Dec, 2006 40 commits
    • Arnd Bergmann's avatar
      [PATCH] remove kernel syscalls · f5738cee
      Arnd Bergmann authored
      
      
      The last thing we agreed on was to remove the macros entirely for 2.6.19,
      on all architectures. Unfortunately, I think nobody actually _did_ that,
      so they are still there.
      
      [akpm@osdl.org: x86_64 fix]
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Greg Schafer <gschafer@zip.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      f5738cee
    • Peter Zijlstra's avatar
      [PATCH] debug: workqueue locking sanity · d5abe669
      Peter Zijlstra authored
      
      
      Workqueue functions should not leak locks, assert so, printing the
      last function ran.
      
      Use macros in lockdep.h to avoid include dependency pains.
      
      [akpm@osdl.org: build fix]
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d5abe669
    • Ingo Molnar's avatar
      [PATCH] sleep profiling · ece8a684
      Ingo Molnar authored
      
      
      Implement prof=sleep profiling.  TASK_UNINTERRUPTIBLE sleeps will be taken
      as a profile hit, and every millisecond spent sleeping causes a profile-hit
      for the call site that initiated the sleep.
      
      Sample readprofile output on i386:
      
         306 ps2_sendbyte                               1.3973
         432 call_usermodehelper_keys                   1.9548
         484 ps2_command                                0.6453
         790 __driver_attach                            4.7879
        1593 msleep                                    44.2500
        3976 sync_buffer                               64.1290
        4076 do_lookup                                 12.4648
        8587 sync_page                                122.6714
       20820 total                                      0.0067
      
      (NOTE: architectures need to check whether get_wchan() can be called from
      deep within the wakeup path.)
      
      akpm: we need to mark more functions __sched.  lock_sock(), msleep(), others..
      
      akpm: the contention in do_lookup() is a surprise.  Presumably doing disk
      reads for directory contents while holding i_mutex.
      
      [akpm@osdl.org: various fixes]
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      ece8a684
    • Peter Zijlstra's avatar
      [PATCH] lockdep: name some old style locks · 6cfd76a2
      Peter Zijlstra authored
      
      
      Name some of the remaning 'old_style_spin_init' locks
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6cfd76a2
    • Andrew Morton's avatar
      [PATCH] ext4: uninline large functions · 8984d137
      Andrew Morton authored
      
      
      Saves nearly 4kbytes on x86.
      
      Cc: Arnaldo Carvalho de Melo <acme@mandriva.com>
      Cc: <linux-ext4@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      8984d137
    • Andrew Morton's avatar
      [PATCH] ext3: uninline large functions · 3a229b39
      Andrew Morton authored
      
      
      Saves nearly 4kbytes on x86.
      
      Cc: Arnaldo Carvalho de Melo <acme@mandriva.com>
      Cc: <linux-ext4@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      3a229b39
    • Paul B Schroeder's avatar
      [PATCH] Exar quad port serial · e0980daf
      Paul B Schroeder authored
      
      
      This is on our "Envoy" boxes which we have, according to the documentation, an
      "Exar ST16C554/554D Quad UART with 16-byte Fifo's".  The box also has two
      other "on-board" serial ports and a modem chip.
      
      The two on-board serial UARTs were being detected along with the first two
      Exar UARTs.  The last two Exar UARTs were not showing up and neither was the
      modem.
      
      This patch was the only way I could the kernel to see beyond the standard four
      serial ports and get all four of the Exar UARTs to show up.
      
      [akpm@osdl.org: build fix]
      Signed-off-by: default avatarPaul B Schroeder <pschroeder@uplogix.com>
      Cc: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
      Acked-by: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e0980daf
    • Alexey Dobriyan's avatar
      [PATCH] Compile-time check re world-writeable module params · 9774a1f5
      Alexey Dobriyan authored
      
      
      One of the mistakes a module_param() user can make is to supply default
      value of module parameter as the last argument.  module_param() accepts
      permissions instead.  If default value is, say, 3 (-------wx), parameter
      becomes world-writeable.
      
      So far, the only remedy was to apply grep(1) and read drivers submitted
      to -mm. BTDT.
      
      With this patch applied, compiler will finally do some job.
      
      *) bounds checking on permissions
      *) world-writeable bit checking on permissions
      *) compile breakage if checks trigger
      
      First version of this check (only "& 2" part) directly caught 4 out of 7
      places during my last grep.
      
          Subject: Neverending module_param() bugs
          [X] drivers/acpi/sbs.c:101:module_param(capacity_mode, int, CAPACITY_UNIT);
          [X] drivers/acpi/sbs.c:102:module_param(update_mode, int, UPDATE_MODE);
          [ ] drivers/acpi/sbs.c:103:module_param(update_info_mode, int, UPDATE_INFO_MODE);
          [ ] drivers/acpi/sbs.c:104:module_param(update_time, int, UPDATE_TIME);
          [ ] drivers/acpi/sbs.c:105:module_param(update_time2, int, UPDATE_TIME2);
          [X] drivers/char/watchdog/sbc8360.c:203:module_param(timeout, int, 27);
          [X] drivers/media/video/tuner-simple.c:13:module_param(offset, int, 0666);
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      9774a1f5
    • Oleg Nesterov's avatar
      [PATCH] taskstats: cleanup ->signal->stats allocation · 34ec1234
      Oleg Nesterov authored
      
      
      Allocate ->signal->stats on demand in taskstats_exit(), this allows us to
      remove taskstats_tgid_alloc() (the last non-trivial inline) from taskstat's
      public interface.
      Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: Jay Lan <jlan@engr.sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      34ec1234
    • Oleg Nesterov's avatar
      [PATCH] taskstats: cleanup do_exit() path · 115085ea
      Oleg Nesterov authored
      
      
      do_exit:
      	taskstats_exit_alloc()
      	...
      	taskstats_exit_send()
      	taskstats_exit_free()
      
      I think this is not good, let it be a single function exported to the core
      kernel, taskstats_exit(), which does alloc + send + free itself.
      Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: Shailabh Nagar <nagar@watson.ibm.com>
      Cc: Jay Lan <jlan@engr.sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      115085ea
    • Andrew Morton's avatar
      [PATCH] probe_kernel_address() needs to do set_fs() · 20aa7b21
      Andrew Morton authored
      
      
      probe_kernel_address() purports to be generic, only it forgot to select
      KERNEL_DS, so it presently won't work right on all architectures.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      20aa7b21
    • Ryan Underwood's avatar
      [PATCH] parport_pc: Add support for OX16PCI952 parallel port · c140e110
      Ryan Underwood authored
      
      
      Add support for the parallel port (implemented as separate PCI function) on
      the Oxford Semiconductor OX16PCI952.
      Signed-off-by: default avatarRyan Underwood <nemesis@icequake.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c140e110
    • Jan Engelhardt's avatar
      [PATCH] pull in necessary header files for cdev.h · 5ec68b2e
      Jan Engelhardt authored
      
      
      linux/cdev.h uses struct kobject and other structs and should therefore
      include them.  Currently, a module either needs to add the missing includes
      itself, or, in case a module includes other headers already, needs to put
      <linux/cdev.h> last, which goes against a alphabetically-sorted include
      list.
      Signed-off-by: default avatarJan Engelhardt <jengelh@gmx.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      5ec68b2e
    • Ingo Molnar's avatar
      [PATCH] SysRq-X: show blocked tasks · e59e2ae2
      Ingo Molnar authored
      
      
      Add SysRq-X support: show blocked (TASK_UNINTERRUPTIBLE) tasks only.
      
      Useful for debugging IO stalls.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e59e2ae2
    • Miklos Szeredi's avatar
      [PATCH] fuse: add DESTROY operation · 0ec7ca41
      Miklos Szeredi authored
      
      
      Add a DESTROY operation for block device based filesystems.  With the help of
      this operation, such a filesystem can flush dirty data to the device
      synchronously before the umount returns.
      
      This is needed in situations where the filesystem is assumed to be clean
      immediately after unmount (e.g.  ejecting removable media).
      Signed-off-by: default avatarMiklos Szeredi <miklos@szeredi.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      0ec7ca41
    • Miklos Szeredi's avatar
      [PATCH] fuse: add bmap support · b2d2272f
      Miklos Szeredi authored
      
      
      Add support for the BMAP operation for block device based filesystems.  This
      is needed to support swap-files and lilo.
      Signed-off-by: default avatarMiklos Szeredi <miklos@szeredi.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b2d2272f
    • Miklos Szeredi's avatar
      [PATCH] fuse: update userspace interface to version 7.8 · e9168c18
      Miklos Szeredi authored
      
      
      Add a flag to the RELEASE message which specifies that a FLUSH operation
      should be performed as well.  This interface update is needed for the FreeBSD
      port, and doesn't actually touch the Linux implementation at all.
      
      Also rename the unused 'flush_flags' in the FLUSH message to 'unused'.
      Signed-off-by: default avatarMiklos Szeredi <miklos@szeredi.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e9168c18
    • Jan Engelhardt's avatar
      [PATCH] constify inode accessors · 48ed214d
      Jan Engelhardt authored
      
      
      Change the signature of i_size_read(), IMINOR() and IMAJOR() because they,
      or the functions they call, will never modify the argument.
      Signed-off-by: default avatarJan Engelhardt <jengelh@gmx.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      48ed214d
    • Peter Zijlstra's avatar
      [PATCH] lockdep: annotate nfs/nfsd in-kernel sockets · ed07536e
      Peter Zijlstra authored
      
      
      Stick NFS sockets in their own class to avoid some lockdep warnings.  NFS
      sockets are never exposed to user-space, and will hence not trigger certain
      code paths that would otherwise pose deadlock scenarios.
      
      [akpm@osdl.org: cleanups]
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarSteven Dickson <SteveD@redhat.com>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Acked-by: default avatarNeil Brown <neilb@suse.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      [ Fixed patch corruption by quilt, pointed out by Peter Zijlstra ]
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      ed07536e
    • Peter Korsgaard's avatar
      [PATCH] serial uartlite driver · 238b8721
      Peter Korsgaard authored
      Add a driver for the Xilinx uartlite serial controller used in boards with
      the PPC405 core in the Xilinx V2P/V4 fpgas.
      
      The hardware is very simple (baudrate/start/stopbits fixed and no break
      support).  See the datasheet for details:
      
      	http://www.xilinx.com/bvdocs/ipcenter/data_sheet/opb_uartlite.pdf
      
      See http://thread.gmane.org/gmane.linux.serial/1237/
      
       for the email thread.
      Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
      Acked-by: default avatarOlof Johansson <olof@lixom.net>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      238b8721
    • Mike Miller's avatar
      [PATCH] cciss: add support for 1024 logical volumes · 799202cb
      Mike Miller authored
      
      
      Add the support for a large number of logical volumes.  We will soon have
      hardware that support up to 1024 logical volumes.
      Signed-off-by: default avatarMike Miller <mike.miller@hp.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      799202cb
    • Adrian Bunk's avatar
      [PATCH] fix v850 compilation · eef88d16
      Adrian Bunk authored
      
      
      More fallout of the post 2.6.19-rc1 IRQ changes...
      
            CC      init/main.o
          In file included from
          /home/bunk/linux/kernel-2.6/linux-2.6.19-rc6-mm2/include/linux/rtc.h:102,
                           from
          /home/bunk/linux/kernel-2.6/linux-2.6.19-rc6-mm2/include/linux/efi.h:19,
                           from
          /home/bunk/linux/kernel-2.6/linux-2.6.19-rc6-mm2/init/main.c:43:
          /home/bunk/linux/kernel-2.6/linux-2.6.19-rc6-mm2/include/linux/interrupt.h:67:
          error: conflicting types for 'irq_handler_t'
          include2/asm/irq.h:49: error: previous declaration of 'irq_handler_t' was here
      Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
      Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      eef88d16
    • Rafael J. Wysocki's avatar
      [PATCH] Support for freezeable workqueues · 341a5958
      Rafael J. Wysocki authored
      
      
      Make it possible to create a workqueue the worker thread of which will be
      frozen during suspend, along with other kernel threads.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Cc: Nigel Cunningham <nigel@suspend2.net>
      Cc: David Chinner <dgc@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      341a5958
    • Rafael J. Wysocki's avatar
      [PATCH] swsusp: Untangle thaw_processes · a9b6f562
      Rafael J. Wysocki authored
      
      
      Move the loop from thaw_processes() to a separate function and call it
      independently for kernel threads and user space processes so that the order
      of thawing tasks is clearly visible.
      
      Drop thaw_kernel_threads() which is never used.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Nigel Cunningham <nigel@suspend2.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a9b6f562
    • Rafael J. Wysocki's avatar
      [PATCH] swsusp: Support i386 systems with PAE or without PSE · 2d4a34c9
      Rafael J. Wysocki authored
      
      
      Make swsusp support i386 systems with PAE or without PSE.
      
      This is done by creating temporary page tables located in resume-safe page
      frames before the suspend image is restored in the same way as x86_64 does
      it.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Nigel Cunningham <ncunningham@linuxmail.org>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      2d4a34c9
    • Nigel Cunningham's avatar
      [PATCH] swsusp: thaw userspace and kernel space separately · ff39593a
      Nigel Cunningham authored
      
      
      Modify process thawing so that we can thaw kernel space without thawing
      userspace, and thaw kernelspace first.  This will be useful in later
      patches, where I intend to get swsusp thawing kernel threads only before
      seeking to free memory.
      Signed-off-by: default avatarNigel Cunningham <nigel@suspend2.net>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      ff39593a
    • Nigel Cunningham's avatar
      [PATCH] Add include/linux/freezer.h and move definitions from sched.h · 7dfb7103
      Nigel Cunningham authored
      
      
      Move process freezing functions from include/linux/sched.h to freezer.h, so
      that modifications to the freezer or the kernel configuration don't require
      recompiling just about everything.
      
      [akpm@osdl.org: fix ueagle driver]
      Signed-off-by: default avatarNigel Cunningham <nigel@suspend2.net>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      7dfb7103
    • Rafael J. Wysocki's avatar
      [PATCH] swsusp: Improve handling of highmem · 8357376d
      Rafael J. Wysocki authored
      
      
      Currently swsusp saves the contents of highmem pages by copying them to the
      normal zone which is quite inefficient (eg.  it requires two normal pages
      to be used for saving one highmem page).  This may be improved by using
      highmem for saving the contents of saveable highmem pages.
      
      Namely, during the suspend phase of the suspend-resume cycle we try to
      allocate as many free highmem pages as there are saveable highmem pages.
      If there are not enough highmem image pages to store the contents of all of
      the saveable highmem pages, some of them will be stored in the "normal"
      memory.  Next, we allocate as many free "normal" pages as needed to store
      the (remaining) image data.  We use a memory bitmap to mark the allocated
      free pages (ie.  highmem as well as "normal" image pages).
      
      Now, we use another memory bitmap to mark all of the saveable pages
      (highmem as well as "normal") and the contents of the saveable pages are
      copied into the image pages.  Then, the second bitmap is used to save the
      pfns corresponding to the saveable pages and the first one is used to save
      their data.
      
      During the resume phase the pfns of the pages that were saveable during the
      suspend are loaded from the image and used to mark the "unsafe" page
      frames.  Next, we try to allocate as many free highmem page frames as to
      load all of the image data that had been in the highmem before the suspend
      and we allocate so many free "normal" page frames that the total number of
      allocated free pages (highmem and "normal") is equal to the size of the
      image.  While doing this we have to make sure that there will be some extra
      free "normal" and "safe" page frames for two lists of PBEs constructed
      later.
      
      Now, the image data are loaded, if possible, into their "original" page
      frames.  The image data that cannot be written into their "original" page
      frames are loaded into "safe" page frames and their "original" kernel
      virtual addresses, as well as the addresses of the "safe" pages containing
      their copies, are stored in one of two lists of PBEs.
      
      One list of PBEs is for the copies of "normal" suspend pages (ie.  "normal"
      pages that were saveable during the suspend) and it is used in the same way
      as previously (ie.  by the architecture-dependent parts of swsusp).  The
      other list of PBEs is for the copies of highmem suspend pages.  The pages
      in this list are restored (in a reversible way) right before the
      arch-dependent code is called.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      8357376d
    • Rafael J. Wysocki's avatar
      [PATCH] swsusp: use block device offsets to identify swap locations · 3aef83e0
      Rafael J. Wysocki authored
      
      
      Make swsusp use block device offsets instead of swap offsets to identify swap
      locations and make it use the same code paths for writing as well as for
      reading data.
      
      This allows us to use the same code for handling swap files and swap
      partitions and to simplify the code, eg.  by dropping rw_swap_page_sync().
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      3aef83e0
    • Rafael J. Wysocki's avatar
      [PATCH] swsusp: use partition device and offset to identify swap areas · 915bae9e
      Rafael J. Wysocki authored
      
      
      The Linux kernel handles swap files almost in the same way as it handles swap
      partitions and there are only two differences between these two types of swap
      areas:
      
      (1) swap files need not be contiguous,
      
      (2) the header of a swap file is not in the first block of the partition
          that holds it.  From the swsusp's point of view (1) is not a problem,
          because it is already taken care of by the swap-handling code, but (2) has
          to be taken into consideration.
      
      In principle the location of a swap file's header may be determined with the
      help of appropriate filesystem driver.  Unfortunately, however, it requires
      the filesystem holding the swap file to be mounted, and if this filesystem is
      journaled, it cannot be mounted during a resume from disk.  For this reason we
      need some other means by which swap areas can be identified.
      
      For example, to identify a swap area we can use the partition that holds the
      area and the offset from the beginning of this partition at which the swap
      header is located.
      
      The following patch allows swsusp to identify swap areas this way.  It changes
      swap_type_of() so that it takes an additional argument representing an offset
      of the swap header within the partition represented by its first argument.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      915bae9e
    • Nick Piggin's avatar
      [PATCH] radix-tree: RCU lockless readside · 7cf9c2c7
      Nick Piggin authored
      
      
      Make radix tree lookups safe to be performed without locks.  Readers are
      protected against nodes being deleted by using RCU based freeing.  Readers
      are protected against new node insertion by using memory barriers to ensure
      the node itself will be properly written before it is visible in the radix
      tree.
      
      Each radix tree node keeps a record of their height (above leaf nodes).
      This height does not change after insertion -- when the radix tree is
      extended, higher nodes are only inserted in the top.  So a lookup can take
      the pointer to what is *now* the root node, and traverse down it even if
      the tree is concurrently extended and this node becomes a subtree of a new
      root.
      
      "Direct" pointers (tree height of 0, where root->rnode points directly to
      the data item) are handled by using the low bit of the pointer to signal
      whether rnode is a direct pointer or a pointer to a radix tree node.
      
      When a reader wants to traverse the next branch, they will take a copy of
      the pointer.  This pointer will be either NULL (and the branch is empty) or
      non-NULL (and will point to a valid node).
      
      [akpm@osdl.org: cleanups]
      [Lee.Schermerhorn@hp.com: bugfixes, comments, simplifications]
      [clameter@sgi.com: build fix]
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
      Signed-off-by: default avatarLee Schermerhorn <lee.schermerhorn@hp.com>
      Cc: Christoph Lameter <clameter@engr.sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      7cf9c2c7
    • Arnaldo Carvalho de Melo's avatar
      [PATCH] Save some bytes in struct mm_struct · 36de6437
      Arnaldo Carvalho de Melo authored
      
      
      Before:
      [acme@newtoy net-2.6.20]$ pahole --cacheline 32 kernel/sched.o mm_struct
      
      /* include2/asm/processor.h:542 */
      struct mm_struct {
              struct vm_area_struct *    mmap;                 /*     0     4 */
              struct rb_root             mm_rb;                /*     4     4 */
              struct vm_area_struct *    mmap_cache;           /*     8     4 */
              long unsigned int          (*get_unmapped_area)(); /*    12     4 */
              void                       (*unmap_area)();      /*    16     4 */
              long unsigned int          mmap_base;            /*    20     4 */
              long unsigned int          task_size;            /*    24     4 */
              long unsigned int          cached_hole_size;     /*    28     4 */
              /* ---------- cacheline 1 boundary ---------- */
              long unsigned int          free_area_cache;      /*    32     4 */
              pgd_t *                    pgd;                  /*    36     4 */
              atomic_t                   mm_users;             /*    40     4 */
              atomic_t                   mm_count;             /*    44     4 */
              int                        map_count;            /*    48     4 */
              struct rw_semaphore        mmap_sem;             /*    52    64 */
              spinlock_t                 page_table_lock;      /*   116    40 */
              struct list_head           mmlist;               /*   156     8 */
              mm_counter_t               _file_rss;            /*   164     4 */
              mm_counter_t               _anon_rss;            /*   168     4 */
              long unsigned int          hiwater_rss;          /*   172     4 */
              long unsigned int          hiwater_vm;           /*   176     4 */
              long unsigned int          total_vm;             /*   180     4 */
              long unsigned int          locked_vm;            /*   184     4 */
              long unsigned int          shared_vm;            /*   188     4 */
              /* ---------- cacheline 6 boundary ---------- */
              long unsigned int          exec_vm;              /*   192     4 */
              long unsigned int          stack_vm;             /*   196     4 */
              long unsigned int          reserved_vm;          /*   200     4 */
              long unsigned int          def_flags;            /*   204     4 */
              long unsigned int          nr_ptes;              /*   208     4 */
              long unsigned int          start_code;           /*   212     4 */
              long unsigned int          end_code;             /*   216     4 */
              long unsigned int          start_data;           /*   220     4 */
              /* ---------- cacheline 7 boundary ---------- */
              long unsigned int          end_data;             /*   224     4 */
              long unsigned int          start_brk;            /*   228     4 */
              long unsigned int          brk;                  /*   232     4 */
              long unsigned int          start_stack;          /*   236     4 */
              long unsigned int          arg_start;            /*   240     4 */
              long unsigned int          arg_end;              /*   244     4 */
              long unsigned int          env_start;            /*   248     4 */
              long unsigned int          env_end;              /*   252     4 */
              /* ---------- cacheline 8 boundary ---------- */
              long unsigned int          saved_auxv[44];       /*   256   176 */
              unsigned int               dumpable:2;           /*   432     4 */
              cpumask_t                  cpu_vm_mask;          /*   436     4 */
              mm_context_t               context;              /*   440    68 */
              long unsigned int          swap_token_time;      /*   508     4 */
              /* ---------- cacheline 16 boundary ---------- */
              char                       recent_pagein;        /*   512     1 */
      
              /* XXX 3 bytes hole, try to pack */
      
              int                        core_waiters;         /*   516     4 */
              struct completion *        core_startup_done;    /*   520     4 */
              struct completion          core_done;            /*   524    52 */
              rwlock_t                   ioctx_list_lock;      /*   576    36 */
              struct kioctx *            ioctx_list;           /*   612     4 */
      }; /* size: 616, sum members: 613, holes: 1, sum holes: 3, cachelines: 20,
            last cacheline: 8 bytes */
      
      After:
      
      [acme@newtoy net-2.6.20]$ pahole --cacheline 32 kernel/sched.o mm_struct
      /* include2/asm/processor.h:542 */
      struct mm_struct {
              struct vm_area_struct *    mmap;                 /*     0     4 */
              struct rb_root             mm_rb;                /*     4     4 */
              struct vm_area_struct *    mmap_cache;           /*     8     4 */
              long unsigned int          (*get_unmapped_area)(); /*    12     4 */
              void                       (*unmap_area)();      /*    16     4 */
              long unsigned int          mmap_base;            /*    20     4 */
              long unsigned int          task_size;            /*    24     4 */
              long unsigned int          cached_hole_size;     /*    28     4 */
              /* ---------- cacheline 1 boundary ---------- */
              long unsigned int          free_area_cache;      /*    32     4 */
              pgd_t *                    pgd;                  /*    36     4 */
              atomic_t                   mm_users;             /*    40     4 */
              atomic_t                   mm_count;             /*    44     4 */
              int                        map_count;            /*    48     4 */
              struct rw_semaphore        mmap_sem;             /*    52    64 */
              spinlock_t                 page_table_lock;      /*   116    40 */
              struct list_head           mmlist;               /*   156     8 */
              mm_counter_t               _file_rss;            /*   164     4 */
              mm_counter_t               _anon_rss;            /*   168     4 */
              long unsigned int          hiwater_rss;          /*   172     4 */
              long unsigned int          hiwater_vm;           /*   176     4 */
              long unsigned int          total_vm;             /*   180     4 */
              long unsigned int          locked_vm;            /*   184     4 */
              long unsigned int          shared_vm;            /*   188     4 */
              /* ---------- cacheline 6 boundary ---------- */
              long unsigned int          exec_vm;              /*   192     4 */
              long unsigned int          stack_vm;             /*   196     4 */
              long unsigned int          reserved_vm;          /*   200     4 */
              long unsigned int          def_flags;            /*   204     4 */
              long unsigned int          nr_ptes;              /*   208     4 */
              long unsigned int          start_code;           /*   212     4 */
              long unsigned int          end_code;             /*   216     4 */
              long unsigned int          start_data;           /*   220     4 */
              /* ---------- cacheline 7 boundary ---------- */
              long unsigned int          end_data;             /*   224     4 */
              long unsigned int          start_brk;            /*   228     4 */
              long unsigned int          brk;                  /*   232     4 */
              long unsigned int          start_stack;          /*   236     4 */
              long unsigned int          arg_start;            /*   240     4 */
              long unsigned int          arg_end;              /*   244     4 */
              long unsigned int          env_start;            /*   248     4 */
              long unsigned int          env_end;              /*   252     4 */
              /* ---------- cacheline 8 boundary ---------- */
              long unsigned int          saved_auxv[44];       /*   256   176 */
              cpumask_t                  cpu_vm_mask;          /*   432     4 */
              mm_context_t               context;              /*   436    68 */
              long unsigned int          swap_token_time;      /*   504     4 */
              char                       recent_pagein;        /*   508     1 */
              unsigned char              dumpable:2;           /*   509     1 */
      
              /* XXX 2 bytes hole, try to pack */
      
              int                        core_waiters;         /*   512     4 */
              struct completion *        core_startup_done;    /*   516     4 */
              struct completion          core_done;            /*   520    52 */
              rwlock_t                   ioctx_list_lock;      /*   572    36 */
              struct kioctx *            ioctx_list;           /*   608     4 */
      }; /* size: 612, sum members: 610, holes: 1, sum holes: 2, cachelines: 20,
            last cacheline: 4 bytes */
      
      [acme@newtoy net-2.6.20]$ codiff -V /tmp/sched.o.before kernel/sched.o
      /pub/scm/linux/kernel/git/acme/net-2.6.20/kernel/sched.c:
        struct mm_struct |   -4
          dumpable:2;
           from: unsigned int          /*   432(30)    4(2) */
           to:   unsigned char         /*   509(6)     1(2) */
      < SNIP other offset changes >
       1 struct changed
      [acme@newtoy net-2.6.20]$
      
      I'm not aware of any problem about using 2 byte wide bitfields where
      previously a 4 byte wide one was, holler if there is any, I wouldn't be
      surprised, bitfields are things from hell.
      
      For the curious, 432(30) means: at offset 432 from the struct start, at
      offset 30 in the bitfield (yeah, it comes backwards, hellish, huh?) ditto
      for 509(6), while 4(2) and 1(2) means "struct field size(bitfield size)".
      
      Now we have a 2 bytes hole and are using only 4 bytes of the last 32
      bytes cacheline, any takers? :-)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      36de6437
    • Andy Whitcroft's avatar
      [PATCH] mm: make compound page destructor handling explicit · 33f2ef89
      Andy Whitcroft authored
      
      
      Currently we we use the lru head link of the second page of a compound page
      to hold its destructor.  This was ok when it was purely an internal
      implmentation detail.  However, hugetlbfs overrides this destructor
      violating the layering.  Abstract this out as explicit calls, also
      introduce a type for the callback function allowing them to be type
      checked.  For each callback we pre-declare the function, causing a type
      error on definition rather than on use elsewhere.
      
      [akpm@osdl.org: cleanups]
      Signed-off-by: default avatarAndy Whitcroft <apw@shadowen.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      33f2ef89
    • Andrew Morton's avatar
      [PATCH] slab: deprecate kmem_cache_t · 1b1cec4b
      Andrew Morton authored
      
      
      Cc: Christoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      1b1cec4b
    • Christoph Lameter's avatar
      [PATCH] slab: remove kmem_cache_t · e18b890b
      Christoph Lameter authored
      
      
      Replace all uses of kmem_cache_t with struct kmem_cache.
      
      The patch was generated using the following script:
      
      	#!/bin/sh
      	#
      	# Replace one string by another in all the kernel sources.
      	#
      
      	set -e
      
      	for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do
      		quilt add $file
      		sed -e "1,\$s/$1/$2/g" $file >/tmp/$$
      		mv /tmp/$$ $file
      		quilt refresh
      	done
      
      The script was run like this
      
      	sh replace kmem_cache_t "struct kmem_cache"
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e18b890b
    • Christoph Lameter's avatar
      [PATCH] slab: remove SLAB_DMA · 441e143e
      Christoph Lameter authored
      
      
      SLAB_DMA is an alias of GFP_DMA. This is the last one so we
      remove the leftover comment too.
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      441e143e
    • Christoph Lameter's avatar
      [PATCH] slab: remove SLAB_KERNEL · e94b1766
      Christoph Lameter authored
      
      
      SLAB_KERNEL is an alias of GFP_KERNEL.
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e94b1766
    • Christoph Lameter's avatar
      [PATCH] slab: remove SLAB_ATOMIC · 54e6ecb2
      Christoph Lameter authored
      
      
      SLAB_ATOMIC is an alias of GFP_ATOMIC
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      54e6ecb2
    • Christoph Lameter's avatar
      [PATCH] slab: remove SLAB_USER · f7267c0c
      Christoph Lameter authored
      
      
      SLAB_USER is an alias of GFP_USER
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      f7267c0c
    • Christoph Lameter's avatar
      [PATCH] slab: remove SLAB_NOFS · e6b4f8da
      Christoph Lameter authored
      
      
      SLAB_NOFS is an alias of GFP_NOFS.
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e6b4f8da