1. 13 2月, 2007 5 次提交
    • E
      [PATCH] pid: replace is_orphaned_pgrp with is_current_pgrp_orphaned · 3e7cd6c4
      Eric W. Biederman 提交于
      Every call to is_orphaned_pgrp passed in process_group(current) which is racy
      with respect to another thread changing our process group.  It didn't bite us
      because we were dealing with integers and the worse we would get would be a
      stale answer.
      
      In switching the checks to use struct pid to be a little more efficient and
      prepare the way for pid namespaces this race became apparent.
      
      So I simplified the calls to the more specialized is_current_pgrp_orphaned so
      I didn't have to worry about making logic changes to avoid the race.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3e7cd6c4
    • E
      [PATCH] pid: make session_of_pgrp use struct pid instead of pid_t · 04a2e6a5
      Eric W. Biederman 提交于
      To properly implement a pid namespace I need to deal exclusively in terms of
      struct pid, because pid_t values become ambiguous.
      
      To this end session_of_pgrp is transformed to take and return a struct pid
      pointer.  To avoid the need to worry about reference counting I now require my
      caller to hold the appropriate locks.  Leaving callers repsonsible for
      increasing the reference count if they need access to the result outside of
      the locks.
      
      Since session_of_pgrp currently only has one caller and that caller simply
      uses only test the result for equality with another process group, the locking
      change means I don't actually have to acquire the tasklist_lock at all.
      
      tiocspgrp is also modified to take and release the lock.  The logic there is a
      little more complicated but nothing I won't need when I convert pgrp of a tty
      to a struct pid pointer.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      04a2e6a5
    • E
      [PATCH] tty: fix the locking for signal->session in disassociate_ctty · 2ea81868
      Eric W. Biederman 提交于
      commit 24ec839c while fixing the locking for
      signal->tty got the locking wrong for signal->session.  This places our
      accesses of signal->session back under the tasklist_lock where they belong.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2ea81868
    • E
      [PATCH] tty: clarify disassociate_ctty · 680a9671
      Eric W. Biederman 提交于
      The code to look at tty_old_pgrp and send SIGHUP and SIGCONT when it is
      present only executes when disassociate_ctty is called from do_exit.  Make
      this clear by adding an explict on_exit check, and explicitly setting
      tty_old_pgrp to 0.
      
      In addition fix the locking by reading tty_old_pgrp under the siglock.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      680a9671
    • E
      [PATCH] tty: make __proc_set_tty static · cdc62330
      Eric W. Biederman 提交于
      The aim of this patch set is to start wrapping up the struct pid conversions.
      As such this patchset culminates with the removal of kill_pg, kill_pg_info,
      __kill_pg_info, do_each_task_pid, and while_each_task_pid.
      
      kill_proc, daemonize, and kernel_thread are still in my sights but there is
      still work to get to them.
      
      The first three are basic cleanups around disassociate_ctty, while working on
      converting it I found several issues.  tty_old_pgrp can be a tricky concept to
      wrap your head around.
      
       1 tty: Make __proc_set_tty static.
       2 tty: Clarify disassociate_ctty
       3 tty: Fix the locking for signal->session in disassociate_ctty
      
      These just stop using the old helper functions.
      
       4 signal: Use kill_pgrp not kill_pg in the sunos compatibility code.
       5 signal: Rewrite kill_something_info so it uses newer helpers.
      
      Then the grind to convert the tty layer and all of it's helper functions to
      struct pid.
      
       6 pid: Make session_of_pgrp use struct pid instead of pid_t.
       7 pid: Use struct pid for talking about process groups in exit.c
       8 pid: Replace is_orphaned_pgrp with is_current_pgrp_orphaned
       9 tty: Update the tty layer to work with struct pid.
      
      A final helper function update.
      
      10 pid: Replace do/while_each_task_pid with do/while_each_pid_task
      
      And the removal of the functions that are now unused.
      11 pid: Remove now unused do_each_task_pid and while_each_task_pid
      12 pid: Remove the now unused kill_pg kill_pg_info and __kill_pg_info
      
      All of these should be fairly simple and to the point.
      
      This patch:
      
      Currently all users of __proc_set_tty are in tty_io.c so make the function
      static.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cdc62330
  2. 12 2月, 2007 3 次提交
  3. 14 12月, 2006 2 次提交
  4. 09 12月, 2006 5 次提交
  5. 02 12月, 2006 1 次提交
  6. 22 11月, 2006 2 次提交
    • D
      WorkStruct: Pass the work_struct pointer instead of context data · 65f27f38
      David Howells 提交于
      Pass the work_struct pointer to the work function rather than context data.
      The work function can use container_of() to work out the data.
      
      For the cases where the container of the work_struct may go away the moment the
      pending bit is cleared, it is made possible to defer the release of the
      structure by deferring the clearing of the pending bit.
      
      To make this work, an extra flag is introduced into the management side of the
      work_struct.  This governs auto-release of the structure upon execution.
      
      Ordinarily, the work queue executor would release the work_struct for further
      scheduling or deallocation by clearing the pending bit prior to jumping to the
      work function.  This means that, unless the driver makes some guarantee itself
      that the work_struct won't go away, the work function may not access anything
      else in the work_struct or its container lest they be deallocated..  This is a
      problem if the auxiliary data is taken away (as done by the last patch).
      
      However, if the pending bit is *not* cleared before jumping to the work
      function, then the work function *may* access the work_struct and its container
      with no problems.  But then the work function must itself release the
      work_struct by calling work_release().
      
      In most cases, automatic release is fine, so this is the default.  Special
      initiators exist for the non-auto-release case (ending in _NAR).
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      65f27f38
    • D
      WorkStruct: Separate delayable and non-delayable events. · 52bad64d
      David Howells 提交于
      Separate delayable work items from non-delayable work items be splitting them
      into a separate structure (delayed_work), which incorporates a work_struct and
      the timer_list removed from work_struct.
      
      The work_struct struct is huge, and this limits it's usefulness.  On a 64-bit
      architecture it's nearly 100 bytes in size.  This reduces that by half for the
      non-delayable type of event.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      52bad64d
  7. 02 10月, 2006 1 次提交
    • J
      [PATCH] const struct tty_operations · b68e31d0
      Jeff Dike 提交于
      As part of an SMP cleanliness pass over UML, I consted a bunch of
      structures in order to not have to document their locking.  One of these
      structures was a struct tty_operations.  In order to const it in UML
      without introducing compiler complaints, the declaration of
      tty_set_operations needs to be changed, and then all of its callers need to
      be fixed.
      
      This patch declares all struct tty_operations in the tree as const.  In all
      cases, they are static and used only as input to tty_set_operations.  As an
      extra check, I ran an i386 allyesconfig build which produced no extra
      warnings.
      
      53 drivers are affected.  I checked the history of a bunch of them, and in
      most cases, there have been only a handful of maintenance changes in the
      last six months.  serial_core.c was the busiest one that I looked at.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Acked-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b68e31d0
  8. 30 9月, 2006 8 次提交
  9. 28 8月, 2006 3 次提交
  10. 04 7月, 2006 2 次提交
  11. 01 7月, 2006 1 次提交
  12. 29 6月, 2006 3 次提交
    • P
      [PATCH] remove active field from tty buffer structure · 33b37a33
      Paul Fulghum 提交于
      Remove 'active' field from tty buffer structure.  This was added in 2.6.16
      as part of a patch to make the new tty buffering SMP safe.  This field is
      unnecessary with the more intelligently written flush_to_ldisc that adds
      receive_room handling.
      
      Removing this field reverts to simpler logic where the tail buffer is
      always the 'active' buffer, which should not be freed by flush_to_ldisc.
      (active == buffer being filled with new data)
      
      The result is simpler, smaller, and faster tty buffer code.
      Signed-off-by: NPaul Fulghum <paulkf@microgate.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      33b37a33
    • P
      [PATCH] add receive_room flow control to flush_to_ldisc · 2c3bb20f
      Paul Fulghum 提交于
      Flush data serially to line discipline in blocks no larger than
      tty->receive_room to avoid losing data if line discipline is busy (such as
      N_TTY operating at high speed on heavily loaded system) or does not accept
      data in large blocks (such as N_MOUSE).
      Signed-off-by: NPaul Fulghum <paulkf@microgate.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      2c3bb20f
    • P
      [PATCH] remove TTY_DONT_FLIP · 817d6d3b
      Paul Fulghum 提交于
      Remove TTY_DONT_FLIP tty flag.  This flag was introduced in 2.1.X kernels
      to prevent the N_TTY line discipline functions read_chan() and
      n_tty_receive_buf() from running at the same time.  2.2.15 introduced
      tty->read_lock to protect access to the N_TTY read buffer, which is the
      only state requiring protection between these two functions.
      
      The current TTY_DONT_FLIP implementation is broken for SMP, and is not
      universally honored by drivers that send data directly to the line
      discipline receive_buf function.
      
      Because TTY_DONT_FLIP is not necessary, is broken in implementation, and is
      not universally honored, it is removed.
      Signed-off-by: NPaul Fulghum <paulkf@microgate.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      817d6d3b
  13. 28 6月, 2006 1 次提交
  14. 27 6月, 2006 3 次提交