15 Jan, 2008

1 commit

  • Commit 84427eaef1fb91704c7112bdb598c810003b99f3 (remove task_ppid_nr_ns)
    moved the task_tgid_nr_ns(task->real_parent) outside of lock_task_sighand().
    This is wrong, ->real_parent could be freed/reused.

    Both ->parent/real_parent point to nothing after __exit_signal() because
    we remove the child from ->children list, and thus the child can't be
    reparented when its parent exits.

    rcu_read_lock() protects ->parent/real_parent, but _only_ if we know it was
    valid before we take rcu lock.

    Revert this part of the patch.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

14 Jan, 2008

1 commit

  • task_ppid_nr_ns is called in three places. One of these should never
    have called it. In the other two, using it broke the existing
    semantics. This was presumably accidental. If the function had not
    been there, it would have been much more obvious to the eye that those
    patches were changing the behavior. We don't need this function.

    In task_state, the pid of the ptracer is not the ppid of the ptracer.

    In do_task_stat, ppid is the tgid of the real_parent, not its pid.
    I also moved the call outside of lock_task_sighand, since it doesn't
    need it.

    In sys_getppid, ppid is the tgid of the real_parent, not its pid.

    Signed-off-by: Roland McGrath
    Signed-off-by: Linus Torvalds

    Roland McGrath
     

27 Nov, 2007

1 commit

  • Srivatsa Vaddagiri noticed occasionally incorrect CPU usage
    values in top and tracked it down to stime going below 0 in
    task_stime(). Negative values are possible there due to the
    sampled nature of stime/utime.

    Fix suggested by Balbir Singh.

    Signed-off-by: Ingo Molnar
    Tested-by: Srivatsa Vaddagiri
    Reviewed-by: Balbir Singh

    Ingo Molnar
     

30 Oct, 2007

2 commits


20 Oct, 2007

5 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
    sched: fix guest time accounting going faster than user time accounting

    Linus Torvalds
     
  • tsk->exit_state can only be 0, EXIT_ZOMBIE, or EXIT_DEAD. A non-zero test
    is the same as tsk->exit_state & (EXIT_ZOMBIE | EXIT_DEAD), so just testing
    tsk->exit_state is sufficient.

    Signed-off-by: Eugene Teo
    Cc: Roland McGrath
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eugene Teo
     
  • This is the largest patch in the set. Make all (I hope) the places where
    the pid is shown to or get from user operate on the virtual pids.

    The idea is:
    - all in-kernel data structures must store either struct pid itself
    or the pid's global nr, obtained with pid_nr() call;
    - when seeking the task from kernel code with the stored id one
    should use find_task_by_pid() call that works with global pids;
    - when showing pid's numerical value to the user the virtual one
    should be used, but however when one shows task's pid outside this
    task's namespace the global one is to be used;
    - when getting the pid from userspace one need to consider this as
    the virtual one and use appropriate task/pid-searching functions.

    [akpm@linux-foundation.org: build fix]
    [akpm@linux-foundation.org: nuther build fix]
    [akpm@linux-foundation.org: yet nuther build fix]
    [akpm@linux-foundation.org: remove unneeded casts]
    Signed-off-by: Pavel Emelyanov
    Signed-off-by: Alexey Dobriyan
    Cc: Sukadev Bhattiprolu
    Cc: Oleg Nesterov
    Cc: Paul Menage
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     
  • The set of functions process_session, task_session, process_group and
    task_pgrp is confusing, as the names can be mixed with each other when looking
    at the code for a long time.

    The proposals are to
    * equip the functions that return the integer with _nr suffix to
    represent that fact,
    * and to make all functions work with task (not process) by making
    the common prefix of the same name.

    For monotony the routines signal_session() and set_signal_session() are
    replaced with task_session_nr() and set_task_session(), especially since they
    are only used with the explicit task->signal dereference.

    Signed-off-by: Pavel Emelianov
    Acked-by: Serge E. Hallyn
    Cc: Kirill Korotaev
    Cc: "Eric W. Biederman"
    Cc: Cedric Le Goater
    Cc: Herbert Poetzl
    Cc: Sukadev Bhattiprolu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelianov
     
  • cputime_add already adds, dont do it twice.

    Signed-off-by: Christian Borntraeger
    Signed-off-by: Ingo Molnar

    Christian Borntraeger
     

