All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: tail policy question
  2003-11-12 23:23 tail policy question Zhihui Zhang
@ 2003-11-12 12:56 ` Hans Reiser
  2003-11-13 18:34   ` Zhihui Zhang
  2003-11-13 10:27 ` Alex Zarochentsev
  1 sibling, 1 reply; 8+ messages in thread
From: Hans Reiser @ 2003-11-12 12:56 UTC (permalink / raw)
  To: Zhihui Zhang; +Cc: reiserfs-list, vs

Zhihui Zhang wrote:

>Hi,
>
>I spent a little time on Reiser4 tail code and was surprised to find out
>that the default policy given in reiser4.h is ALWAYS_TAIL_ID not
>DEFAULT_TAIL_ID.
>
>/* default tail policy plugin */
>#define REISER4_TAIL_PLUGIN       (ALWAYS_TAIL_ID)
>
>Does this mean Reiser4 always use tails no matter how large a file is by
>default?  I must be wrong somewhere.
>  
>
Umh,  we are often capable of incredible stupidity as a result of 
someone testing some setting and then checking it in by accident.  You 
want the default not the always.

>Anyway, when tails are in use, will they incur more or less performance
>penalty on files using them when compared to ReiserFS V3 (remember that
>-notail mount option is sometimes preferred)? 
>
It is not nearly that bad, but you want the default.

I'll let Saveliev comment further.   Thanks for finding this.


-- 
Hans



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

* tail policy question
@ 2003-11-12 23:23 Zhihui Zhang
  2003-11-12 12:56 ` Hans Reiser
  2003-11-13 10:27 ` Alex Zarochentsev
  0 siblings, 2 replies; 8+ messages in thread
From: Zhihui Zhang @ 2003-11-12 23:23 UTC (permalink / raw)
  To: reiserfs-list

Hi,

I spent a little time on Reiser4 tail code and was surprised to find out
that the default policy given in reiser4.h is ALWAYS_TAIL_ID not
DEFAULT_TAIL_ID.

/* default tail policy plugin */
#define REISER4_TAIL_PLUGIN       (ALWAYS_TAIL_ID)

Does this mean Reiser4 always use tails no matter how large a file is by
default?  I must be wrong somewhere.

Anyway, when tails are in use, will they incur more or less performance
penalty on files using them when compared to ReiserFS V3 (remember that
-notail mount option is sometimes preferred)?  Also, does the offset part
of a key for a tail item or an extent item refer to the byte offset of the
first byte represented by the tail or extent item?  In V3, I remember it
is actually byte offset plus one for some reason.  Please clarify this for
me.

Thanks

-Zhihui

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

* Re: tail policy question
  2003-11-12 23:23 tail policy question Zhihui Zhang
  2003-11-12 12:56 ` Hans Reiser
@ 2003-11-13 10:27 ` Alex Zarochentsev
  1 sibling, 0 replies; 8+ messages in thread
From: Alex Zarochentsev @ 2003-11-13 10:27 UTC (permalink / raw)
  To: Zhihui Zhang; +Cc: reiserfs-list

On Wed, Nov 12, 2003 at 06:23:01PM -0500, Zhihui Zhang wrote:
> Hi,
> 
> I spent a little time on Reiser4 tail code and was surprised to find out
> that the default policy given in reiser4.h is ALWAYS_TAIL_ID not
> DEFAULT_TAIL_ID.
> 
> /* default tail policy plugin */
> #define REISER4_TAIL_PLUGIN       (ALWAYS_TAIL_ID)
> 
> Does this mean Reiser4 always use tails no matter how large a file is by
> default?  

no. tail plugin is specified at mkfs time.  

ALWAIYS_TAIL_ID is used if disk format plugin does not override it at mount
time.  The only one existing disk format (disk_format40) does override the
default tail policy plugin (see
fs/reiser4/plugin/disk_format/disk_format40.c:get_ready_format40).

You can run debugfs.reiser4 -t on a reiser4 volume with some big files and see
extents there. :-)

> I must be wrong somewhere.

> Anyway, when tails are in use, will they incur more or less performance
> penalty on files using them when compared to ReiserFS V3 (remember that
> -notail mount option is sometimes preferred)?  

Tail packing uses more CPU resources than pure extents but it saves I/O
operations.  At current state default tail policy ("smart") is preffered for
most cases (i just do not remember when pure extents win).

But, we still expect that reiser extent handling code may be optimized a lot,
it is possible that pure extents will be better is some case as "notail" option
in reiser3 and even better because extents are better than indirect items).

> Also, does the offset part of a key for a tail item or an extent item refer
> to the byte offset of the first byte represented by the tail or extent item?
> In V3, I remember it is actually byte offset plus one for some reason.
> Please clarify this for

yes, there is a byte offset in the reiser4 key for file body items. AFAIK no
"plus one byte" there.

> me.
> 
> Thanks
> 
> -Zhihui

-- 
Alex.

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

* Re: tail policy question
  2003-11-12 12:56 ` Hans Reiser
