From: Catalin BOIE <util@deuroconsult.ro>
To: Jamie Lokier <jamie@shareable.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: idt change in a running kernel? what locking?
Date: Mon, 6 Oct 2003 08:12:10 +0300 (EEST) [thread overview]
Message-ID: <Pine.LNX.4.58.0310060810440.26313@hosting.rdsbv.ro> (raw)
In-Reply-To: <20031003170210.GA18415@mail.shareable.org>
Thanks again!
On Fri, 3 Oct 2003, Jamie Lokier wrote:
> Catalin BOIE wrote:
> > > It's more likely, you want to use get_cpu()/put_cpu() to prevent the
> > > current kernel thread from being pre-empted to a different CPU.
> > get_cpu locks the thread on a CPU until put_cpu?
>
> Yes, it disables preemption.
> Taking any spinlock will do it too.
>
> > > If you are intending to change idt on all CPUs, you'll need something
> > > more complicated.
> >
> > Hm. I realized that on a SMP it's a little hard to do it.
> > How can I change that on all cpus?
> > There is something to use that i can force my code to run on a specific
> > cpu?
>
> on_each_cpu() will call a function on each CPU. Be careful that the
> function is safe in the contexts in which it will be called.
>
> If you just want to force you code to run on one cpu, that is
> automatic if you are holding a spinlock (but then you can't schedule,
> return to userspace etc.)
>
> In general you can fix a task to a cpu using set_cpus_allowed().
>
> -- Jamie
>
What I realy want is to reload idt on every cpu.
So, probably on_each_cpu is the way to go, right?
---
Catalin(ux) BOIE
catab@deuroconsult.ro
next prev parent reply other threads:[~2003-10-06 5:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-03 5:52 Catalin BOIE
2003-10-03 6:34 ` Jamie Lokier
2003-10-03 6:52 ` Catalin BOIE
2003-10-03 17:02 ` Jamie Lokier
2003-10-06 5:12 ` Catalin BOIE [this message]
2003-10-06 17:07 ` Jamie Lokier
2003-10-07 4:35 ` Catalin BOIE
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=Pine.LNX.4.58.0310060810440.26313@hosting.rdsbv.ro \
--to=util@deuroconsult.ro \
--cc=jamie@shareable.org \
--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
all inboxes | Powered by JetHome®