LKML Archive on lore.kernel.org
 help / color / Atom feed
From: "Ahmed S. Darwish" <darwish.07@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] Tasklets: Avoid duplicating __tasklet_{,hi_}schedule() code
Date: Tue, 19 Feb 2008 17:37:20 +0200
Message-ID: <20080219153720.GA2967@ubuntu> (raw)

Hi all,

Avoid duplicating __tasklet_schedule() and __tasklet_hi_schedule()
code in tasklet_action() and tasklet_hi_action() respectively.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
---

This also saves a few bytes of image space:

   text	   data	    bss	    dec	    hex	filename
   3632	     12	    324	   3968	    f80	softirq.o.before
   3552	     12	    324	   3888	    f30	softirq.o.after

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 5b3aea5..3068dc3 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -414,11 +414,8 @@ static void tasklet_action(struct softirq_action *a)
 			tasklet_unlock(t);
 		}
 
-		local_irq_disable();
-		t->next = __get_cpu_var(tasklet_vec).list;
-		__get_cpu_var(tasklet_vec).list = t;
-		__raise_softirq_irqoff(TASKLET_SOFTIRQ);
-		local_irq_enable();
+		/* We were not lucky enough to run, reschedule. */
+		__tasklet_schedule(t);
 	}
 }
 
@@ -447,11 +444,8 @@ static void tasklet_hi_action(struct softirq_action *a)
 			tasklet_unlock(t);
 		}
 
-		local_irq_disable();
-		t->next = __get_cpu_var(tasklet_hi_vec).list;
-		__get_cpu_var(tasklet_hi_vec).list = t;
-		__raise_softirq_irqoff(HI_SOFTIRQ);
-		local_irq_enable();
+		/* We were not lucky enough to run, reschedule. */
+		__tasklet_hi_schedule(t);
 	}
 }
 

Regards,

-- 
Ahmed S. Darwish
Homepage: http://darwish.07.googlepages.com
Blog: http://darwish-07.blogspot.com


             reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-19 15:37 Ahmed S. Darwish [this message]
2008-02-19 15:52 ` Ingo Molnar
2008-02-19 16:27   ` Ahmed S. Darwish
2008-02-20 10:41     ` Ingo Molnar
2008-02-20 13:37       ` Ahmed S. Darwish
2008-02-20 14:20         ` Dmitry Adamushko
2008-02-20 19:39           ` Ahmed S. Darwish

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=20080219153720.GA2967@ubuntu \
    --to=darwish.07@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lkml.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lkml.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lkml.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lkml.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lkml.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lkml.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lkml.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lkml.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lkml.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lkml.kernel.org/lkml/9 lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lkml.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git