From: wli@holomorphy.com
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org, manfred@colorfullife.com, davej@suse.de
Subject: [vm86] [2/2] remove handle_irq_zombies()
Date: Thu, 05 Dec 2002 14:28:20 -0800 [thread overview]
Message-ID: <0212051428.vasbFbfaTddaEcBdrdmcidBaxc3c1afb3769@holomorphy.com> (raw)
In-Reply-To: <0212051428.zaFdjcIa~c7dpasbvdjcrc9dZbEdSaVb3769@holomorphy.com>
This patch, suggested by manfred, removes handle_irq_zombies() and
task_valid(). The procedure of comparing stored task structure
pointers to tasklist elements is incorrect; the task structures
are reused. Reaping the vm86 IRQ's in release_x86_irq() suffices.
===== arch/i386/kernel/vm86.c 1.14 vs edited =====
--- 1.14/arch/i386/kernel/vm86.c Fri Nov 15 14:32:24 2002
+++ edited/arch/i386/kernel/vm86.c Thu Dec 5 11:15:44 2002
@@ -708,23 +708,6 @@
spin_unlock_irqrestore(&irqbits_lock, flags);
}
-static inline int task_valid(struct task_struct *tsk)
-{
- struct task_struct *g, *p;
- int ret = 0;
-
- read_lock(&tasklist_lock);
- do_each_thread(g, p)
- if ((p == tsk) && (p->sig)) {
- ret = 1;
- goto out;
- }
- while_each_thread(g, p);
-out:
- read_unlock(&tasklist_lock);
- return ret;
-}
-
void release_x86_irqs(struct task_struct *task)
{
int i;
@@ -733,17 +716,6 @@
free_vm86_irq(i);
}
-static inline void handle_irq_zombies(void)
-{
- int i;
- for (i=3; i<16; i++) {
- if (vm86_irqs[i].tsk) {
- if (task_valid(vm86_irqs[i].tsk)) continue;
- free_vm86_irq(i);
- }
- }
-}
-
static inline int get_and_reset_irq(int irqnumber)
{
int bit;
@@ -772,7 +744,6 @@
case VM86_REQUEST_IRQ: {
int sig = irqnumber >> 8;
int irq = irqnumber & 255;
- handle_irq_zombies();
if (!capable(CAP_SYS_ADMIN)) return -EPERM;
if (!((1 << sig) & ALLOWED_SIGS)) return -EPERM;
if ( (irq<3) || (irq>15) ) return -EPERM;
@@ -784,7 +755,6 @@
return irq;
}
case VM86_FREE_IRQ: {
- handle_irq_zombies();
if ( (irqnumber<3) || (irqnumber>15) ) return -EPERM;
if (!vm86_irqs[irqnumber].tsk) return 0;
if (vm86_irqs[irqnumber].tsk != current) return -EPERM;
prev parent reply other threads:[~2002-12-05 22:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-05 22:28 [vm86] [1/2] call release_x86_irqs() in release_thread() wli
2002-12-05 22:28 ` wli [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=0212051428.vasbFbfaTddaEcBdrdmcidBaxc3c1afb3769@holomorphy.com \
--to=wli@holomorphy.com \
--cc=davej@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=torvalds@transmeta.com \
/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®