15 Oct, 2007

1 commit


23 Aug, 2007

1 commit

  • Fix the accounting regression for CONFIG_VIRT_CPU_ACCOUNTING. It
    reverts parts of commit b27f03d4bdc145a09fb7b0c0e004b29f1ee555fa by
    converting fs/proc/array.c back to cputime_t. The new functions
    task_utime and task_stime now return cputime_t instead of clock_t. If
    CONFIG_VIRT_CPU_ACCOUTING is set, task->utime and task->stime are
    returned directly instead of using sum_exec_runtime.

    Patch is tested on s390x with and without VIRT_CPU_ACCOUTING as well as
    on i386.

    [ mingo@elte.hu: cleanups, comments. ]

    Signed-off-by: Christian Borntraeger
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar

    Christian Borntraeger
     

17 Jul, 2007

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
    [PATCH] sched: fix up fs/proc/array.c whitespace problems
    [PATCH] sched: prettify prio_to_wmult[]
    [PATCH] sched: document prio_to_wmult[]
    [PATCH] sched: improve weight-array comments
    [PATCH] sched: remove dead code from task_stime()

    Fixed up trivial conflict in fs/proc/array.c

    Linus Torvalds
     
  • Make available to the user the following task and process performance
    statistics:

    * Involuntary Context Switches (task_struct->nivcsw)
    * Voluntary Context Switches (task_struct->nvcsw)

    Statistics information is available from:
    1. taskstats interface (Documentation/accounting/)
    2. /proc/PID/status (task only).

    This data is useful for detecting hyperactivity patterns between processes.

    [akpm@linux-foundation.org: cleanup]
    Signed-off-by: Maxim Uvarov
    Cc: Shailabh Nagar
    Cc: Balbir Singh
    Cc: Jay Lan
    Cc: Jonathan Lim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Maxim Uvarov
     
  • Commit 411187fb05cd11676b0979d9fbf3291db69dbce2 caused boot time to move and
    process start times to become invalid after suspend. Using boot based time
    for those restores the old behaviour and fixes the issue.

    [akpm@linux-foundation.org: little cleanup]
    Signed-off-by: Tomas Janousek
    Cc: Tomas Smetana
    Acked-by: John Stultz
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tomas Janousek
     

16 Jul, 2007

2 commits


10 Jul, 2007

2 commits


09 May, 2007

