1. 04 Mar, 2008 37 commits
  2. 03 Mar, 2008 3 commits
    • Linus Torvalds's avatar
      Merge branch 'slab-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/christoph/vm · 976dde01
      Linus Torvalds authored
      * 'slab-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/christoph/vm:
        slub: fix possible NULL pointer dereference
        slub: Add kmalloc_large_node() to support kmalloc_node fallback
        slub: look up object from the freelist once
        slub: Fix up comments
        slub: Rearrange #ifdef CONFIG_SLUB_DEBUG in calculate_sizes()
        slub: Remove BUG_ON() from ksize and omit checks for !SLUB_DEBUG
        slub: Use the objsize from the kmem_cache_cpu structure
        slub: Remove useless checks in alloc_debug_processing
        slub: Remove objsize check in kmem_cache_flags()
        slub: rename slab_objects to show_slab_objects
        Revert "unique end pointer" patch
        slab: avoid double initialization & do initialization in 1 place
      976dde01
    • Oleg Nesterov's avatar
      exit_notify: fix kill_orphaned_pgrp() usage with mt exit · 821c7de7
      Oleg Nesterov authored
      1. exit_notify() always calls kill_orphaned_pgrp(). This is wrong, we
         should do this only when the whole process exits.
      
      2. exit_notify() uses "current" as "ignored_task", obviously wrong.
         Use ->group_leader instead.
      
      Test case:
      
      	void hup(int sig)
      	{
      		printf("HUP received\n");
      	}
      
      	void *tfunc(void *arg)
      	{
      		sleep(2);
      		printf("sub-thread exited\n");
      		return NULL;
      	}
      
      	int main(int argc, char *argv[])
      	{
      		if (!fork()) {
      			signal(SIGHUP, hup);
      			kill(getpid(), SIGSTOP);
      			exit(0);
      		}
      
      		pthread_t thr;
      		pthread_create(&thr, NULL, tfunc, NULL);
      
      		sleep(1);
      		printf("main thread exited\n");
      		syscall(__NR_exit, 0);
      
      		return 0;
      	}
      
      output:
      
      	main thread exited
      	HUP received
      	Hangup
      
      With this patch the output is:
      
      	main thread exited
      	sub-thread exited
      	HUP received
      Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      821c7de7
    • Oleg Nesterov's avatar
      will_become_orphaned_pgrp: partially fix insufficient ->exit_state check · 05e83df6
      Oleg Nesterov authored
      p->exit_state != 0 doesn't mean this process is dead, it may have
      sub-threads.  Change the code to use "p->exit_state && thread_group_empty(p)"
      instead.
      
      Without this patch, ^Z doesn't deliver SIGTSTP to the foreground process
      if the main thread has exited.
      
      However, the new check is not perfect either.  There is a window when
      exit_notify() drops tasklist and before release_task().  Suppose that
      the last (non-leader) thread exits.  This means that entire group exits,
      but thread_group_empty() is not true yet.
      
      As Eric pointed out, is_global_init() is wrong as well, but I did not
      dare to do other changes.
      
      Just for the record, has_stopped_jobs() is absolutely wrong too.  But we
      can't fix it now, we should first fix SIGNAL_STOP_STOPPED issues.
      
      Even with this patch ^Z doesn't play well with the dead main thread.
      The task is stopped correctly but do_wait(WSTOPPED) won't see it.  This
      is another unrelated issue, will be (hopefully) fixed separately.
      Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      05e83df6