From nobody Mon Jan 30 22:17:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P5MxX010zz3bGbH; Mon, 30 Jan 2023 22:17:36 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P5MxW6fdWz4BGt; Mon, 30 Jan 2023 22:17:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675117055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cCtYEKX3k4TNeIzW3XOg2tkwZFiNysSG1bdEH+BrKBI=; b=gEM/WtvcqT97p3kH4Q52y2pnehfidDtEZU6FxABxHSj2cNoYWP2E0zz0g+1NTt5xJDd8BQ A00/0FqWJvnTDhqrELge3DTSmil7aStjuUQBmZaoQ8ddTfGJ1hoojUL8MIk7r5s0BzgyzA 0QOl2RzLU7koPbNZh7/gCvS4fwNDe8tShO06GAPlqQx08u6MT6jZWvgpCvdET99vS+5IvU UR1aR6Y+Q6QCZ/zmpQfU4rhpc30+h7PAtfjtfkYkslZkbrT+rUHE/mwPcYDruENJXwx58x FJSH2U3quPltWdoajOLUucdE8ede1/IYegnOBbIxDzZAgPr+73jqoeAoXEDNjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675117055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cCtYEKX3k4TNeIzW3XOg2tkwZFiNysSG1bdEH+BrKBI=; b=G85yZuXMMU0D8WzW9zGQGNlCVEoWhbrbOoaas3zz7yfUJnnnXyc+a94sYjH87JfCIhIM3Q v4b+WsCr8E8cQT4RMLa/T6lLpyTGFX2lgRX82IYYzatrVl5eIhQUQ1Ds4rgMkjQr6xyq4N WZi6m20aOrKh4aZwgr4axesTR0hwxfEhGH40nd4EE3aGx/kYEm2O7AcHYsrqYB7EZrXBIG Z9nFSWNDpCMe8jxfWA99zSvC7pyvA/8rYcwJHFik7Sms+qZEmwaYNGUEcrk61+8WW4dDZ8 GrwTrBOkabrsFDgwa2dlugekB4Qk3wYbVPbtwankxkG7JX6x9J38BpSKPh6puQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675117055; a=rsa-sha256; cv=none; b=pEno+ctnhrcOuZ7gIhixcCG4D6faCOuX276Z3i4iG1Sx8SoQoJ18llV4GVqYyhhidn752I U8jAkGId7D2kBXxp3R77wd0qNpW9cHSWIpzvr6tb0+bWDXPGHI8HP5PEYKVBs+pEr3bS4o hU/JbY531GbWA00EDgfnMNEcaHvTUX2yRaZDRp8VGKD39foUNtoWb7BL6XHV53UQZQpwxB bPbZGVx4hhNRWIcVsOOduHWPQdKL3wyEBJaBV/rN/18SFmhkUJ9oS2PTSQ48xmM71J7osd aqgx4LjZYMRt5Jh9h2mUBvD0u/JHioqAhXsilrhowjVM+PbT5neMrSm0vNI9/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P5MxW5hrczQ8D; Mon, 30 Jan 2023 22:17:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30UMHZ7J060220; Mon, 30 Jan 2023 22:17:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30UMHZB1060219; Mon, 30 Jan 2023 22:17:35 GMT (envelope-from git) Date: Mon, 30 Jan 2023 22:17:35 GMT Message-Id: <202301302217.30UMHZB1060219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: e400b695991b - main - linuxkpi: Add `freeram` and `freehigh` to `struct sysinfo` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e400b695991bf3f336e9cbe39e400943d8b1d676 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e400b695991bf3f336e9cbe39e400943d8b1d676 commit e400b695991bf3f336e9cbe39e400943d8b1d676 Author: Jean-Sébastien Pédron AuthorDate: 2023-01-02 20:57:35 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-01-30 22:08:32 +0000 linuxkpi: Add `freeram` and `freehigh` to `struct sysinfo` The struct layout is modified with this commit because new fields are added in the middle, keeping original Linux order. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D37932 --- sys/compat/linuxkpi/common/include/linux/mm.h | 8 +++++--- sys/compat/linuxkpi/common/src/linux_page.c | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 542d0c874b43..c6861cc2acbf 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -144,9 +144,11 @@ struct vm_operations_struct { }; struct sysinfo { - uint64_t totalram; - uint64_t totalhigh; - uint32_t mem_unit; + uint64_t totalram; /* Total usable main memory size */ + uint64_t freeram; /* Available memory size */ + uint64_t totalhigh; /* Total high memory size */ + uint64_t freehigh; /* Available high memory size */ + uint32_t mem_unit; /* Memory unit size in bytes */ }; /* diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index 9b3dac96081f..6fcf9373a2f5 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -79,7 +79,9 @@ void si_meminfo(struct sysinfo *si) { si->totalram = physmem; + si->freeram = vm_free_count(); si->totalhigh = 0; + si->freehigh = 0; si->mem_unit = PAGE_SIZE; }