1 commit

  • This past week I was playing around with that pahole tool
    (http://oops.ghostprotocols.net:81/acme/dwarves/) and looking at the size
    of various struct in the kernel. I was surprised by the size of the
    task_struct on x86_64, approaching 4K. I looked through the fields in
    task_struct and found that a number of them were declared as "unsigned
    long" rather than "unsigned int" despite them appearing okay as 32-bit
    sized fields. On x86_64 "unsigned long" ends up being 8 bytes in size and
    forces 8 byte alignment. Is there a reason there a reason they are
    "unsigned long"?

    The patch below drops the size of the struct from 3808 bytes (60 64-byte
    cachelines) to 3760 bytes (59 64-byte cachelines). A couple other fields
    in the task struct take a signficant amount of space:

    struct thread_struct thread; 688
    struct held_lock held_locks[30]; 1680

    CONFIG_LOCKDEP is turned on in the .config

    [akpm@linux-foundation.org: fix printk warnings]
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    William Cohen
     

13 Feb, 2007

1 commit

  • Of kernel subsystems that work with pids the tty layer is probably the largest
    consumer. But it has the nice virtue that the assiation with a session only
    lasts until the session leader exits. Which means that no reference counting
    is required. So using struct pid winds up being a simple optimization to
    avoid hash table lookups.

    In the long term the use of pid_nr also ensures that when we have multiple pid
    spaces mixed everything will work correctly.

    Signed-off-by: Eric W. Biederman
    Cc: Alan Cox
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

09 Dec, 2006

2 commits


02 Oct, 2006

3 commits

  • task_state() needs tasklist_lock to protect ->parent/->real_parent. However
    task->parent points to nowhere only when the actions below happen in order

    1) release_task(task)
    2) release_task(task->parent)
    3) a grace period passed

    But 3) implies that the memory ops from 1) should be finished, so pid_alive()
    can't be true in such a case.

    Otherwise, we don't care if ->parent/->real_parent changes under us.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Drop tasklist_lock. ->siglock protects almost all interesting data
    (including sub-threads traversal) except:

    ->signal->tty
    protected by tty_mutex

    ->real_parent
    the task can't be unhashed while we are holding
    ->siglock, so ->real_parent can change from under us
    but we can safely dereference it under rcu_read_lock()

    ->pgrp/->session
    we can get inconsistent numbers if the task does
    sys_setsid/daemonize at the same time. I hope this
    is acceptable.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • lock_task_sighand() can take ->siglock without holding tasklist_lock.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

30 Sep, 2006

1 commit


15 Jul, 2006

1 commit

  • Export I/O delays seen by a task through /proc//stats for use in top
    etc.

    Note that delays for I/O done for swapping in pages (swapin I/O) is clubbed
    together with all other I/O here (this is not the case in the netlink
    interface where the swapin I/O is kept distinct)

    [akpm@osdl.org: printk warning fix]
    Signed-off-by: Shailabh Nagar
    Signed-off-by: Balbir Singh
    Cc: Jes Sorensen
    Cc: Peter Chubb
    Cc: Erich Focht
    Cc: Levent Serinol
    Cc: Jay Lan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shailabh Nagar
     

01 Jul, 2006

1 commit


27 Mar, 2006

1 commit


11 Jan, 2006

1 commit


07 Jan, 2006

1 commit

  • Sanitize some s390 Kconfig options. We have ARCH_S390, ARCH_S390X,
    ARCH_S390_31, 64BIT, S390_SUPPORT and COMPAT. Replace these 6 options by
    S390, 64BIT and COMPAT.

    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Schwidefsky
     

30 Oct, 2005

1 commit

  • I was lazy when we added anon_rss, and chose to change as few places as
    possible. So currently each anonymous page has to be counted twice, in rss
    and in anon_rss. Which won't be so good if those are atomic counts in some
    configurations.

    Change that around: keep file_rss and anon_rss separately, and add them
    together (with get_mm_rss macro) when the total is needed - reading two
    atomics is much cheaper than updating two atomics. And update anon_rss
    upfront, typically in memory.c, not tucked away in page_add_anon_rmap.

    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     

18 Sep, 2005

1 commit

  • With the new fdtable locking rules, you have to protect fdtable with either
    ->file_lock or rcu_read_lock/unlock(). There are some places where we
    aren't doing either. This patch fixes those places.

    Signed-off-by: Dipankar Sarma
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dipankar Sarma
     

10 Sep, 2005

1 commit

  • In order for the RCU to work, the file table array, sets and their sizes must
    be updated atomically. Instead of ensuring this through too many memory
    barriers, we put the arrays and their sizes in a separate structure. This
    patch takes the first step of putting the file table elements in a separate
    structure fdtable that is embedded withing files_struct. It also changes all
    the users to refer to the file table using files_fdtable() macro. Subsequent
    applciation of RCU becomes easier after this.

    Signed-off-by: Dipankar Sarma
    Signed-Off-By: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dipankar Sarma
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds