Date: Wed, 17 Jun 2020 13:46:05 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362276 - stable/12/sys/compat/linux Message-ID: <202006171346.05HDk5AF096920@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Wed Jun 17 13:46:05 2020 New Revision: 362276 URL: https://svnweb.freebsd.org/changeset/base/362276 Log: MFC r362037: Fix a couple of nits in Linux sysinfo(2) emulation. Modified: stable/12/sys/compat/linux/linux_misc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_misc.c ============================================================================== --- stable/12/sys/compat/linux/linux_misc.c Wed Jun 17 13:27:13 2020 (r362275) +++ stable/12/sys/compat/linux/linux_misc.c Wed Jun 17 13:46:05 2020 (r362276) @@ -131,8 +131,8 @@ struct l_sysinfo { l_ulong freeswap; /* swap space still available */ l_ushort procs; /* Number of current processes */ l_ushort pads; - l_ulong totalbig; - l_ulong freebig; + l_ulong totalhigh; + l_ulong freehigh; l_uint mem_unit; char _f[20-2*sizeof(l_long)-sizeof(l_int)]; /* padding */ }; @@ -164,7 +164,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ LINUX_SYSINFO_LOADS_SCALE / averunnable.fscale; sysinfo.totalram = physmem * PAGE_SIZE; - sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE; + sysinfo.freeram = (u_long)vm_free_count() * PAGE_SIZE; /* * sharedram counts pages allocated to named, swap-backed objects such @@ -181,9 +181,13 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ sysinfo.procs = nprocs; - /* The following are only present in newer Linux kernels. */ - sysinfo.totalbig = 0; - sysinfo.freebig = 0; + /* + * Platforms supported by the emulation layer do not have a notion of + * high memory. + */ + sysinfo.totalhigh = 0; + sysinfo.freehigh = 0; + sysinfo.mem_unit = 1; return (copyout(&sysinfo, args->info, sizeof(sysinfo)));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006171346.05HDk5AF096920>