@ 2003-11-13 18:34   ` Zhihui Zhang
  2003-11-14 17:06     ` Alex Zarochentsev
  0 siblings, 1 reply; 8+ messages in thread
From: Zhihui Zhang @ 2003-11-13 18:34 UTC (permalink / raw)
  To: Hans Reiser; +Cc: reiserfs-list, vs


Thanks for your and Alex's reply.  I poke around a little bit more and
find out that the mkfs.c does use ITEM_TAIL40_ID, which happens to have
the same value as TAIL_ID (0x6) in the kernel file. However, I am confused
when I see the following in plugin.h:

PLUGIN_BY_ID(item_plugin, REISER4_ITEM_PLUGIN_TYPE, item);
PLUGIN_BY_ID(tail_plugin, REISER4_TAIL_PLUGIN_TYPE, tail);

The item plugin has TAIL_ID if the item is of tail type. So what is the
use of a separate tail_plugin?  Plus, the tail_plugin has three IDs
defined: NEVER, ALWAYS, and DEFAULT, none of which has a value of 0x6. My
guess is that the item plugin for tails are used to manage tails (merge,
split, read, write?), while the tail_plugin is used to decide if a
conversion between tail format and extent format is needed.  If so, the
reiser4.h file should have:

#define REISER4_TAIL_PLUGIN       (DEFAULT_TAIL_ID)

instead of

#define REISER4_TAIL_PLUGIN       (ALWAYS_TAIL_ID)

Does this make sense? Please clarify this for me.  Thanks.

-Zhihui

On Wed, 12 Nov 2003, Hans Reiser wrote:

> Zhihui Zhang wrote:
>
> >Hi,
> >
> >I spent a little time on Reiser4 tail code and was surprised to find out
> >that the default policy given in reiser4.h is ALWAYS_TAIL_ID not
> >DEFAULT_TAIL_ID.
> >
> >/* default tail policy plugin */
> >#define REISER4_TAIL_PLUGIN       (ALWAYS_TAIL_ID)
> >
> >Does this mean Reiser4 always use tails no matter how large a file is by
> >default?  I must be wrong somewhere.
> >
> >
> Umh,  we are often capable of incredible stupidity as a result of
> someone testing some setting and then checking it in by accident.  You
> want the default not the always.
>
> >Anyway, when tails are in use, will they incur more or less performance
> >penalty on files using them when compared to ReiserFS V3 (remember that
> >-notail mount option is sometimes preferred)?
> >
> It is not nearly that bad, but you want the default.
>
> I'll let Saveliev comment further.   Thanks for finding this.
>
>
>

-- 

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

