From nobody Sun Feb 26 09:44:01 2023 X-Original-To: emulation@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 4PPdxZ1b8qz3t7VF for ; Sun, 26 Feb 2023 09:44:02 +0000 (UTC) (envelope-from bugzilla-noreply@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 4PPdxY5Llxz4NT0 for ; Sun, 26 Feb 2023 09:44:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677404641; 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: in-reply-to:in-reply-to:references:references; bh=LANHQpH8AXXqDD0J0rs/ZBGt0SMPfEos5uijp17ukYg=; b=beVsaDQSBz4n9dGxyp3XZ/NFtxktymVveGG5QIV9oRs16cKYBA9dyfRQCvh2sIZZqgds5B 7/KG2CM+Aoh1uqpfSI0rDiMMAeMHmv0bRq1N+vPJfdWm0JJENMRR69B78d4t5O/QFuMT2E z/yl5GPYDSEC9v2JwamlNCljSa6ejlv4ch3xCQes62HVfpcUjM1a6wldDX6HObHdqIpZUz FhpVhFDyFGjareh/1GEl0IGhPk184zmvHI83yDq+i4sTx96I06TjSVdFHTh4sw9jhX9Zu3 qiNw6adc538YdO1Cl2I1hryTBjGbwMJH2VPBTn4McZMJkOmWntYuhWqnpNAaBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677404641; a=rsa-sha256; cv=none; b=iRCx4rTFCPPF5B44McS1L+I12tI+zObCT0MEjYw6kDosdA3PqK+sbPt5+40Nokg5QqXk7+ wD0b20ezO7Cp/cWHb9XV0e2ATjL4sgHjO1llEwOJbNETetKltfJZ3sw7FdXQtVT2AC62S3 zTSaNmCDpQVjRbgWHcbH8AhIAQG6zNtL6irS9c0XeCzTVJqRvvJsIXllxA2Q4GiuFUMidY Mw1Io32Vs5tg1YuekiBk4xElD2ev7auKoZ9WyjenT10Hv2JamDE+tJGjCWcBxGW8wApUd5 8Z0pjwrlwJA9QVSXC1AEwBRlZ97u0zGF7RTz3uXqVFRjtbcIWHpf2kTQr6V9hg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4PPdxY46swzgmG for ; Sun, 26 Feb 2023 09:44:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 31Q9i1Co099993 for ; Sun, 26 Feb 2023 09:44:01 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 31Q9i1mn099992 for emulation@FreeBSD.org; Sun, 26 Feb 2023 09:44:01 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: emulation@FreeBSD.org Subject: [Bug 265937] [Linuxulator]: linprocfs: process size incorrect Date: Sun, 26 Feb 2023 09:44:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: fernape@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: emulation@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Development of Emulators of other operating systems List-Archive: https://lists.freebsd.org/archives/freebsd-emulation List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-emulation@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265937 Fernando Apestegu=C3=ADa changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fernape@FreeBSD.org --- Comment #3 from Fernando Apestegu=C3=ADa --- Created attachment 240417 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D240417&action= =3Dedit Remove P2K when printing ki_size in 'stat' file I can confirm. This is what I see in my Ubuntu system: fernape~ cat /proc/1993/stat 1993 (gnome-session-b) S 1990 1990 1990 1026 1990 4194304 1726 5624 2 6 4 2= 6 2 20 0 3 0 9929 --->230969344<--- 3912 18446744073709551615 94683959459840 94683959602729 140731149451200 0 0 0 0 4096 16386 0 0 0 17 0 0 0 0 0 0 94683959675184 94683959689872 94683990056960 140731149454254 140731149454305 140731149454305 140731149455318 0 fernape~ cat /proc/1993/status | grep VmSize VmSize: 225556 kB <--- fernape~ cat /proc/1993/statm 56389 <--- 3912 3485 35 0 4481 0 According to https://www.kernel.org/doc/html/latest/filesystems/proc.html, = the three marked values should be the same, but in different units: status is in kB statm is in pages stat is in bytes Let's see if they check out: In status, we have 225556 kb divided by 4 (since my pages in Ubuntu are 4 kB each) gives me 56389 pages and if I multiply by 4046 bytes in each page, we= get the 230969344 bytes in the 'stat' file. This is what I see in current for my fluxbox process in the linprocfs: fernape@hammer:~$ grep VmSize /compat/linux/proc/1549/status=20 VmSize: 24708 kB fernape@hammer:~$ cat /compat/linux/proc/1549/statm 6177 2884 0 208 36 5932 0 fernape@hammer:~$ cut -f23 -d' ' /compat/linux/proc/1549/stat 101203968 This does not check out: 24708 kb bytes =3D 6177 pages (I have 4 kb pages) = =3D 25300992 bytes, not the 101203968 reported by 'stat'. It is, in effect, exa= ctly 4 times higher. With the attached patch, the result is the expected one: fernape@hammer:~$ grep VmSize /compat/linux/proc/1470/status=20 VmSize: 24708 kB fernape@hammer:~$ cut -f23 -d' ' /compat/linux/proc/1470/stat 25300992 <--- This is now 24708 * 1024 fernape@hammer:~$ cat /compat/linux/proc/1470/statm 6177 2810 0 208 36 5932 0 <--- This is still 24708/4 --=20 You are receiving this mail because: You are the assignee for the bug.=