From: Anders Peter Fugmann <afu@fugmann.dhs.org>
To: linux-kernel@vger.kernel.org
Subject: BH implementation question
Date: Tue, 20 Mar 2001 18:42:01 +0100 [thread overview]
Message-ID: <3AB79669.3060405@fugmann.dhs.org> (raw)
Hi I have a couple of questions to the kernel code.
I have been trying to fully inderstand (and doccument) the changes in
2.4 wrt. Tasklets and softirq's, BH's and task queues.
In my try to understand how it all works, I came across the code:
(linux/kernel/softirq.c: 246)
static void bh_action(unsigned long nr)
{
int cpu = smp_processor_id();
if (!spin_trylock(&global_bh_lock))
goto resched;
if (!hardirq_trylock(cpu))
goto resched_unlock;
if (bh_base[nr])
bh_base[nr]();
hardirq_endlock(cpu);
spin_unlock(&global_bh_lock);
return;
resched_unlock:
spin_unlock(&global_bh_lock);
resched:
mark_bh(nr);
}
Now all of this but the hardirq_trylock(cpu) and hardirq_endlock(cpu)
makes perfectly sence.
Anyone care to explain the what theese lines do.
Secondly.
Is there a reason why to implement a queue (TASKLET_HI) for the old
BH's, instead of just using a single tasklet for all BH administraton.
Would'ent this guarentee that no BH is executed at the same time, and at
the same time reduce code complexity, and remove the global_bh_lock?
TIA
Anders Fugmann
--
Hi. I'm a .signature virus.
Please copy me into your .signature file and help me spread.
reply other threads:[~2001-03-20 17:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3AB79669.3060405@fugmann.dhs.org \
--to=afu@fugmann.dhs.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