* Re: tail policy question
  2003-11-14 17:06     ` Alex Zarochentsev
@ 2003-11-14  5:12       ` Hans Reiser
  2003-11-14 17:27         ` Alex Zarochentsev
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Reiser @ 2003-11-14  5:12 UTC (permalink / raw)
  To: Alex Zarochentsev; +Cc: Zhihui Zhang, reiserfs-list, vs

Alex Zarochentsev wrote:

>On Thu, Nov 13, 2003 at 01:34:07PM -0500, Zhihui Zhang wrote:
>  
>
>>Thanks for your and Alex's reply.  I poke around a little bit more and
>>find out that the mkfs.c does use ITEM_TAIL40_ID, which happens to have
>>the same value as TAIL_ID (0x6) in the kernel file. 
>>    
>>
>
>they are from different name spaces.
>  
>

>  
>
>>However, I am confused
>>when I see the following in plugin.h:
>>
>>PLUGIN_BY_ID(item_plugin, REISER4_ITEM_PLUGIN_TYPE, item);
>>PLUGIN_BY_ID(tail_plugin, REISER4_TAIL_PLUGIN_TYPE, tail);
>>    
>>
>
>IFAIK above defines service functions for plugins of different types, 
>it does not define concrete plugins. tail_plugin_type should be named
>as tail_policy_plugin for better understanding.
>
>  
>
>>The item plugin has TAIL_ID if the item is of tail type. So what is the
>>use of a separate tail_plugin?  Plus, the tail_plugin has three IDs
>>defined: NEVER, ALWAYS, and DEFAULT, none of which has a value of 0x6. My
>>guess is that the item plugin for tails are used to manage tails (merge,
>>split, read, write?), 
>>    
>>
>
>yes
>
>  
>
>>while the tail_plugin is used to decide if a
>>conversion between tail format and extent format is needed.  If so, the
>>reiser4.h file should have:
>>
>>#define REISER4_TAIL_PLUGIN       (DEFAULT_TAIL_ID)
>>
>>instead of
>>
>>#define REISER4_TAIL_PLUGIN       (ALWAYS_TAIL_ID)
>>
>>Does this make sense? Please clarify this for me.  Thanks.
>>    
>>
>
>what i would like to see:
>rename *_TAIL_ID to *_TAIL_POLICY_ID
>DEFAULT_TAIL_POLICY__ID renamed to SMART_TAIL_POLICY_ID
>  
>
16K_TAIL_POLICY is more informative....

>#define REISER4_TAIL_POLICY_PLUGIN (one of SMART_TAIL_POLICY_ID ALWAYS_TAIL_POLICY_ID,
> NEVER_TAIL_POLICY_ID)
>
>Does it make things more clear?
>
>Thanks.
>  
>


-- 
Hans



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

* Re: tail policy question
  2003-11-14 17:27         ` Alex Zarochentsev
@ 2003-11-14  6:02           ` Hans Reiser
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Reiser @ 2003-11-14  6:02 UTC (permalink / raw)
  To: Alex Zarochentsev; +Cc: Zhihui Zhang, reiserfs-list, vs

Alex Zarochentsev wrote:

>On Thu, Nov 13, 2003 at 09:12:04PM -0800, Hans Reiser wrote:
>  
>
>>Alex Zarochentsev wrote:
>>
>>    
>>
>>>On Thu, Nov 13, 2003 at 01:34:07PM -0500, Zhihui Zhang wrote:
>>>
>>>
>>>      
>>>
>>>>Thanks for your and Alex's reply.  I poke around a little bit more and
>>>>find out that the mkfs.c does use ITEM_TAIL40_ID, which happens to have
>>>>the same value as TAIL_ID (0x6) in the kernel file. 
>>>>  
>>>>
>>>>        
>>>>
>>>they are from different name spaces.
>>>
>>>
>>>      
>>>
>>>      
>>>
>>>>However, I am confused
>>>>when I see the following in plugin.h:
>>>>
>>>>PLUGIN_BY_ID(item_plugin, REISER4_ITEM_PLUGIN_TYPE, item);
>>>>PLUGIN_BY_ID(tail_plugin, REISER4_TAIL_PLUGIN_TYPE, tail);
>>>>  
>>>>
>>>>        
>>>>
>>>IFAIK above defines service functions for plugins of different types, 
>>>it does not define concrete plugins. tail_plugin_type should be named
>>>as tail_policy_plugin for better understanding.
>>>
>>>
>>>
>>>      
>>>
>>>>The item plugin has TAIL_ID if the item is of tail type. So what is the
>>>>use of a separate tail_plugin?  Plus, the tail_plugin has three IDs
>>>>defined: NEVER, ALWAYS, and DEFAULT, none of which has a value of 0x6. My
>>>>guess is that the item plugin for tails are used to manage tails (merge,
>>>>split, read, write?), 
>>>>  
>>>>
>>>>        
>>>>
>>>yes
>>>
>>>
>>>
>>>      
>>>
>>>>while the tail_plugin is used to decide if a
>>>>conversion between tail format and extent format is needed.  If so, the
>>>>reiser4.h file should have:
>>>>
>>>>#define REISER4_TAIL_PLUGIN       (DEFAULT_TAIL_ID)
>>>>
>>>>instead of
>>>>
>>>>#define REISER4_TAIL_PLUGIN       (ALWAYS_TAIL_ID)
>>>>
>>>>Does this make sense? Please clarify this for me.  Thanks.
>>>>  
>>>>
>>>>        
>>>>
>>>what i would like to see:
>>>rename *_TAIL_ID to *_TAIL_POLICY_ID
>>>DEFAULT_TAIL_POLICY__ID renamed to SMART_TAIL_POLICY_ID
>>>
>>>
>>>      
>>>
>>16K_TAIL_POLICY is more informative....
>>    
>>
>
>I think digits cannot be at the first place.
>  
>
TAIL_16k_ID

>  
>
>>>#define REISER4_TAIL_POLICY_PLUGIN (one of SMART_TAIL_POLICY_ID 
>>>ALWAYS_TAIL_POLICY_ID,
>>>NEVER_TAIL_POLICY_ID)
>>>
>>>Does it make things more clear?
>>>
>>>Thanks.
>>>
>>>
>>>      
>>>
>>-- 
>>Hans
>>
>>
>>    
>>
>
>  
>


-- 
Hans



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

* Re: tail policy question
  2003-11-13 18:34   ` Zhihui Zhang
@ 2003-11-14 17:06     ` Alex Zarochentsev
  2003-11-14  5:12       ` Hans Reiser
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Zarochentsev @ 2003-11-14 17:06 UTC (permalink / raw)
  To: Zhihui Zhang; +Cc: Hans Reiser, reiserfs-list, vs

On Thu, Nov 13, 2003 at 01:34:07PM -0500, Zhihui Zhang wrote:
> 
> Thanks for your and Alex's reply.  I poke around a little bit more and
> find out that the mkfs.c does use ITEM_TAIL40_ID, which happens to have
> the same value as TAIL_ID (0x6) in the kernel file. 

they are from different name spaces.

> However, I am confused
> when I see the following in plugin.h:
> 
> PLUGIN_BY_ID(item_plugin, REISER4_ITEM_PLUGIN_TYPE, item);
> PLUGIN_BY_ID(tail_plugin, REISER4_TAIL_PLUGIN_TYPE, tail);

IFAIK above defines service functions for plugins of different types, 
it does not define concrete plugins. tail_plugin_type should be named
as tail_policy_plugin for better understanding.

> 
> The item plugin has TAIL_ID if the item is of tail type. So what is the
> use of a separate tail_plugin?  Plus, the tail_plugin has three IDs
> defined: NEVER, ALWAYS, and DEFAULT, none of which has a value of 0x6. My
> guess is that the item plugin for tails are used to manage tails (merge,
> split, read, write?), 

yes

> while the tail_plugin is used to decide if a
> conversion between tail format and extent format is needed.  If so, the
> reiser4.h file should have:
> 
> #define REISER4_TAIL_PLUGIN       (DEFAULT_TAIL_ID)
> 
> instead of
> 
> #define REISER4_TAIL_PLUGIN       (ALWAYS_TAIL_ID)
> 
> Does this make sense? Please clarify this for me.  Thanks.

what i would like to see:
rename *_TAIL_ID to *_TAIL_POLICY_ID
DEFAULT_TAIL_POLICY__ID renamed to SMART_TAIL_POLICY_ID

