1. 07 Jul, 2005 19 commits
    • Alexey Dobriyan's avatar
      0db925af
    • Nick Piggin's avatar
      [PATCH] page_uptodate locking scalability · a3972203
      Nick Piggin authored
      
      
      Use a bit spin lock in the first buffer of the page to synchronise asynch
      IO buffer completions, instead of the global page_uptodate_lock, which is
      showing some scalabilty problems.
      Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a3972203
    • Arnd Bergmann's avatar
      [PATCH] xtensa: remove old syscalls · 87591451
      Arnd Bergmann authored
      
      
      xtensa is now in -rc1, with the obsolete syscalls still in there, so I
      guess this about the last chance to correct the ABI.  Applying the patch
      obviously breaks all sorts of user space binaries and probably also
      requires the appropriate changes to be made to libc.
      
      On the other hand, if a decision is made to keep the broken interface, it
      should at least be a conscious one instead of an oversight.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Chris Zankel <chris@zankel.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      87591451
    • Jeff Dike's avatar
      [PATCH] uml: skas0 - separate kernel address space on stock hosts · d67b569f
      Jeff Dike authored
      
      
      UML has had two modes of operation - an insecure, slow mode (tt mode) in
      which the kernel is mapped into every process address space which requires
      no host kernel modifications, and a secure, faster mode (skas mode) in
      which the UML kernel is in a separate host address space, which requires a
      patch to the host kernel.
      
      This patch implements something very close to skas mode for hosts which
      don't support skas - I'm calling this skas0.  It provides the security of
      the skas host patch, and some of the performance gains.
      
      The two main things that are provided by the skas patch, /proc/mm and
      PTRACE_FAULTINFO, are implemented in a way that require no host patch.
      
      For the remote address space changing stuff (mmap, munmap, and mprotect),
      we set aside two pages in the process above its stack, one of which
      contains a little bit of code which can call mmap et al.
      
      To update the address space, the system call information (system call
      number and arguments) are written to the stub page above the code.  The
      %esp is set to the beginning of the data, the %eip is set the the start of
      the stub, and it repeatedly pops the information into its registers and
      makes the system call until it sees a system call number of zero.  This is
      to amortize the cost of the context switch across multiple address space
      updates.
      
      When the updates are done, it SIGSTOPs itself, and the kernel process
      continues what it was doing.
      
      For a PTRACE_FAULTINFO replacement, we set up a SIGSEGV handler in the
      child, and let it handle segfaults rather than nullifying them.  The
      handler is in the same page as the mmap stub.  The second page is used as
      the stack.  The handler reads cr2 and err from the sigcontext, sticks them
      at the base of the stack in a faultinfo struct, and SIGSTOPs itself.  The
      kernel then reads the faultinfo and handles the fault.
      
      A complication on x86_64 is that this involves resetting the registers to
      the segfault values when the process is inside the kill system call.  This
      breaks on x86_64 because %rcx will contain %rip because you tell SYSRET
      where to return to by putting the value in %rcx.  So, this corrupts $rcx on
      return from the segfault.  To work around this, I added an
      arch_finish_segv, which on x86 does nothing, but which on x86_64 ptraces
      the child back through the sigreturn.  This causes %rcx to be restored by
      sigreturn and avoids the corruption.  Ultimately, I think I will replace
      this with the trick of having it send itself a blocked signal which will be
      unblocked by the sigreturn.  This will allow it to be stopped just after
      the sigreturn, and PTRACE_SYSCALLed without all the back-and-forth of
      PTRACE_SYSCALLing it through sigreturn.
      
      This runs on a stock host, so theoretically (and hopefully), tt mode isn't
      needed any more.  We need to make sure that this is better in every way
      than tt mode, though.  I'm concerned about the speed of address space
      updates and page fault handling, since they involve extra round-trips to
      the child.  We can amortize the round-trip cost for large address space
      updates by writing all of the operations to the data page and having the
      child execute them all at the same time.  This will help fork and exec, but
      not page faults, since they involve only one page.
      
      I can't think of any way to help page faults, except to add something like
      PTRACE_FAULTINFO to the host.  There is PTRACE_SIGINFO, but UML doesn't use
      siginfo for SIGSEGV (or anything else) because there isn't enough
      information in the siginfo struct to handle page faults (the faulting
      operation type is missing).  Adding that would make PTRACE_SIGINFO a usable
      equivalent to PTRACE_FAULTINFO.
      
      As for the code itself:
      
      - The system call stub is in arch/um/kernel/sys-$(SUBARCH)/stub.S.  It is
        put in its own section of the binary along with stub_segv_handler in
        arch/um/kernel/skas/process.c.  This is manipulated with run_syscall_stub
        in arch/um/kernel/skas/mem_user.c.  syscall_stub will execute any system
        call at all, but it's only used for mmap, munmap, and mprotect.
      
      - The x86_64 stub calls sigreturn by hand rather than allowing the normal
        sigreturn to happen, because the normal sigreturn is a SA_RESTORER in
        UML's address space provided by libc.  Needless to say, this is not
        available in the child's address space.  Also, it does a couple of odd
        pops before that which restore the stack to the state it was in at the
        time the signal handler was called.
      
      - There is a new field in the arch mmu_context, which is now a union.
        This is the pid to be manipulated rather than the /proc/mm file
        descriptor.  Code which deals with this now checks proc_mm to see whether
        it should use the usual skas code or the new code.
      
      - userspace_tramp is now used to create a new host process for every UML
        process, rather than one per UML processor.  It checks proc_mm and
        ptrace_faultinfo to decide whether to map in the pages above its stack.
      
      - start_userspace now makes CLONE_VM conditional on proc_mm since we need
        separate address spaces now.
      
      - switch_mm_skas now just sets userspace_pid[0] to the new pid rather
        than PTRACE_SWITCH_MM.  There is an addition to userspace which updates
        its idea of the pid being manipulated each time around the loop.  This is
        important on exec, when the pid will change underneath userspace().
      
      - The stub page has a pte, but it can't be mapped in using tlb_flush
        because it is part of tlb_flush.  This is why it's required for it to be
        mapped in by userspace_tramp.
      
      Other random things:
      
      - The stub section in uml.lds.S is page aligned.  This page is written
        out to the backing vm file in setup_physmem because it is mapped from
        there into user processes.
      
      - There's some confusion with TASK_SIZE now that there are a couple of
        extra pages that the process can't use.  TASK_SIZE is considered by the
        elf code to be the usable process memory, which is reasonable, so it is
        decreased by two pages.  This confuses the definition of
        USER_PGDS_IN_LAST_PML4, making it too small because of the rounding down
        of the uneven division.  So we round it to the nearest PGDIR_SIZE rather
        than the lower one.
      
      - I added a missing PT_SYSCALL_ARG6_OFFSET macro.
      
      - um_mmu.h was made into a userspace-usable file.
      
      - proc_mm and ptrace_faultinfo are globals which say whether the host
        supports these features.
      
      - There is a bad interaction between the mm.nr_ptes check at the end of
        exit_mmap, stack randomization, and skas0.  exit_mmap will stop freeing
        pages at the PGDIR_SIZE boundary after the last vma.  If the stack isn't
        on the last page table page, the last pte page won't be freed, as it
        should be since the stub ptes are there, and exit_mmap will BUG because
        there is an unfreed page.  To get around this, TASK_SIZE is set to the
        next lowest PGDIR_SIZE boundary and mm->nr_ptes is decremented after the
        calls to init_stub_pte.  This ensures that we know the process stack (and
        all other process mappings) will be below the top page table page, and
        thus we know that mm->nr_ptes will be one too many, and can be
        decremented.
      
      Things that need fixing:
      
      - We may need better assurrences that the stub code is PIC.
      
      - The stub pte is set up in init_new_context_skas.
      
      - alloc_pgdir is probably the right place.
      Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d67b569f
    • Bernard Blackham's avatar
      [PATCH] pm: fix u32 vs. pm_message_t confusion in cpufreq · e00d9967
      Bernard Blackham authored
      
      
      Fix u32 vs pm_message_t confusion in cpufreq.
      Signed-off-by: default avatarBernard Blackham <bernard@blackham.com.au>
      Signed-off-by: default avatarPavel Machek <pavel@suse.cz>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e00d9967
    • Dave Jones's avatar
      [PATCH] Fix up non-NUMA breakage in mmzone.h · e8af300c
      Dave Jones authored
      
      
      If CONFIG_NUMA isn't set, we use the define in <linux/mmzone.h> for
      early_pfn_to_nid (which defines it to 0).
      
      Because of this, the prototype needs to move inside the CONFIG_NUMA too, or
      anal gcc's get really confused.
      Signed-off-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e8af300c
    • Dave Jones's avatar
      [PATCH] Clean up numa defines in mmzone.h · 8ff8b27b
      Dave Jones authored
      
      
      The recent cleanups to asm-i386/mmzone.h were suboptimal nesting an ifdef of
      the same symbol.  This patch removes some of the ifdef'ery to make things more
      readable again.
      Signed-off-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      8ff8b27b
    • Shaohua Li's avatar
      [PATCH] MTRR suspend/resume cleanup · 3b520b23
      Shaohua Li authored
      
      
      There has been some discuss about solving the SMP MTRR suspend/resume
      breakage, but I didn't find a patch for it.  This is an intent for it.  The
      basic idea is moving mtrr initializing into cpu_identify for all APs (so it
      works for cpu hotplug).  For BP, restore_processor_state is responsible for
      restoring MTRR.
      Signed-off-by: default avatarShaohua Li <shaohua.li@intel.com>
      Acked-by: default avatarAndi Kleen <ak@muc.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      3b520b23
    • Michael Ellerman's avatar
      [PATCH] ppc64: Make idle_loop a ppc_md function · fd899c0c
      Michael Ellerman authored
      
      
      This patch adds an idle member to the ppc_md structure and calls it from
      cpu_idle().  If a platform leaves ppc_md.idle as null it will get the default
      idle loop default_idle().
      Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      fd899c0c
    • Milton Miller's avatar
      [PATCH] hvc_console: Register ops when setting up hvc_console · 030ffad2
      Milton Miller authored
      
      
      When registering the hvc console port, register a list of ops (read and write)
      to go with it, instead of calling fixed function names.
      
      This allows different ports to encode the data differently.
      Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      030ffad2
    • Milton Miller's avatar
      [PATCH] hvc_console: Separate hvc_console and vio code 2 · acad9559
      Milton Miller authored
      
      
      Remove all the vio device driver code from hvc_console.c
      
      This will allow us to separate hvsi, hvc, and allow hvc_console to be used
      without the ppc64 vio layer.
      Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      acad9559
    • Milton Miller's avatar
      [PATCH] hvc_console: Separate hvc_console and vio code · d5ee257c
      Milton Miller authored
      
      
      Separate the console setup routines of the hvc_console and the vio layer.
      
      Remove the call to find_init_vty from hvc_console.c.
      
      Fail the setup routine if the console doesn't exist, but register the console
      again when the specified channel is instantiated.  This scheme maintains the
      print buffer semantics while eliminating callout and call back for the console
      code.
      Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d5ee257c
    • Anton Blanchard's avatar
      [PATCH] ppc64: remove duplicate syscall reservation · 5cee73fa
      Anton Blanchard authored
      
      
      We already have a prototype for sys_remap_file_pages (239) so there is no need
      to reserve it twice.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      5cee73fa
    • Anton Blanchard's avatar
      [PATCH] ppc64: add ioprio syscalls · 79c2cc7b
      Anton Blanchard authored
      
      
      - Clean up sys32_getpriority comment.
      - Add ioprio syscalls, and sign extend 32bit versions.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      79c2cc7b
    • Anton Blanchard's avatar
      [PATCH] move ioprio syscalls into syscalls.h · cf366808
      Anton Blanchard authored
      
      
      - Make ioprio syscalls return long, like set/getpriority syscalls.
      - Move function prototypes into syscalls.h so we can pick them up in the
        32/64bit compat code.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Acked-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>
      cf366808
    • Anton Blanchard's avatar
      [PATCH] ppc64: Turn runlatch on in exception entry · 8dc4fd87
      Anton Blanchard authored
      
      
      Enable the runlatch at the start of each exception.  Unfortunately we are out
      of space in the 0x300 handler, so I added it a bit later.
      
      The SPR write is fairly expensive, perhaps we should cache the runlatch state
      in the paca and avoid the write when possible.
      
      We don't need to turn the runlatch off, we do that in the idle loop.  Better
      to take the hit in the idle loop than for each exception exit.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      8dc4fd87
    • Anton Blanchard's avatar
      [PATCH] ppc64: Fix runlatch code to work on pseries machines · a2f7a9ce
      Anton Blanchard authored
      
      
      Not all ppc64 CPUs have the CTRL SPR, so we need a cputable feature for it.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a2f7a9ce
    • Marcelo Tosatti's avatar
      [PATCH] print order information when OOM killing · 79b9ce31
      Marcelo Tosatti authored
      
      
      Dump the current allocation order when OOM killing.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      79b9ce31
    • Mark Fasheh's avatar
      [PATCH] export generic_drop_inode() to modules · cb2c0233
      Mark Fasheh authored
      
      
      OCFS2 wants to mark an inode which has been orphaned by another node so
      that during final iput it takes the correct path through the VFS and can
      pass through the OCFS2 delete_inode callback.  Since i_nlink can get out of
      date with other nodes, the best way I see to accomplish this is by clearing
      i_nlink on those inodes at drop_inode time.  Other than this small amount
      of work, nothing different needs to happen, so I think it would be cleanest
      to be able to just call generic_drop_inode at the end of the OCFS2
      drop_inode callback.
      Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      cb2c0233
  2. 06 Jul, 2005 12 commits
  3. 05 Jul, 2005 9 commits
    • Rusty Lynch's avatar
      [PATCH] kprobes: fix namespace problem and sparc64 build · 6772926b
      Rusty Lynch authored
      
      
      The following renames arch_init, a kprobes function for performing any
      architecture specific initialization, to arch_init_kprobes in order to
      cleanup the namespace.
      
      Also, this patch adds arch_init_kprobes to sparc64 to fix the sparc64 kprobes
      build from the last return probe patch.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6772926b
    • Andrei Konovalov's avatar
      [PATCH] ppc32: add Freescale MPC885ADS board support · e6b6239f
      Andrei Konovalov authored
      
      
      This patch adds the Freescale MPC86xADS board support.  The supported
      devices are SMC UART and 10Mbit ethernet on SCC1.
      
      The manual for the board says that it "is compatible with the MPC8xxFADS
      for software point of view".  That's why this patch extends FADS instead of
      introducing a new platform.
      
      FEC is not supported as the "combined FCC/FEC ethernet driver" driver by
      Pantelis Antoniou should replace the current FEC driver.
      Signed-off-by: default avatarGennadiy Kurtsman <gkurtsman@ru.mvista.com>
      Signed-off-by: default avatarAndrei Konovalov <akonovalov@ru.mvista.com>
      Acked-by: default avatarTom Rini <trini@kernel.crashing.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e6b6239f
    • David S. Miller's avatar
      [TCP]: Move to new TSO segmenting scheme. · c1b4a7e6
      David S. Miller authored
      
      
      Make TSO segment transmit size decisions at send time not earlier.
      
      The basic scheme is that we try to build as large a TSO frame as
      possible when pulling in the user data, but the size of the TSO frame
      output to the card is determined at transmit time.
      
      This is guided by tp->xmit_size_goal.  It is always set to a multiple
      of MSS and tells sendmsg/sendpage how large an SKB to try and build.
      
      Later, tcp_write_xmit() and tcp_push_one() chop up the packet if
      necessary and conditions warrant.  These routines can also decide to
      "defer" in order to wait for more ACKs to arrive and thus allow larger
      TSO frames to be emitted.
      
      A general observation is that TSO elongates the pipe, thus requiring a
      larger congestion window and larger buffering especially at the sender
      side.  Therefore, it is important that applications 1) get a large
      enough socket send buffer (this is accomplished by our dynamic send
      buffer expansion code) 2) do large enough writes.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1b4a7e6
    • David S. Miller's avatar
      [TCP]: Fix __tcp_push_pending_frames() 'nonagle' handling. · 55c97f3e
      David S. Miller authored
      
      
      'nonagle' should be passed to the tcp_snd_test() function
      as 'TCP_NAGLE_PUSH' if we are checking an SKB not at the
      tail of the write_queue.  This is because Nagle does not
      apply to such frames since we cannot possibly tack more
      data onto them.
      
      However, while doing this __tcp_push_pending_frames() makes
      all of the packets in the write_queue use this modified
      'nonagle' value.
      
      Fix the bug and simplify this function by just calling
      tcp_write_xmit() directly if sk_send_head is non-NULL.
      
      As a result, we can now make tcp_data_snd_check() just call
      tcp_push_pending_frames() instead of the specialized
      __tcp_data_snd_check().
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      55c97f3e
    • David S. Miller's avatar
      [TCP]: Fix redundant calculations of tcp_current_mss() · a2e2a59c
      David S. Miller authored
      
      
      tcp_write_xmit() uses tcp_current_mss(), but some of it's callers,
      namely __tcp_push_pending_frames(), already has this value available
      already.
      
      While we're here, fix the "cur_mss" argument to be "unsigned int"
      instead of plain "unsigned".
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a2e2a59c
    • David S. Miller's avatar
      [TCP]: Kill extra cwnd validate in __tcp_push_pending_frames(). · a762a980
      David S. Miller authored
      
      
      The tcp_cwnd_validate() function should only be invoked
      if we actually send some frames, yet __tcp_push_pending_frames()
      will always invoke it.  tcp_write_xmit() does the call for us,
      so the call here can simply be removed.
      
      Also, tcp_write_xmit() can be marked static.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a762a980
    • David S. Miller's avatar
      [TCP]: Move __tcp_data_snd_check into tcp_output.c · 84d3e7b9
      David S. Miller authored
      
      
      It reimplements portions of tcp_snd_check(), so it
      we move it to tcp_output.c we can consolidate it's
      logic much easier in a later change.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84d3e7b9
    • David S. Miller's avatar
      [TCP]: Move send test logic out of net/tcp.h · f6302d1d
      David S. Miller authored
      
      
      This just moves the code into tcp_output.c, no code logic changes are
      made by this patch.
      
      Using this as a baseline, we can begin to untangle the mess of
      comparisons for the Nagle test et al.  We will also be able to reduce
      all of the redundant computation that occurs when outputting data
      packets.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f6302d1d
    • David S. Miller's avatar
      [TCP]: Fix quick-ack decrementing with TSO. · fc6415bc
      David S. Miller authored
      
      
      On each packet output, we call tcp_dec_quickack_mode()
      if the ACK flag is set.  It drops tp->ack.quick until
      it hits zero, at which time we deflate the ATO value.
      
      When doing TSO, we are emitting multiple packets with
      ACK set, so we should decrement tp->ack.quick that many
      segments.
      
      Note that, unlike this case, tcp_enter_cwr() should not
      take the tcp_skb_pcount(skb) into consideration.  That
      function, one time, readjusts tp->snd_cwnd and moves
      into TCP_CA_CWR state.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fc6415bc