mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Kirill Korotaev <dev@sw.ru>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Jeff Dike <jdike@addtoit.com>, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 3/3] pidhash: temporal debug checks
Date: Mon, 30 Jan 2006 17:33:58 +0300	[thread overview]
Message-ID: <43DE23D6.2B9DCB5A@tv-sign.ru> (raw)
In-Reply-To: <43DDF351.2EFD1280@tv-sign.ru>

(Rediff after fixing a bug in [PATCH 1/3])

[PATCH 3/3] pidhash: temporal debug checks

This is for testing in -mm tree only. Ensure that we really do
not use pid == 0.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- RC-1/kernel/pid.c~DBG	2006-01-30 14:21:15.000000000 +0300
+++ RC-1/kernel/pid.c	2006-01-30 20:06:35.000000000 +0300
@@ -138,6 +138,7 @@ struct pid * fastcall find_pid(enum pid_
 
 	hlist_for_each_entry_rcu(pid, elem,
 			&pid_hash[type][pid_hashfn(nr)], pid_chain) {
+		WARN_ON(!pid->nr); /* to be removed soon */
 		if (pid->nr == nr)
 			return pid;
 	}
@@ -148,6 +149,9 @@ int fastcall attach_pid(task_t *task, en
 {
 	struct pid *pid, *task_pid;
 
+	WARN_ON(!task->pid); /* to be removed soon */
+	WARN_ON(!nr); /* to be removed soon */
+
 	task_pid = &task->pids[type];
 	pid = find_pid(type, nr);
 	task_pid->nr = nr;
@@ -168,9 +172,11 @@ static fastcall int __detach_pid(task_t 
 	struct pid *pid, *pid_next;
 	int nr = 0;
 
+	WARN_ON(!task->pid); /* to be removed soon */
+
 	pid = &task->pids[type];
 	if (!hlist_unhashed(&pid->pid_chain)) {
-
+		WARN_ON(!pid->nr); /* to be removed soon */
 		if (list_empty(&pid->pid_list)) {
 			nr = pid->nr;
 			hlist_del_rcu(&pid->pid_chain);
--- RC-1/kernel/fork.c~DBG	2006-01-30 19:52:59.000000000 +0300
+++ RC-1/kernel/fork.c	2006-01-30 20:06:22.000000000 +0300
@@ -1211,6 +1211,7 @@ task_t * __devinit fork_idle(int cpu)
 	if (!task)
 		return ERR_PTR(-ENOMEM);
 
+	WARN_ON(task->proc_dentry); /* to be removed soon */
 	REMOVE_LINKS(task);
 	init_idle(task, cpu);

      reply	other threads:[~2006-01-30 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-30 11:06 Oleg Nesterov
2006-01-30 14:33 ` Oleg Nesterov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43DE23D6.2B9DCB5A@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@osdl.org \
    --cc=dev@sw.ru \
    --cc=ebiederm@xmission.com \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®