#define REISER4_TAIL_POLICY_PLUGIN (one of SMART_TAIL_POLICY_ID ALWAYS_TAIL_POLICY_ID,
 NEVER_TAIL_POLICY_ID)

Does it make things more clear?

Thanks.
-- 
Alex.

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

* Re: tail policy question
  2003-11-14  5:12       ` Hans Reiser
@ 2003-11-14 17:27         ` Alex Zarochentsev
  2003-11-14  6:02           ` Hans Reiser
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Zarochentsev @ 2003-11-14 17:27 UTC (permalink / raw)
  To: Hans Reiser; +Cc: Zhihui Zhang, reiserfs-list, vs

On Thu, Nov 13, 2003 at 09:12:04PM -0800, Hans Reiser wrote:
> Alex Zarochentsev wrote:
> 
> >On Thu, Nov 13, 2003 at 01:34:07PM -0500, Zhihui Zhang wrote:
> > 
> >
> >>Thanks for your and Alex's reply.  I poke around a little bit more and
> >>find out that the mkfs.c does use ITEM_TAIL40_ID, which happens to have
> >>the same value as TAIL_ID (0x6) in the kernel file. 
> >>   
> >>
> >
> >they are from different name spaces.
> > 
> >
> 
> > 
> >
> >>However, I am confused
> >>when I see the following in plugin.h:
> >>
> >>PLUGIN_BY_ID(item_plugin, REISER4_ITEM_PLUGIN_TYPE, item);
> >>PLUGIN_BY_ID(tail_plugin, REISER4_TAIL_PLUGIN_TYPE, tail);
> >>   
> >>
> >
> >IFAIK above defines service functions for plugins of different types, 
> >it does not define concrete plugins. tail_plugin_type should be named
> >as tail_policy_plugin for better understanding.
> >
> > 
> >
> >>The item plugin has TAIL_ID if the item is of tail type. So what is the
> >>use of a separate tail_plugin?  Plus, the tail_plugin has three IDs
> >>defined: NEVER, ALWAYS, and DEFAULT, none of which has a value of 0x6. My
> >>guess is that the item plugin for tails are used to manage tails (merge,
> >>split, read, write?), 
> >>   
> >>
> >
> >yes
> >
> > 
> >
> >>while the tail_plugin is used to decide if a
> >>conversion between tail format and extent format is needed.  If so, the
> >>reiser4.h file should have:
> >>
> >>#define REISER4_TAIL_PLUGIN       (DEFAULT_TAIL_ID)
> >>
> >>instead of
> >>
> >>#define REISER4_TAIL_PLUGIN       (ALWAYS_TAIL_ID)
> >>
> >>Does this make sense? Please clarify this for me.  Thanks.
> >>   
> >>
> >
> >what i would like to see:
> >rename *_TAIL_ID to *_TAIL_POLICY_ID
> >DEFAULT_TAIL_POLICY__ID renamed to SMART_TAIL_POLICY_ID
> > 
> >
> 16K_TAIL_POLICY is more informative....

I think digits cannot be at the first place.

> 
> >#define REISER4_TAIL_POLICY_PLUGIN (one of SMART_TAIL_POLICY_ID 
> >ALWAYS_TAIL_POLICY_ID,
> >NEVER_TAIL_POLICY_ID)
> >
> >Does it make things more clear?
> >
> >Thanks.
> > 
> >
> 
> 
> -- 
> Hans
> 
> 

-- 
Alex.

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

end of thread, other threads:[~2003-11-14 17:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-12 23:23 tail policy question Zhihui Zhang
2003-11-12 12:56 ` Hans Reiser
2003-11-13 18:34   ` Zhihui Zhang
2003-11-14 17:06     ` Alex Zarochentsev
2003-11-14  5:12       ` Hans Reiser
2003-11-14 17:27         ` Alex Zarochentsev
2003-11-14  6:02           ` Hans Reiser
2003-11-13 10:27 ` Alex Zarochentsev

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.