Skip to content

Commit

Permalink
fix(arc): do not compute free mem anymore
Browse files Browse the repository at this point in the history
we should leave the compute task to the upper caller

Signed-off-by: sundengyu <[email protected]>
  • Loading branch information
sundengyu committed Nov 14, 2024
1 parent 43ad5b7 commit 36a2918
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/libuzfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ extern int libuzfs_object_next_block(libuzfs_inode_handle_t *ihp,
extern void libuzfs_debug_main(int argc, char **argv);

extern void libuzfs_show_stats(void *, int, const seq_file_generator_t *);
extern void libuzfs_config_arc(size_t, size_t, size_t);
extern void libuzfs_config_arc(size_t, size_t);
extern void libuzfs_arc_shrink(size_t);
void libuzfs_wakeup_arc_evictor(void);
#ifdef __cplusplus
Expand Down
4 changes: 1 addition & 3 deletions lib/libuzfs/libuzfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,14 +1004,12 @@ libuzfs_get_data(void *arg, uint64_t gen, lr_write_t *lr, char *buf,

extern unsigned long zfs_arc_max;
extern unsigned long zfs_arc_min;
extern unsigned long zfs_arc_sys_free;

void
libuzfs_config_arc(size_t arc_max, size_t arc_min, size_t sys_reserved)
libuzfs_config_arc(size_t arc_max, size_t arc_min)
{
zfs_arc_min = arc_min;
zfs_arc_max = arc_max;
zfs_arc_sys_free = sys_reserved;
arc_tuning_update(B_FALSE);
}

Expand Down
7 changes: 1 addition & 6 deletions module/os/linux/zfs/arc_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,12 +481,7 @@ arc_shrink(size_t percent)
uint64_t
arc_free_memory(void)
{
struct sysinfo info;
if (sysinfo(&info) == -1) {
return (0);
}

return (info.freeram);
return (UINT64_MAX);
}

void
Expand Down

0 comments on commit 36a2918

Please sign in to comment.