1. 31 3月, 2006 16 次提交
  2. 30 3月, 2006 4 次提交
    • H
      IB/mad: RMPP support for additional classes · 618a3c03
      Hal Rosenstock 提交于
      Add RMPP support for additional management classes that support it.
      Also, validate RMPP is consistent with management class specified.
      Signed-off-by: NHal Rosenstock <halr@voltaire.com>
      Signed-off-by: NSean Hefty <sean.hefty@intel.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      618a3c03
    • A
      [PATCH] libata: Simplex and other mode filtering logic · 5444a6f4
      Alan Cox 提交于
      Add a field to the host_set called 'flags' (was host_set_flags changed
      to suit Jeff)
      Add a simplex_claimed field so we can remember who owns the DMA channel
      Add a ->mode_filter() hook to allow drivers to filter modes
      Add docs for mode_filter and set_mode
      Filter according to simplex state
      Filter cable in core
      
      This provides the needed framework to support all the mode rules found
      in the PATA world. The simplex filter deals with 'to spec' simplex DMA
      systems found in older chips. The cable filter avoids duplicating the
      same rules in each chip driver with PATA. Finally the mode filter is
      neccessary because drive/chip combinations have errata that forbid
      certain modes with some drives or types of ATA object.
      
      Drive speed setup remains per channel for now and the filters now use
      the framework Tejun put into place which cleans them up a lot from the
      older libata-pata patches.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      5444a6f4
    • A
      [PATCH] libata: Add ->set_mode hook for odd drivers · e35a9e01
      Alan Cox 提交于
      Some hardware doesn't want the usual mode setup logic running. This
      allows the hardware driver to replace it for special cases in the least
      invasive way possible.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e35a9e01
    • A
      [PATCH] libata: BMDMA handling updates · 4e5ec5db
      Alan Cox 提交于
      This is the minimal patch set to enable the current code to be used with
      a controller following SFF (ie any PATA and early SATA controllers)
      safely without crashes if there is no BMDMA area or if BMDMA is not
      assigned by the BIOS for some reason.
      
      Simplex status is recorded but not acted upon in this change, this isn't
      a problem with the current drivers as none of them are for simplex
      hardware. A following diff will deal with that.
      
      The flags in the probe structure remain ->host_set_flags although Jeff
      asked me to rename them, simply because the rename would break the usual
      Linux rules that old code should break when there are changes. not
      compile and run and then blow up/eat your computer/etc. Renaming this
      later is a trivial exercise once a better name is chosen.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4e5ec5db
  3. 29 3月, 2006 20 次提交
    • A
      [PATCH] powerpc: Remove oprofile spinlock backtrace code · 15e812ad
      Anton Blanchard 提交于
      Remove oprofile spinlock backtrace code now we have proper calltrace
      support. Also make MMCRA sihv and sipr bits a variable since they may
      change in future cpus. Finally, MMCRA should be a 64bit quantity.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      15e812ad
    • B
      [PATCH] powerpc: Add oprofile calltrace support · 6c6bd754
      Brian Rogan 提交于
      Add oprofile calltrace support to powerpc. Disable spinlock backtracing
      now we can use calltrace info.
      
      (Updated to work on both 32bit and 64bit by me).
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      6c6bd754
    • K
      [PATCH] for_each_possible_cpu: powerpc · 0e551954
      KAMEZAWA Hiroyuki 提交于
      for_each_cpu() actually iterates across all possible CPUs.  We've had mistakes
      in the past where people were using for_each_cpu() where they should have been
      iterating across only online or present CPUs.  This is inefficient and
      possibly buggy.
      
      We're renaming for_each_cpu() to for_each_possible_cpu() to avoid this in the
      future.
      
      This patch replaces for_each_cpu with for_each_possible_cpu.
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      0e551954
    • E
      [PATCH] lock PTE before updating it in 440/BookE page fault handler · bab70a4a
      Eugene Surovegin 提交于
      Fix 44x and BookE page fault handler to correctly lock PTE before
      trying to pte_update() it, otherwise this PTE might be swapped out
      after pte_present() check but before pte_uptdate() call, resulting in
      corrupted PTE. This can happen with enabled preemption and low memory
      condition.
      Signed-off-by: NEugene Surovegin <ebs@ebshome.net>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      bab70a4a
    • O
      [PATCH] cleanup __exit_signal->cleanup_sighand path · a7e5328a
      Oleg Nesterov 提交于
      Move 'tsk->sighand = NULL' from cleanup_sighand() to __exit_signal().  This
      makes the exit path more understandable and allows us to do
      cleanup_sighand() outside of ->siglock protected section.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      a7e5328a
    • O
      [PATCH] pids: kill PIDTYPE_TGID · 47e65328
      Oleg Nesterov 提交于
      This patch kills PIDTYPE_TGID pid_type thus saving one hash table in
      kernel/pid.c and speeding up subthreads create/destroy a bit.  It is also a
      preparation for the further tref/pids rework.
      
      This patch adds 'struct list_head thread_group' to 'struct task_struct'
      instead.
      
      We don't detach group leader from PIDTYPE_PID namespace until another
      thread inherits it's ->pid == ->tgid, so we are safe wrt premature
      free_pidmap(->tgid) call.
      
      Currently there are no users of find_task_by_pid_type(PIDTYPE_TGID).
      Should the need arise, we can use find_task_by_pid()->group_leader.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Acked-By: NEric Biederman <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      47e65328
    • O
      [PATCH] move __exit_signal() to kernel/exit.c · 6a14c5c9
      Oleg Nesterov 提交于
      __exit_signal() is private to release_task() now.  I think it is better to
      make it static in kernel/exit.c and export flush_sigqueue() instead - this
      function is much more simple and straightforward.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6a14c5c9
    • O
      [PATCH] rename __exit_sighand to cleanup_sighand · c81addc9
      Oleg Nesterov 提交于
      Cosmetic, rename __exit_sighand to cleanup_sighand and move it close to
      copy_sighand().
      
      This matches copy_signal/cleanup_signal naming, and I think it is easier to
      follow.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Acked-by: N"Paul E. McKenney" <paulmck@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c81addc9
    • O
      [PATCH] copy_process: cleanup bad_fork_cleanup_signal · 6b3934ef
      Oleg Nesterov 提交于
      __exit_signal() does important cleanups atomically under ->siglock.  It is
      also called from copy_process's error path.  This is not good, for example we
      can't move __unhash_process() under ->siglock for that reason.
      
      We should not mix these 2 paths, just look at ugly 'if (p->sighand)' under
      'bad_fork_cleanup_sighand:' label.  For copy_process() case it is sufficient
      to just backout copy_signal(), nothing more.
      
      Again, nobody can see this task yet.  For CLONE_THREAD case we just decrement
      signal->count, otherwise nobody can see this ->signal and we can free it
      lockless.
      
      This patch assumes it is safe to do exit_thread_group_keys() without
      tasklist_lock.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6b3934ef
    • O
      [PATCH] copy_process: cleanup bad_fork_cleanup_sighand · 7001510d
      Oleg Nesterov 提交于
      The only caller of exit_sighand(tsk) is copy_process's error path.  We can
      call __exit_sighand() directly and kill exit_sighand().
      
      This 'tsk' was not yet registered in pid_hash[] or init_task.tasks, it has no
      external references, nobody can see it, and
      
      	IF (clone_flags & CLONE_SIGHAND)
      		At least 'current' has a reference to ->sighand, this
      		means atomic_dec_and_test(sighand->count) can't be true.
      
      	ELSE
      		Nobody can see this ->sighand, this means we can free it
      		without any locking.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Acked-by: N"Paul E. McKenney" <paulmck@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7001510d
    • O
      [PATCH] introduce lock_task_sighand() helper · f63ee72e
      Oleg Nesterov 提交于
      Add lock_task_sighand() helper and converts group_send_sig_info() to use
      it.  Hopefully we will have more users soon.
      
      This patch also removes '!sighand->count' and '!p->usage' checks, I think
      they both are bogus, racy and unneeded (but probably it makes sense to
      restore them as BUG_ON()s).
      
      ->sighand is cleared and it's ->count is decremented in release_task() with
      sighand->siglock held, so it is a bug to have '!p->usage || !->count' after
      we already locked and verified it is the same.  On the other hand, an
      already dead task without ->sighand can have a non-zero ->usage due to
      ptrace, for example.
      
      If we read the stale value of ->sighand we must see the change after
      spin_lock(), because that change was done while holding that same old
      ->sighand.siglock.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f63ee72e
    • O
      [PATCH] convert sighand_cache to use SLAB_DESTROY_BY_RCU · aa1757f9
      Oleg Nesterov 提交于
      This patch borrows a clever Hugh's 'struct anon_vma' trick.
      
      Without tasklist_lock held we can't trust task->sighand until we locked it
      and re-checked that it is still the same.
      
      But this means we don't need to defer 'kmem_cache_free(sighand)'.  We can
      return the memory to slab immediately, all we need is to be sure that
      sighand->siglock can't dissapear inside rcu protected section.
      
      To do so we need to initialize ->siglock inside ctor function,
      SLAB_DESTROY_BY_RCU does the rest.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      aa1757f9
    • O
      [PATCH] pidhash: don't use zero pids · c7c64641
      Oleg Nesterov 提交于
      daemonize() calls set_special_pids(1,1), while init and kernel threads spawned
      from init/main.c:init() run with 0,0 special pids.  This patch changes
      INIT_SIGNALS() so that that they run with ->pgrp == ->session == 1 also.  This
      patch relies on fact that swapper's pid == 1.
      
      Now we have no hashed zero pids in pid_hash[].
      
      User-space visibible change is that now /sbin/init runs with (1,1) special
      pids and becomes a session leader.
      
      Quoting Eric W. Biederman:
      >
      > daemonize consuming pids (1,1) then consumes pgrp 1.  So that when
      > /sbin/init calls setsid() it thinks /sbin/init is a process group
      > leader and setsid() fails.  So /sbin/init wants pgrp 1 session 1
      > but doesn't get it.  I am pretty certain daemonize did not exist so
      > /sbin/init got pgrp 1 session 1 in 2.4.
      >
      > That is the bug that is being fixed.
      >
      > This patch takes things one step farther and essentially calls
      > setsid() for pid == 1 before init is execed.  That is new behavior
      > but it cleans up the kernel as we now do not need to support the
      > case of a process without a process group or a session.
      >
      > The only process that could have possibly cared was /sbin/init
      > and it already calls setsid() because it doesn't want that.
      >
      > If this was going to break anything noticeable the change in behavior
      > from 2.4 to 2.6 would have already done that.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c7c64641
    • O
      [PATCH] pidhash: don't count idle threads · 73b9ebfe
      Oleg Nesterov 提交于
      fork_idle() does unhash_process() just after copy_process().  Contrary,
      boot_cpu's idle thread explicitely registers itself for each pid_type with nr
      = 0.
      
      copy_process() already checks p->pid != 0 before process_counts++, I think we
      can just skip attach_pid() calls and job control inits for idle threads and
      kill unhash_process().  We don't need to cleanup ->proc_dentry in fork_idle()
      because with this patch idle threads are never hashed in
      kernel/pid.c:pid_hash[].
      
      We don't need to hash pid == 0 in pidmap_init().  free_pidmap() is never
      called with pid == 0 arg, so it will never be reused.  So it is still possible
      to use pid == 0 in any PIDTYPE_xxx namespace from kernel/pid.c's POV.
      
      However with this patch we don't hash pid == 0 for PIDTYPE_PID case.  We still
      have have PIDTYPE_PGID/PIDTYPE_SID entries with pid == 0: /sbin/init and
      kernel threads which don't call daemonize().
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      73b9ebfe
    • O
      [PATCH] kill SET_LINKS/REMOVE_LINKS · c97d9893
      Oleg Nesterov 提交于
      Both SET_LINKS() and SET_LINKS/REMOVE_LINKS() have exactly one caller, and
      these callers already check thread_group_leader().
      
      This patch kills theese macros, they mix two different things: setting
      process's parent and registering it in init_task.tasks list.  Callers are
      updated to do these actions by hand.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c97d9893
    • O
      [PATCH] remove add_parent()'s parent argument · 8fafabd8
      Oleg Nesterov 提交于
      add_parent(p, parent) is always called with parent == p->parent, and it makes
      no sense to do it differently.  This patch removes this argument.
      
      No changes in affected .o files.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8fafabd8
    • E
      [PATCH] pidhash: kill switch_exec_pids · d73d6529
      Eric W. Biederman 提交于
      switch_exec_pids is only called from de_thread by way of exec, and it is
      only called when we are exec'ing from a non thread group leader.
      
      Currently switch_exec_pids gives the leader the pid of the thread and
      unhashes and rehashes all of the process groups.  The leader is already in
      the EXIT_DEAD state so no one cares about it's pids.  The only concern for
      the leader is that __unhash_process called from release_task will function
      correctly.  If we don't touch the leader at all we know that
      __unhash_process will work fine so there is no need to touch the leader.
      
      For the task becomming the thread group leader, we just need to give it the
      pid of the old thread group leader, add it to the task list, and attach it
      to the session and the process group of the thread group.
      
      Currently de_thread is also adding the task to the task list which is just
      silly.
      
      Currently the only leader of __detach_pid besides detach_pid is
      switch_exec_pids because of the ugly extra work that was being
      performed.
      
      So this patch removes switch_exec_pids because it is doing too much, it is
      creating an unnecessary special case in pid.c, duing work duplicated in
      de_thread, and generally obscuring what it is going on.
      
      The necessary work is added to de_thread, and it seems to be a little
      clearer there what is going on.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Kirill Korotaev <dev@sw.ru>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d73d6529
    • E
      [PATCH] Remove dead kill_sl prototype from sched.h · 6c99c5cb
      Eric W. Biederman 提交于
      The kill_sl function doesn't exist in the kernel so a prototype is completely
      unnecessary.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6c99c5cb
    • H
      [INET]: Introduce tunnel4/tunnel6 · d2acc347
      Herbert Xu 提交于
      Basically this patch moves the generic tunnel protocol stuff out of
      xfrm4_tunnel/xfrm6_tunnel and moves it into the new files of tunnel4.c
      and tunnel6 respectively.
      
      The reason for this is that the problem that Hugo uncovered is only
      the tip of the iceberg.  The real problem is that when we removed the
      dependency of ipip on xfrm4_tunnel we didn't really consider the module
      case at all.
      
      For instance, as it is it's possible to build both ipip and xfrm4_tunnel
      as modules and if the latter is loaded then ipip simply won't load.
      
      After considering the alternatives I've decided that the best way out of
      this is to restore the dependency of ipip on the non-xfrm-specific part
      of xfrm4_tunnel.  This is acceptable IMHO because the intention of the
      removal was really to be able to use ipip without the xfrm subsystem.
      This is still preserved by this patch.
      
      So now both ipip/xfrm4_tunnel depend on the new tunnel4.c which handles
      the arbitration between the two.  The order of processing is determined
      by a simple integer which ensures that ipip gets processed before
      xfrm4_tunnel.
      
      The situation for ICMP handling is a little bit more complicated since
      we may not have enough information to determine who it's for.  It's not
      a big deal at the moment since the xfrm ICMP handlers are basically
      no-ops.  In future we can deal with this when we look at ICMP caching
      in general.
      
      The user-visible change to this is the removal of the TUNNEL Kconfig
      prompts.  This makes sense because it can only be used through IPCOMP
      as it stands.
      
      The addition of the new modules shouldn't introduce any problems since
      module dependency will cause them to be loaded.
      
      Oh and I also turned some unnecessary pskb's in IPv6 related to this
      patch to skb's.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d2acc347
    • D
      [NET]: deinline 200+ byte inlines in sock.h · f0088a50
      Denis Vlasenko 提交于
      Sizes in bytes (allyesconfig, i386) and files where those inlines
      are used:
      
      238 sock_queue_rcv_skb 2.6.16/net/x25/x25_in.o
      238 sock_queue_rcv_skb 2.6.16/net/rose/rose_in.o
      238 sock_queue_rcv_skb 2.6.16/net/packet/af_packet.o
      238 sock_queue_rcv_skb 2.6.16/net/netrom/nr_in.o
      238 sock_queue_rcv_skb 2.6.16/net/llc/llc_sap.o
      238 sock_queue_rcv_skb 2.6.16/net/llc/llc_conn.o
      238 sock_queue_rcv_skb 2.6.16/net/irda/af_irda.o
      238 sock_queue_rcv_skb 2.6.16/net/ipx/af_ipx.o
      238 sock_queue_rcv_skb 2.6.16/net/ipv6/udp.o
      238 sock_queue_rcv_skb 2.6.16/net/ipv6/raw.o
      238 sock_queue_rcv_skb 2.6.16/net/ipv4/udp.o
      238 sock_queue_rcv_skb 2.6.16/net/ipv4/raw.o
      238 sock_queue_rcv_skb 2.6.16/net/ipv4/ipmr.o
      238 sock_queue_rcv_skb 2.6.16/net/econet/econet.o
      238 sock_queue_rcv_skb 2.6.16/net/econet/af_econet.o
      238 sock_queue_rcv_skb 2.6.16/net/bluetooth/sco.o
      238 sock_queue_rcv_skb 2.6.16/net/bluetooth/l2cap.o
      238 sock_queue_rcv_skb 2.6.16/net/bluetooth/hci_sock.o
      238 sock_queue_rcv_skb 2.6.16/net/ax25/ax25_in.o
      238 sock_queue_rcv_skb 2.6.16/net/ax25/af_ax25.o
      238 sock_queue_rcv_skb 2.6.16/net/appletalk/ddp.o
      238 sock_queue_rcv_skb 2.6.16/drivers/net/pppoe.o
      
      276 sk_receive_skb 2.6.16/net/decnet/dn_nsp_in.o
      276 sk_receive_skb 2.6.16/net/dccp/ipv6.o
      276 sk_receive_skb 2.6.16/net/dccp/ipv4.o
      276 sk_receive_skb 2.6.16/net/dccp/dccp_ipv6.o
      276 sk_receive_skb 2.6.16/drivers/net/pppoe.o
      
      209 sk_dst_check 2.6.16/net/ipv6/ip6_output.o
      209 sk_dst_check 2.6.16/net/ipv4/udp.o
      209 sk_dst_check 2.6.16/net/decnet/dn_nsp_out.o
      
      Large inlines with multiple callers:
      Size  Uses Wasted Name and definition
      ===== ==== ====== ================================================
        238   21   4360 sock_queue_rcv_skb    include/net/sock.h
        109   10    801 sock_recv_timestamp   include/net/sock.h
        276    4    768 sk_receive_skb        include/net/sock.h
         94    8    518 __sk_dst_check        include/net/sock.h
        209    3    378 sk_dst_check  include/net/sock.h
        131    4    333 sk_setup_caps include/net/sock.h
        152    2    132 sk_stream_alloc_pskb  include/net/sock.h
        125    2    105 sk_stream_writequeue_purge    include/net/sock.h
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f0088a50