All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takao Indoh <indou.takao@soft.fujitsu.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4]Diskdump Update
Date: Mon, 14 Jun 2004 23:20:40 +0900	[thread overview]
Message-ID: <B4C4521AC512CCindou.takao@soft.fujitsu.com> (raw)
In-Reply-To: <A0C44FA7FE6022indou.takao@soft.fujitsu.com>

On Fri, 11 Jun 2004 20:34:01 +0900, Takao Indoh wrote:

>On Thu, 27 May 2004 14:51:34 +0100, Christoph Hellwig wrote:
>
>>> +/******************************** Disk dump ****************************
>>> *******/
>>> +#if defined(CONFIG_DISKDUMP) || defined(CONFIG_DISKDUMP_MODULE)
>>> +#undef  add_timer
>>> +#define add_timer       diskdump_add_timer
>>> +#undef  del_timer_sync
>>> +#define del_timer_sync  diskdump_del_timer
>>> +#undef  del_timer
>>> +#define del_timer       diskdump_del_timer
>>> +#undef  mod_timer
>>> +#define mod_timer       diskdump_mod_timer
>>> +
>>> +#define tasklet_schedule        diskdump_tasklet_schedule
>>> +#endif
>>
>>Yikes.  No way in hell we'll place code like this in drivers. This needs
>>to be handled in common code.
>
>Another approach is insering some codes into the core timer and tasklet
>routines.
>
>For example, 
>
>static inline void add_timer(struct timer_list * timer)
>{
>	if(crashdump_mode())
>		__diskdump_add_timer(timer);
>	else
>		__mod_timer(timer, timer->expires);
>}
>
>But I do not want to make common codes dirty...
>Please let me know more good idea!


I forgot to explain what is problem. At first, I explain how diskdump
writes the system memory to the disk.

disk_dump() in drivers/block/diskdump.c is main routine of diskdump.
It is called from die()/panic().

First, disk_dump() silences system as follows.

	local_save_flags(flags);
	local_irq_disable();
	smp_call_function(freeze_cpu, NULL, 1, 0);

Diskdump disables interrupt and stops other cpus.
Next, after preparing for dump, diskdump starts dumping. Diskdump calls
driver's handler via scis_dump module. Driver's handler writes data to
the disk with polling mode.


What is a problem?  Scsi driver uses timer/tasklet to complete I/O.
But, diskdump disables interrupt, so timer/taslket doesn't work!

The current diskdump uses the following macros to solve this problem.

#define add_timer       diskdump_add_timer
#define del_timer_sync  diskdump_del_timer
#define del_timer       diskdump_del_timer
#define mod_timer       diskdump_mod_timer
#define tasklet_schedule        diskdump_tasklet_schedule

ex.
static inline void diskdump_add_timer(struct timer_list *timer)
{
	if (crashdump_mode())
		_diskdump_add_timer(timer);
	else
		add_timer(timer);
}

It's very easy way. If diskdump is working, timer is registered with
diskdump. Otherwise timer is registered with normal kernel timer. The
timer registered with diskdump is called by diskdump itself during
dumping.

This way is easy but ugly. Another way is add new codes into the core
timer and tasklet routines as I wrote in the previous mail.  I wondered
whether it is possible to insert general-purpose hooks into the timer/
taslket routine.

Please let me know if there is another good idea!


Best Regards,
Takao Indoh

      parent reply	other threads:[~2004-06-14 14:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-11 11:34 [PATCH 0/4]Diskdump Update Takao Indoh
2004-06-11 11:40 ` [PATCH 1/4]Diskdump Update Takao Indoh
2004-06-11 11:50   ` Arjan van de Ven
2004-06-11 13:40     ` Takao Indoh
2004-06-11 15:17       ` Martin J. Bligh
2004-06-14  1:38         ` Takao Indoh
2004-06-14  2:08           ` Martin J. Bligh
2004-06-21  7:59     ` Takao Indoh
2004-06-21  8:01       ` Arjan van de Ven
2004-06-22 10:57         ` Takao Indoh
2004-06-21  8:02       ` Christoph Hellwig
2004-06-11 11:41 ` [PATCH 2/4]Diskdump Update Takao Indoh
2004-06-17 12:49   ` Christoph Hellwig
2004-06-17 13:21     ` Takao Indoh
2004-06-17 13:39       ` Christoph Hellwig
2004-06-22 12:01         ` Takao Indoh
2004-06-22 12:12           ` Christoph Hellwig
2004-06-23  1:47             ` Takao Indoh
2004-06-11 11:42 ` [PATCH 3/4]Diskdump Update Takao Indoh
2004-06-11 11:43 ` [PATCH 4/4]Diskdump Update Takao Indoh
2004-06-14 14:20 ` Takao Indoh [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=B4C4521AC512CCindou.takao@soft.fujitsu.com \
    --to=indou.takao@soft.fujitsu.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.