Skip to content

Commit

Permalink
clone: prepare to recycle CLONE_STOPPED
Browse files Browse the repository at this point in the history
Ulrich says that we never used this clone flags and that nothing should be
using it.

As we're down to only a single bit left in clone's flags argument, let's add a
warning to check that no userspace is actually using it.  Hopefully we will
be able to recycle it.

Roland said:

  CLONE_STOPPED was previously used by some NTPL versions when under
  thread_db (i.e.  only when being actively debugged by gdb), but not for a
  long time now, and it never worked reliably when it was used.  Removing it
  seems fine to me.

[akpm@linux-foundation.org: it looks like CLONE_DETACHED is being used]
Cc: Ulrich Drepper <drepper@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Feb 5, 2008
1 parent 59714d6 commit bdff746
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,23 @@ long do_fork(unsigned long clone_flags,
int trace = 0;
long nr;

/*
* We hope to recycle these flags after 2.6.26
*/
if (unlikely(clone_flags & CLONE_STOPPED)) {
static int __read_mostly count = 100;

if (count > 0 && printk_ratelimit()) {
char comm[TASK_COMM_LEN];

count--;
printk(KERN_INFO "fork(): process `%s' used deprecated "
"clone flags 0x%lx\n",
get_task_comm(comm, current),
clone_flags & CLONE_STOPPED);
}
}

if (unlikely(current->ptrace)) {
trace = fork_traceflag (clone_flags);
if (trace)
Expand Down

0 comments on commit bdff746

Please sign in to comment.