Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working tunable, i can't set value for zfs_arc_max #415

Open
Vichislitel opened this issue Nov 16, 2024 · 5 comments
Open

Not working tunable, i can't set value for zfs_arc_max #415

Vichislitel opened this issue Nov 16, 2024 · 5 comments

Comments

@Vichislitel
Copy link

bug
bug2

I can't set value for zfs_arc_max . trying use kstat and windows registry.
How i can change it ?
without reboot not working, and after reboot not working.
If i change value in regestry ***\zfs_arc\zfs_arc_max
after reboot PC, value reset to zero.

System information

Kernel Version | windows 11
Architecture | x64
OpenZFS Version | zfswin2.2.6rc10

@lundman
Copy link

lundman commented Nov 20, 2024

The kstat way no longer has any glue connecting it, as we have moved to Registry.

So upstream does do weird things with zfs_arc_max and zfs_arc_min, as they update arc_c_max and arc_c_min respectively, then return to 0 value.
This doesn't quite work for Windows and Registry, as they are 0 for next boot.

Let's think about the right answer for us.

@lundman
Copy link

lundman commented Nov 20, 2024

Hmm no, not sure that is it, I set zfs_arc_max to 0x123456789abcdeff in Registry, but the code:

	Status = ZwQueryValueKey(
	    regfd,
	    &entry,
	    KeyValueFullInformation,
	    buffer,
	    length,
	    &length);

		KEY_VALUE_FULL_INFORMATION *kv =
		    (KEY_VALUE_FULL_INFORMATION *)buffer;

			// Set up buffers to SET value.
			val = &buffer[kv->DataOffset];
			len = kv->DataLength;

Lists val as 0000000000000000. How odd:

dt kv
Local var @ 0xffffcc87fc49a8a8 Type _KEY_VALUE_FULL_INFORMATION*
0xffffbb85`ddf0b640 
   +0x000 TitleIndex       : 0
   +0x004 Type             : 0xb
   +0x008 DataOffset       : 0x30
   +0x00c DataLength       : 8
   +0x010 NameLength       : 0x16
   +0x014 Name             : [1]  "z"
0: kd> dw 0xffffbb85`ddf0b640
ffffbb85`ddf0b640  0000 0000 000b 0000 0030 0000 0008 0000
ffffbb85`ddf0b650  0016 0000 007a 0066 0073 005f 0061 0072
ffffbb85`ddf0b660  0063 005f 006d 0061 0078 6120 7876 2032
ffffbb85`ddf0b670  0000 0000 0000 0000 0000 0002 0000 0000

dt val
Local var @ 0xffffcc87fc49a8f0 Type void*
0xffffbb85`ddf0b670 
Void
0: kd> dw 0xffffbb85`ddf0b670
ffffbb85`ddf0b670  0000 0000 0000 0000 0000 0002 0000 0000

@lundman
Copy link

lundman commented Nov 20, 2024

Ah ok so this is expected, it is due to:

	val = *(uint64_t *)(*ptr);

	if (val != 0 && (val < MIN_ARC_MAX || val <= arc_c_min ||
	    val >= arc_all_memory()))
		return (SET_ERROR(EINVAL));


If you set zfs_arc_max to an invalid amount, it will be ignored, and reset back to 0.
Now, why doesn't survive reboots

@lundman
Copy link

lundman commented Nov 20, 2024

Ah neat, so we read in Registry as one of the first things, before we init SPL, so that Registry can contain tunables for SPL, this means total_memory has not yet been set (Used by arc_all_memory()) so, any value > 0 would fail and zfs_arc_max reset back to 0.

This is addressed in 65ae459

@leonik3
Copy link

leonik3 commented Dec 12, 2024

Hello,
I also have a problem setting the values of the zfs_arc_max and zfs_arc_min parameters. I try to set different values in the parameters and never succeed. After a reboot it always returns to zero.

I have tried such decimal values for example:
1048576 (1024 × 1024 = 1 MiB)
1073741824 (1024 × 1024 * 1024 = 1 GiB)
4294967296 (1024 × 1024 * 1024 * 4 = 4 GiB)
17179869184 (1024 × 1024 * 1024 * 16 = 16 GiB)

What are the possible values?

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants