From: Heiko.Carstens@de.ibm.com
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: CPU attachent and detachment in a running Linux system
Date: Tue, 12 Dec 2000 07:42:29 +0100 [thread overview]
Message-ID: <C12569B3.0024DA06.00@d12mta01.de.ibm.com> (raw)
>> sigp. To synchronize n CPUs one can create n kernel threads and give
>> them a high priority to make sure they will be executed soon (e.g. by
>> setting p->policy to SCHED_RR and p->rt_priority to a very high
>> value). As soon as all CPUs are in synchronized state (with
>> interrupts disabled) the new CPU can be started. But before this can
>> be done there are some other things left to do:
>
>You dont IMHO need to use such a large hammer. We already do similar
sequences
>for tlb invalidation on X86 for example. You can broadcast an
interprocessor
>interrupt and have the other processors set a flag each. You spin until
they
>are all captured, then when you clear the flag they all continue. You just
>need to watch two processors doing it at the same time 8)
Alan,
thanks for your input but I think it won't work this way because the value
of smp_num_cpus needs to be increased by one right before a new cpu gets
started. Then one can imagine the following situation at one of the cpus
that needs to be captured:
read the value of smp_num_cpus;
- interrupt that is intended to capture this cpu -
the value of smp_num_cpus will be increased and the new cpu will be started
by another cpu before this cpu continues with normal operation;
- end of interrupt handling -
do something that relies on the prior read value of smp_num_cpus (which is
now wrong);
The result would be an inconsistency. This problem should not occur if all
cpus would be captured by kernel threads.
I still wonder what you and other people think about the idea of an
interface where the parts of the kernel with per-cpu dependencies should
register two functions...
Best regards,
Heiko
By the way, I changed the subject of your original reply because I sent my
first mail twice (with and without a subject line).
I'm sorry for my own stupidity :)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next reply other threads:[~2000-12-12 7:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-12 6:42 Heiko.Carstens [this message]
2000-12-12 12:32 ` CPU attachent and detachment in a running Linux system Alan Cox
2000-12-15 22:31 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2000-12-21 13:16 Heiko.Carstens
2000-12-18 8:00 Heiko.Carstens
2000-12-18 19:34 ` ferret
2000-12-21 3:21 ` Anton Blanchard
2000-12-11 18:48 Per Jessen
2000-12-11 14:03 Heiko.Carstens
2000-12-11 18:11 ` Matthew D. Pitts
2000-12-11 20:37 ` J . A . Magallon
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=C12569B3.0024DA06.00@d12mta01.de.ibm.com \
--to=heiko.carstens@de.ibm.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@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