public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* write back cache and barriers
@ 2006-07-28 19:45 calembour
  2006-07-30  3:52 ` Eric Sandeen
  0 siblings, 1 reply; 5+ messages in thread
From: calembour @ 2006-07-28 19:45 UTC (permalink / raw)
  To: xfs


Hi,
I don't have a deep knowledge about filesystems and I've few experiences
with 
raid configuration, so I need someone who can answer some questions about 
write back cache and barriers.

I have two sata hd (sda, sdb) configured in bios-raid 0 and relative device 
created by dmraid on boot (nvidia_ihfaaicb).

(1) what should I do to know if the write back cache is enabled or not ?
(2) if the write cache is enabled on both sda and sdb this mean that is
enabled 
also on the raid device (/dev/mapper/nvidia_ihfaaicb) ?
(3) how should I do to enable/disable the write cache on the raid device ?

If I try mounting a xfs filesystem I get a message like "barriers are not 
supported by this device" but if I mount a ext3 or a reiserfs filesystem 
respectively with options barrier=1 and barrier=flush they don't complain.
If I mount the reiserfs I explicity get a message like "using barriers".
So who tells the truth ?? 

(4) is there a way to know if the raid device supports barrier or not ?
(5) is there a (not dangerous) test I can do to figure out if barriers are 
really enabled and used with ext3 and reiserfs filesystems ?

Thanks for reading the message
Marco
-- 
View this message in context: http://www.nabble.com/write-back-cache-and-barriers-tf2017234.html#a5545990
Sent from the Xfs - General forum at Nabble.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: write back cache and barriers
  2006-07-28 19:45 write back cache and barriers calembour
@ 2006-07-30  3:52 ` Eric Sandeen
  2006-08-01 11:30   ` calembour
  2006-08-06  9:00   ` Martin Steigerwald
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Sandeen @ 2006-07-30  3:52 UTC (permalink / raw)
  To: calembour; +Cc: xfs

calembour wrote:
> Hi,
> I don't have a deep knowledge about filesystems and I've few experiences
> with 
> raid configuration, so I need someone who can answer some questions about 
> write back cache and barriers.
> 
> I have two sata hd (sda, sdb) configured in bios-raid 0 and relative device 
> created by dmraid on boot (nvidia_ihfaaicb).
> 
> (1) what should I do to know if the write back cache is enabled or not ?

lots of this is in the faq:
http://oss.sgi.com/projects/xfs/faq.html#wcache

> (2) if the write cache is enabled on both sda and sdb this mean that is
> enabled 
> also on the raid device (/dev/mapper/nvidia_ihfaaicb) ?

I'd guess that if there's a write cache anywhere under your device, then in 
effect the raid device would be considered write-cached.

> (3) how should I do to enable/disable the write cache on the raid device ?

see faq

> If I try mounting a xfs filesystem I get a message like "barriers are not 
> supported by this device" but if I mount a ext3 or a reiserfs filesystem 
> respectively with options barrier=1 and barrier=flush they don't complain.
> If I mount the reiserfs I explicity get a message like "using barriers".
> So who tells the truth ?? 

I don't see ext3 or reiser actually checking whether the underlying device 
supports barriers.  xfs does, in xfs_mountfs_check_barriers().

> (4) is there a way to know if the raid device supports barrier or not ?

I'm not sure how barriers interact with multiple devices; perhaps someone else 
can answer....

> (5) is there a (not dangerous) test I can do to figure out if barriers are 
> really enabled and used with ext3 and reiserfs filesystems ?

Dunno :)

-Eric

