From nobody Thu Feb 16 11:56:10 2023 X-Original-To: dev-commits-src-all@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 4PHYLg1F6lz3q5g6; Thu, 16 Feb 2023 11:56:11 +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 4PHYLf3gtPz49mN; Thu, 16 Feb 2023 11:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548570; 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=XqNQdDUl2nV0b5QdF5DWriUlaDOrugk75T5xr3LnhyE=; b=kNEHiKX5s0OBxdlYIn+6W6GSy07rrY7t9+DJ/a9lPFw/EQZu6Xh71cgtMJsS7qGWXXkxz8 nHdrqQOQQKF8kwv/QZCRnIQAlJTanHAyV/cZ39v7Q/mFHGPWJsJK+eP6LZZxdy7wmIMffR Uf4KgIuq1ATtLkHAOKBJF6QbH93fSXWB/TIySsgVJh4FGBAXPsReGV9qr4SAQ7NgAWlPeQ sWIPy1zPiM6LXsxsv10rlAw1baPkYOqjfD+cO+jAYdXyEyIAR3jcLltc7iQq4Zf6WLV8A0 yW1EYTcX0ltTEamsQiPtEBx7QEavU/yneS5x6Wh05AgrGJa0rhAuvuube+Y39g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548570; 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=XqNQdDUl2nV0b5QdF5DWriUlaDOrugk75T5xr3LnhyE=; b=udyz4E4dmzcFh5rhwFLq9J26v/NMNVmQ+PAxVMrER4FQspHFroroZ/JwXR9qyW+OEM17GI J87sVR5+6F0nn1UN/brD6/WW4QBPb0ETnPy0C+wS86IyHp1HlCsecRDcVq1lz0iOE3BjI0 hkjHBeRtxIqAddVn8ICAJgMo9b8ViIL+g2zoYsJT1Du6FpIZOqBZWUan6UxdZ8jz9hOC0Q yixCthTapaU2FH3RqJxnzK+7QsUqD0BEBdrYT2Iq3hsAoMH0OWYMAA8gXDkbgbGgZCgkfQ 0Vc19nbbdp6BAnJj22chhNQ2FDa4SWdZ2c8MoUsZWyc17JuiuzDu4gIoBqSo5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676548570; a=rsa-sha256; cv=none; b=wcv+HARdcz3j/kald81P0e1aoR5F51JBZ+rPXVV80D+o+DSDFkPkcZJrRAbZDcbId14x0m 88F/ES1P3/zxoUE8sIkNm8Y1fBn8m9aeKhmNzYIq1aWZQSSn1q1tDSEon1Vu0sA/c8/wPL swEjdB94QIj8r8IeS7upzP/8KSTNlYR6soW6ToPKqwfAyIkjYKG4OYEnm0L9MlB6Z4mukX 0M1uKxUtPAXTHOeNNaOMUwNbQA3aw6wKw2KicZd52zeNVvZ/zJoS98v5zeKCqfF3+Wc+lJ 2tZkrI8d4JjfkDEy/ctq52sYb3R8e/wnxgY4RZjS9r2FrcGiHoue6NnaNLzLjw== 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 4PHYLf2kCvz1353; Thu, 16 Feb 2023 11:56:10 +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 31GBuAxP055713; Thu, 16 Feb 2023 11:56:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GBuAs4055712; Thu, 16 Feb 2023 11:56:10 GMT (envelope-from git) Date: Thu, 16 Feb 2023 11:56:10 GMT Message-Id: <202302161156.31GBuAs4055712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 1b1901620028 - stable/13 - linuxkpi: Add `freeram` and `freehigh` to `struct sysinfo` List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1b1901620028a316e55d907069b85a2f077e6db3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1b1901620028a316e55d907069b85a2f077e6db3 commit 1b1901620028a316e55d907069b85a2f077e6db3 Author: Jean-Sébastien Pédron AuthorDate: 2023-01-02 20:57:35 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-16 11:55:16 +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 (cherry picked from commit e400b695991bf3f336e9cbe39e400943d8b1d676) --- 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 43d1cb0f8aad..be3890edb5cf 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 10172d341e95..a82a8c45be01 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; }