public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: "Kaigai Kohei" <kaigai@ak.jp.nec.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] Kernel panic on IA-64 Linux with SELinux
Date: Tue, 15 Jun 2004 02:28:14 +0000	[thread overview]
Message-ID: <006f01c45280$69c3aee0$f97d220a@linux.bs1.fc.nec.co.jp> (raw)
In-Reply-To: <013f01c44ddb$636d4aa0$f97d220a@linux.bs1.fc.nec.co.jp>

Hello, everyone.

David Mosbeger wrote:

> You're probably right.
> 
> We _could_ do something like this in init_task.c:
> 
> void
> initialize_init_task (void)
> {
> *current = (task_t) INIT_TASK((*current));
> }
> 
> and then call this function from setup_arch().
> 
> The code does compile but doesn't seem to work.  I suspect there are
> other lists that are inconsistent now.  Anybody want to track this
> down?

I have applied this patch to 2.6.6 kernel, and system stall occurred
while booting up. The problem is in init_mount_tree().
The init_mount_tree() function uses do_each_thread() macro
defined as follows:

#define do_each_thread(g, t) \
        for (g = t = &init_task ; (g = t = next_task(g)) != &init_task ; ) do

The termination condition of this loop is g->tasks.next equals &init_task.
But g->tasks.next will not refer to &init_task forever,
because the init_task.task list_head was initialized as the data structure
in region 7 in spite of &init_task was in region 5.

There are similer problems
(The condition of the loop termination depends on &init_task).
- do_each_process() macro       ... in include/linux/sched.h
- is_devfsd_or_child() function ... in fs/devfs/base.c
- get_tgid_list() function      ... in fs/proc/base.c

There are several solutions against this problem.
(1) Initializing only wait_chldexit as my first patch.
(2) Moving current of swapper from region 7 to region 5 as
    Miyoshi's second patch.
(3) Replacing &init_task with task_t *p_init_task which refers to
    init_task in region 7, and refers to init_task directly on other archtectures.

(1) is easy but ad hoc. (3) needs to correct generic code.
(2) is consistent on &init_task is in region 5 and current(r13) for cpu_idle
 refers to region 5. But the number of steps in switch_to() macro will increase. 
 This overhead is not a big problem, I guess.

For reasons already stated I prefer (2). What do you think?

Best Regards, 
--------
Kaigai Kohei, Linux Promotion Center, NEC
E-mail: kaigai@ak.jp.nec.com

  parent reply	other threads:[~2004-06-15  2:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-09  4:36 [PATCH] Kernel panic on IA-64 Linux with SELinux 
2004-06-09 14:40 ` Kazuto MIYOSHI
2004-06-09 21:55 ` David Mosberger
2004-06-09 22:44 ` Luck, Tony
2004-06-09 23:25 ` David Mosberger
2004-06-09 23:35 ` Luck, Tony
2004-06-10  0:58 ` David Mosberger
2004-06-10  5:19 ` Luck, Tony
2004-06-10  5:23 ` David Mosberger
2004-06-10  5:28 ` Luck, Tony
2004-06-15  2:28 ` Kaigai Kohei [this message]
2004-06-15  4:17 ` Luck, Tony
2004-06-15  4:23 ` David Mosberger
2004-06-15  4:25 ` Luck, Tony
2004-06-15  4:25 ` David Mosberger
2004-06-15  9:37 ` Kaigai Kohei
2004-06-15 12:52 ` Kaigai Kohei
2004-06-17  1:10 ` David Mosberger
     [not found] <Xine.LNX.4.44.0406101657420.8385-100000@thoron.boston.redhat.com>
2004-06-11  1:13 ` Kaigai Kohei

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='006f01c45280$69c3aee0$f97d220a@linux.bs1.fc.nec.co.jp' \
    --to=kaigai@ak.jp.nec.com \
    --cc=linux-ia64@vger.kernel.org \
    /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