Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
SCSI cache flush will be lack under some circumstances??
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
OHKUBO Katsuhiko  
View profile  
 More options Oct 1 2004, 5:40 am
Newsgroups: fa.linux.kernel
From: OHKUBO Katsuhiko <ohkub...@suri.co.jp>
Date: Fri, 1 Oct 2004 09:40:36 GMT
Local: Fri, Oct 1 2004 5:40 am
Subject: SCSI cache flush will be lack under some circumstances??
Dear developers,

I am using Linux 2.6.8.1 with megaraid card.
At boot time, I saw drive cache type was assumed to be 'write through'.

------
megaraid cmm: 2.20.2.0 (Release Date: Thu Aug 19 09:58:33 EDT 2004)
megaraid: 2.20.3.1 (Release Date: Tue Aug 24 09:43:35 EDT 2004)
megaraid: probe new device 0x1000:0x1960:0x1028:0x0520: bus 1:slot 2:func 0
megaraid: fw version:[3.41] bios version:[1.06]
scsi0 : LSI Logic MegaRAID driver
scsi[0]: scanning scsi channel 0 [Phy 0] for non-raid devices
  Vendor: SDR       Model: GEM318P           Rev: 1
  Type:   Processor                          ANSI SCSI revision: 02
scsi[0]: scanning scsi channel 1 [virtual] for logical drives
  Vendor: MegaRAID  Model: LD0 RAID5 79796R  Rev: 3.41
  Type:   Direct-Access                      ANSI SCSI revision: 02
  Vendor: MegaRAID  Model: LD1 RAID5     4R  Rev: 3.41
  Type:   Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 573022208 512-byte hdwr sectors (293387 MB)
sda: asking for cache data failed
sda: assuming drive cache: write through
...
------

If kernel cannot get cache type, write cache type (sdkp->WCE) is set
to 'write through' mode (=0) in sd_read_cache_type() at drivers/scsi/sd.c.
sdkp->WCE is only reffered in sd_shutdown() to decide
whether SCSI cache flush is necessary or not.
SCSI cache is flushed only at 'write back' mode (sdkp->WCE is 1).

On such behavior, even if I configure my RAID card to 'write back' mode,
Linux kernel assumes it is 'write through' mode because kernel cannot get
write type, so kernel doesn't flush SCSI cache in sd_shutdown().
I think it will be a disk consistency problem.

To avoid such problem, I think write cache type must be assumed to be
'write back' if kernel cannot get write cache type.

--- drivers/scsi/sd.c.old       2004-10-01 17:32:06.000000000 +0900
+++ drivers/scsi/sd.c   2004-10-01 17:32:31.000000000 +0900
@@ -1251,9 +1251,9 @@
        }

 defaults:
-       printk(KERN_ERR "%s: assuming drive cache: write through\n",
+       printk(KERN_ERR "%s: assuming drive cache: write back\n",
               diskname);
-       sdkp->WCE = 0;
+       sdkp->WCE = 1;
        sdkp->RCD = 0;
 }

If RAID card is configured to 'write through' mode, and if kernel assumes
it is 'write back' mode, unnecessary cache flush request (no data to flush)
will be done.

Thanks in advance for any help, OHKUBO Katsuhiko.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ju, Seokmann  
View profile  
 More options Oct 6 2004, 11:17 am
Newsgroups: fa.linux.kernel
From: "Ju, Seokmann" <s...@lsil.com>
Date: Wed, 6 Oct 2004 15:17:56 GMT
Local: Wed, Oct 6 2004 11:17 am
Subject: RE: SCSI cache flush will be lack under some circumstances??
Hi,

There are two different cache involved in your concern.
One is cache in each HDD to enhance write performance of it. The other one
is cache in RAID controller.
When you set cache to 'write back' using utility for RAID controller, it
towards to cache in RAID controller.
So, even though kernel doesn't flush SCSI cache, MegaRAID driver will make
sure data consistency including data on both cache through driver's shutdown
entry-point and F/W that controls each physical disk as well.

I hope this helps you.

Regards,

Seokmann


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »