From: Christoph Hellwig <hch@infradead.org>
To: Takao Indoh <indou.takao@soft.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Christoph Hellwig <hch@infradead.org>, Andi Kleen <ak@muc.de>
Subject: Re: [3/4] [PATCH]Diskdump - yet another crash dump function
Date: Thu, 17 Jun 2004 13:00:20 +0100 [thread overview]
Message-ID: <20040617120020.GA30691@infradead.org> (raw)
In-Reply-To: <C7C4545F11DFBEindou.takao@soft.fujitsu.com>
On Thu, Jun 17, 2004 at 08:34:37PM +0900, Takao Indoh wrote:
> Instead of redefinition, I add hooks into the timer/tasklet routines.
>
> ex.
>
> int mod_timer(struct timer_list *timer, unsigned long expires)
> {
> BUG_ON(!timer->function);
>
> + if (crashdump_mode()) {
> + return diskdump_mod_timer(timer, expires);
> + }
>
> check_timer(timer);
>
> Please see the following patches for details.
> How do you think?
Looks good in principle, some more comments on the actual patch below:
> diff -Nur linux-2.6.6.org/include/linux/diskdumplib.h linux-2.6.6/include/linux/diskdumplib.h
> --- linux-2.6.6.org/include/linux/diskdumplib.h 1970-01-01 09:00:00.000000000 +0900
> +++ linux-2.6.6/include/linux/diskdumplib.h 2004-06-17 18:28:01.000000000 +0900
Should probably just go to linux/dump.h or dump_priv.h
> diff -Nur linux-2.6.6.org/include/linux/interrupt.h linux-2.6.6/include/linux/interrupt.h
> --- linux-2.6.6.org/include/linux/interrupt.h 2004-06-04 21:22:09.000000000 +0900
> +++ linux-2.6.6/include/linux/interrupt.h 2004-06-17 18:28:01.000000000 +0900
> @@ -7,6 +7,7 @@
> #include <linux/linkage.h>
> #include <linux/bitops.h>
> #include <linux/preempt.h>
> +#include <linux/diskdumplib.h>
> #include <asm/atomic.h>
> #include <asm/hardirq.h>
> #include <asm/ptrace.h>
> @@ -172,6 +173,11 @@
>
> static inline void tasklet_schedule(struct tasklet_struct *t)
> {
> + if (crashdump_mode()) {
> + diskdump_tasklet_schedule(t);
> + return;
> + }
> +
> if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
> __tasklet_schedule(t);
> }
Please sprinclde unlikely's all over here. Also the above could be
shortened to
static inline void tasklet_schedule(struct tasklet_struct *t)
{
if (unlikely(crashdump_mode()))
diskdump_tasklet_schedule(t);
else if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
__tasklet_schedule(t);
}
> +int diskdump_schedule_work(struct work_struct *work)
> +{
> + list_add_tail(&work->entry, &diskdump_workq);
> + return 1;
> +}
Should probably just inlined, I guess the function call is bigger
than all of list_add_tail.
> +void diskdump_add_timer(struct timer_list *timer)
> +{
> + timer->base = (void *)1;
> + list_add(&timer->entry, &diskdump_timers);
> +}
dito.
> + /* run timers */
> + list_for_each_safe(t, n, &diskdump_timers) {
> + timer = list_entry(t, struct timer_list, entry);
list_for_each_entry_safe here please.
> @@ -255,6 +255,10 @@
> {
> BUG_ON(!timer->function);
>
> + if (crashdump_mode()) {
> + return diskdump_mod_timer(timer, expires);
> + }
please remove the superflous braces here.
next prev parent reply other threads:[~2004-06-17 12:00 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-27 9:33 [PATCH]Diskdump - yet another crash dump function Takao Indoh
2004-05-27 12:36 ` [1/4] " Takao Indoh
2004-05-27 12:37 ` [2/4] " Takao Indoh
2004-05-27 13:48 ` Christoph Hellwig
2004-05-28 2:13 ` Takao Indoh
2004-05-27 12:39 ` [3/4] " Takao Indoh
2004-05-27 13:51 ` Christoph Hellwig
2004-05-27 21:04 ` Ingo Molnar
2004-06-17 11:34 ` Takao Indoh
2004-06-17 12:00 ` Christoph Hellwig [this message]
2004-06-17 12:45 ` Takao Indoh
2004-06-17 12:13 ` Ingo Molnar
2004-06-17 12:18 ` Christoph Hellwig
2004-06-17 12:32 ` Ingo Molnar
2004-06-17 14:56 ` Jeff Moyer
2004-06-17 15:45 ` Nobuhiro Tachino
2004-06-17 13:04 ` Takao Indoh
2004-06-17 13:10 ` Ingo Molnar
2004-06-17 13:11 ` Ingo Molnar
2004-06-17 13:15 ` Ingo Molnar
2004-06-17 14:00 ` Takao Indoh
2004-06-17 14:45 ` Nobuhiro Tachino
2004-06-17 14:53 ` Takao Indoh
2004-06-18 12:02 ` Takao Indoh
2004-06-21 20:40 ` Nobuhiro Tachino
2004-06-22 10:19 ` Ingo Molnar
2004-06-23 12:11 ` Takao Indoh
2004-06-23 13:00 ` Takao Indoh
2004-06-21 5:46 ` Keith Owens
2004-06-21 6:25 ` Takao Indoh
2004-06-22 4:21 ` Rob Landley
2004-06-22 7:56 ` Ingo Molnar
2004-05-28 9:38 ` Takao Indoh
2004-05-27 12:40 ` [4/4] " Takao Indoh
2004-05-27 13:34 ` [Document][PATCH]Diskdump " Takao Indoh
2004-06-03 13:10 ` [PATCH]Diskdump " Pavel Machek
2004-06-04 0:44 ` Takao Indoh
2004-06-04 9:33 ` Pavel Machek
[not found] <20pwP-55v-5@gated-at.bofh.it>
[not found] ` <20suK-7C5-11@gated-at.bofh.it>
[not found] ` <20tAB-5c-31@gated-at.bofh.it>
[not found] ` <20AiB-69m-17@gated-at.bofh.it>
2004-05-27 21:31 ` [3/4] " Andi Kleen
2004-05-28 7:38 ` Ingo Molnar
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=20040617120020.GA30691@infradead.org \
--to=hch@infradead.org \
--cc=ak@muc.de \
--cc=indou.takao@soft.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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