* xfsprogs/mkfs: what's the relationship between max trans res and min log size
@ 2015-05-18 6:33 Wang Sheng-Hui
2015-05-18 13:34 ` Brian Foster
0 siblings, 1 reply; 3+ messages in thread
From: Wang Sheng-Hui @ 2015-05-18 6:33 UTC (permalink / raw)
To: xfs, Dave Chinner
Hi guys,
In maxtrres.c/max_trans_res, it calls xfs_log_calc_minimum_size to compute the
maximum transaction reservation
But for xfs_log_calc_minimum_size, it's used to calculate the
minimum valid log size
The naming max/minimum seems confusing.
Why are they named in such way? What's the relationship between max trans res
and minimun log size, (max trans res) <= (minimun log size)?
Any explanations are welcomed!
Thanks,
Sheng-Hui
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: xfsprogs/mkfs: what's the relationship between max trans res and min log size
2015-05-18 6:33 xfsprogs/mkfs: what's the relationship between max trans res and min log size Wang Sheng-Hui
@ 2015-05-18 13:34 ` Brian Foster
2015-05-18 23:28 ` Wang Sheng-Hui
0 siblings, 1 reply; 3+ messages in thread
From: Brian Foster @ 2015-05-18 13:34 UTC (permalink / raw)
To: Wang Sheng-Hui; +Cc: Dave Chinner, xfs
On Mon, May 18, 2015 at 02:33:06PM +0800, Wang Sheng-Hui wrote:
> Hi guys,
>
>
> In maxtrres.c/max_trans_res, it calls xfs_log_calc_minimum_size to compute the
> maximum transaction reservation
>
> But for xfs_log_calc_minimum_size, it's used to calculate the
> minimum valid log size
>
>
> The naming max/minimum seems confusing.
>
> Why are they named in such way? What's the relationship between max trans res
> and minimun log size, (max trans res) <= (minimun log size)?
>
>
> Any explanations are welcomed!
>
>From the comment in xfs_log_calc_minimum_size():
/*
* Two factors should be taken into account for calculating the minimum
* log space.
* 1) The fundamental limitation is that no single transaction can be
* larger than half size of the log.
*
* From mkfs.xfs, this is considered by the XFS_MIN_LOG_FACTOR
* define, which is set to 3. That means we can definitely fit
* maximally sized 2 transactions in the log. We'll use this same
* value here.
...
*/
So the log must be at least the size of two single transactions (it
looks like the code is conservative and uses a factor of 3). This is a
limitation on the minimum allowable log size for the fs. Transactions
are of variable size, so to determine what that means in terms of actual
size we must calculate the maximum possible (i.e., worst case)
transaction size for the particular fs geometry and then use that to
calculate the minimum total log size.
Brian
>
> Thanks,
> Sheng-Hui
>
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: xfsprogs/mkfs: what's the relationship between max trans res and min log size
2015-05-18 13:34 ` Brian Foster
@ 2015-05-18 23:28 ` Wang Sheng-Hui
0 siblings, 0 replies; 3+ messages in thread
From: Wang Sheng-Hui @ 2015-05-18 23:28 UTC (permalink / raw)
To: Brian Foster; +Cc: Dave Chinner, xfs
On 2015年05月18日 21:34, Brian Foster wrote:
> On Mon, May 18, 2015 at 02:33:06PM +0800, Wang Sheng-Hui wrote:
>> Hi guys,
>>
>>
>> In maxtrres.c/max_trans_res, it calls xfs_log_calc_minimum_size to compute the
>> maximum transaction reservation
>>
>> But for xfs_log_calc_minimum_size, it's used to calculate the
>> minimum valid log size
>>
>>
>> The naming max/minimum seems confusing.
>>
>> Why are they named in such way? What's the relationship between max trans res
>> and minimun log size, (max trans res) <= (minimun log size)?
>>
>>
>> Any explanations are welcomed!
>>
>
>>From the comment in xfs_log_calc_minimum_size():
>
> /*
> * Two factors should be taken into account for calculating the minimum
> * log space.
> * 1) The fundamental limitation is that no single transaction can be
> * larger than half size of the log.
> *
> * From mkfs.xfs, this is considered by the XFS_MIN_LOG_FACTOR
> * define, which is set to 3. That means we can definitely fit
> * maximally sized 2 transactions in the log. We'll use this same
> * value here.
> ...
> */
>
> So the log must be at least the size of two single transactions (it
> looks like the code is conservative and uses a factor of 3). This is a
> limitation on the minimum allowable log size for the fs. Transactions
> are of variable size, so to determine what that means in terms of actual
> size we must calculate the maximum possible (i.e., worst case)
> transaction size for the particular fs geometry and then use that to
> calculate the minimum total log size.
Thanks, Brian.
Regards,
Sheng-Hui
>
> Brian
>
>>
>> Thanks,
>> Sheng-Hui
>>
>>
>> _______________________________________________
>> xfs mailing list
>> xfs@oss.sgi.com
>> http://oss.sgi.com/mailman/listinfo/xfs
>
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-18 23:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-18 6:33 xfsprogs/mkfs: what's the relationship between max trans res and min log size Wang Sheng-Hui
2015-05-18 13:34 ` Brian Foster
2015-05-18 23:28 ` Wang Sheng-Hui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox