Skip to contentSkip to conversation

fix biosize option

PATCH In review Christoph Hellwig 2 participants 5 messages May 25, 2008 – Aug 28, 2008 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 fix biosize option

iosizelog shouldn't be the same as iosize but the logarithm of it. Then again the current biosize option doesn't make much sense to me as it doesn't set the preferred I/O size as mentioned in the comment next to it but rather the allocation size and thus is identical to the allocsize option (except for the missing logarithm). It's also not documented in Documentation/filesystems/xfs.txt or the mount manpage.

fs/xfs/linux-2.6/xfs_super.c +1 -1
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================
@@ -252,7 +252,7 @@ xfs_parseargs(
 				return EINVAL;
 			}
 			iosize = simple_strtoul(value, &eov, 10);
-			iosizelog = (uint8_t) iosize;
+			iosizelog = ffs(iosize) - 1;
 		} else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) {
 			if (!value || !*value) {
 				cmn_err(CE_WARN,
#1 lore raw

ping?

Quoted 15 lines · Christoph Hellwig

iosizelog shouldn't be the same as iosize but the logarithm of it. Then again the current biosize option doesn't make much sense to me as it doesn't set the preferred I/O size as mentioned in the comment next to it but rather the allocation size and thus is identical to the allocsize option (except for the missing logarithm). It's also not documented in Documentation/filesystems/xfs.txt or the mount manpage.

Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================

fs/xfs/linux-2.6/xfs_super.c xfs_parseargs( · line 258

Quoted 8 lines
fs/xfs/linux-2.6/xfs_super.c +1 -1
@@ -252,7 +252,7 @@ xfs_parseargs(
 				return EINVAL;
 			}
 			iosize = simple_strtoul(value, &eov, 10);
-			iosizelog = (uint8_t) iosize;
+			iosizelog = ffs(iosize) - 1;
 		} else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) {
 			if (!value || !*value) {
 				cmn_err(CE_WARN,

---end quoted text---

#2 lore raw

ping^2?

Quoted 13 lines · Christoph Hellwig

ping?

Quoted 10 lines · Christoph Hellwig

iosizelog shouldn't be the same as iosize but the logarithm of it. Then again the current biosize option doesn't make much sense to me as it doesn't set the preferred I/O size as mentioned in the comment next to it but rather the allocation size and thus is identical to the allocsize option (except for the missing logarithm). It's also not documented in Documentation/filesystems/xfs.txt or the mount manpage.

Quoted 14 lines

fs/xfs/linux-2.6/xfs_super.c xfs_parseargs( · line 258

Quoted 13 lines

Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================

fs/xfs/linux-2.6/xfs_super.c +1 -1
@@ -252,7 +252,7 @@ xfs_parseargs(
 				return EINVAL;
 			}
 			iosize = simple_strtoul(value, &eov, 10);
-			iosizelog = (uint8_t) iosize;
+			iosizelog = ffs(iosize) - 1;
 		} else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) {
 			if (!value || !*value) {
 				cmn_err(CE_WARN,

---end quoted text---

---end quoted text---

#3 lore raw
In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

iosizelog shouldn't be the same as iosize but the logarithm of it. Then again the current biosize option doesn't make much sense to me as it doesn't set the preferred I/O size as mentioned in the comment next to

That's a hold-over from irix - biosize set the basic chunk size the cache used for mapping writes, so was effectively the size of write to use to avoid RMW cycles as well as the unit of delayed allocation.

Quoted 3 lines

it but rather the allocation size and thus is identical to the allocsize option (except for the missing logarithm). It's also not documented in Documentation/filesystems/xfs.txt or the mount manpage.

So when it was first added (probably for compatibility) the allocation part was noticed and not the rest. Maybe we should hook it up to xfs_preferred_iosize() rather than allocation now that it exists...

Apart from that, yes it should be the logarithm, so ACK for this minor mod...

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#4 lore raw
Quoted 10 lines · Dave Chinner
Quoted 3 lines · Christoph Hellwig

iosizelog shouldn't be the same as iosize but the logarithm of it. Then again the current biosize option doesn't make much sense to me as it doesn't set the preferred I/O size as mentioned in the comment next to

That's a hold-over from irix - biosize set the basic chunk size the cache used for mapping writes, so was effectively the size of write to use to avoid RMW cycles as well as the unit of delayed allocation.

Quoted 8 lines
Quoted 3 lines

it but rather the allocation size and thus is identical to the allocsize option (except for the missing logarithm). It's also not documented in Documentation/filesystems/xfs.txt or the mount manpage.

So when it was first added (probably for compatibility) the allocation part was noticed and not the rest. Maybe we should hook it up to xfs_preferred_iosize() rather than allocation now that it exists...

Or just stop making the option have any effect and just print a message that it's ignored..