From owner-svn-src-stable-12@freebsd.org Wed Jun 17 13:46:05 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F185C34F918; Wed, 17 Jun 2020 13:46:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n5v165Xvz3Yhk; Wed, 17 Jun 2020 13:46:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C829621408; Wed, 17 Jun 2020 13:46:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05HDk5Lw096921; Wed, 17 Jun 2020 13:46:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05HDk5AF096920; Wed, 17 Jun 2020 13:46:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006171346.05HDk5AF096920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Jun 2020 13:46:05 +0000 (UTC) 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 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 362276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 13:46:06 -0000 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)));