> Thanks for reading the message
> Marco

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: write back cache and barriers
  2006-07-30  3:52 ` Eric Sandeen
@ 2006-08-01 11:30   ` calembour
  2006-08-06  9:00   ` Martin Steigerwald
  1 sibling, 0 replies; 5+ messages in thread
From: calembour @ 2006-08-01 11:30 UTC (permalink / raw)
  To: xfs


Thanks a lot for your hints

Marco
-- 
View this message in context: http://www.nabble.com/write-back-cache-and-barriers-tf2017234.html#a5592702
Sent from the Xfs - General forum at Nabble.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: write back cache and barriers
  2006-07-30  3:52 ` Eric Sandeen
  2006-08-01 11:30   ` calembour
@ 2006-08-06  9:00   ` Martin Steigerwald
  2006-08-07  2:31     ` Eric Sandeen
  1 sibling, 1 reply; 5+ messages in thread
From: Martin Steigerwald @ 2006-08-06  9:00 UTC (permalink / raw)
  To: linux-xfs

Am Sonntag 30 Juli 2006 05:52 schrieb Eric Sandeen:

> > If I try mounting a xfs filesystem I get a message like "barriers are
> > not supported by this device" but if I mount a ext3 or a reiserfs
> > filesystem respectively with options barrier=1 and barrier=flush they
> > don't complain. If I mount the reiserfs I explicity get a message
> > like "using barriers". So who tells the truth ??
>
> I don't see ext3 or reiser actually checking whether the underlying
> device supports barriers.  xfs does, in xfs_mountfs_check_barriers().

Hello Eric,

for my article I looked at the source code of those. It seems that journal 
block device tests wether barriers work

commit.c:       if (ret == -EOPNOTSUPP && barrier_done) {
commit.c:                       "JBD: barrier-based sync failed on %s - "
commit.c:                       "disabling barriers\n",

Also reiserfs 3 seems to deactivate barriers if not avaible (journal.c)

                if (reiserfs_barrier_flush(p_s_sb)) {
                        int ret;
                        lock_buffer(journal->j_header_bh);
                        ret = submit_barrier_buffer(journal->j_header_bh);
                        if (ret == -EOPNOTSUPP) {
                                set_buffer_uptodate(journal->j_header_bh);
                                disable_barrier(p_s_sb);
                                goto sync;
                        }
                        wait_on_buffer(journal->j_header_bh);
                        check_barrier_completion(p_s_sb, 
journal->j_header_bh);
                } else {

(both sources from kernel 2.6.17.7)

Regards,
-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: write back cache and barriers
  2006-08-06  9:00   ` Martin Steigerwald
@ 2006-08-07  2:31     ` Eric Sandeen
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2006-08-07  2:31 UTC (permalink / raw)
  To: Martin Steigerwald; +Cc: linux-xfs

Martin Steigerwald wrote:

> Hello Eric,
> 
> for my article I looked at the source code of those. It seems that journal 
> block device tests wether barriers work
> 
> commit.c:       if (ret == -EOPNOTSUPP && barrier_done) {
> commit.c:                       "JBD: barrier-based sync failed on %s - "
> commit.c:                       "disabling barriers\n",
> 
> Also reiserfs 3 seems to deactivate barriers if not avaible (journal.c)
> 
>                 if (reiserfs_barrier_flush(p_s_sb)) {
>                         int ret;
>                         lock_buffer(journal->j_header_bh);
>                         ret = submit_barrier_buffer(journal->j_header_bh);
>                         if (ret == -EOPNOTSUPP) {
>                                 set_buffer_uptodate(journal->j_header_bh);
>                                 disable_barrier(p_s_sb);
>                                 goto sync;
>                         }
>                         wait_on_buffer(journal->j_header_bh);
>                         check_barrier_completion(p_s_sb, 
> journal->j_header_bh);
>                 } else {
> 
> (both sources from kernel 2.6.17.7)

Yep, you're right, not quite sure how I missed that...

Thanks,

-Eric

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-07  4:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-28 19:45 write back cache and barriers calembour
2006-07-30  3:52 ` Eric Sandeen
2006-08-01 11:30   ` calembour
2006-08-06  9:00   ` Martin Steigerwald
2006-08-07  2:31     ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox