Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2012C4332F for ; Wed, 4 Jan 2023 17:56:32 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.96) (envelope-from ) id 1pD7zu-0001z7-2p; Wed, 04 Jan 2023 12:56:18 -0500 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1pCmNO-0007rl-0V for kernelnewbies@kernelnewbies.org; Tue, 03 Jan 2023 13:51:06 -0500 Received: by mail-lf1-x12d.google.com with SMTP id z26so46903473lfu.8 for ; Tue, 03 Jan 2023 10:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=F03iF+3Z6TbbBlSfooXBsNuWl5f1t7VyaXlzzFUJIBw=; b=O3m4rj+a5UL4PHFTr6Fpbh9tSCcCcqa6SAGKjFwtrszBDuForPCTbRlYWjrD+GeCVA vrKkmOjeMsAh2dW75qPrmShyNpKEXHWrGCoVxqZV2Y2bkHXoEYFPqPYqIU1TwBJ7Esw1 EQ58Ct7S7gkfggN4S1ehj5i8azDW2MIVgnpydMv41WWtBS/5g4ZjpIO2m1qBA2bIp8g/ tKXDYZ9jojyFXljZ3uNlPyQh79AC5uOfRhIdFBsNhPHE6FDsdukQ1kZLhvyD8bWBi/9h EwdgXE3YAyTGGCBx0WAE3RB+rreOM92A0n8K19PGClyo9w3ecnjoNKbfUJ/xIsMB95yz /LEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=F03iF+3Z6TbbBlSfooXBsNuWl5f1t7VyaXlzzFUJIBw=; b=ZN1AfplgEyAyN5Ewpr7Ba4w3IJBAIkjPMJunBLv19ZldgpScq+ab763RTtBTcTuOF1 avGMS7ZFGlPHN9uGUwJ0MDjAO8vSsUIwrEwJLlBJ8BEHLwdaBhj6eKZIAQausQh2VPr/ qFj770xB3NnO0hhDZkNqbkDE/6v3RyhFnekrnRPc/vdWmu/d0Bmxnk7sE6Lyq2hMlrcD eYIG4JsuhkspLChVdvX28M5qoc/uXAi9iSbwTfNiGnx+sqruZn3wp7SaPHqOf8IPlIIt ZiU9NpU/MURl1Wausj/4XaTFYU7iz0eezcmZR0RmZ3AgRmaB7PK9Zp44LiwXypLxA6QM UJNw== X-Gm-Message-State: AFqh2kogAkQD9DlspC4butrWYQQrU6lqX7xaYGQ8zr5RZZhsVjIEq0Nx QV5f4Dnfhlh9/Ayv+v+KuEckRz+Dfee4 X-Google-Smtp-Source: AMrXdXvzi71gVe/jqxrvkpaIm9Bsy9h0wzG4zPH6AZ1dkCG+pmuwqxJmA9fCFgKZcPRf+6yJfsXd3Q== X-Received: by 2002:ac2:4894:0:b0:4a4:68b8:f4f6 with SMTP id x20-20020ac24894000000b004a468b8f4f6mr10934378lfc.60.1672771864322; Tue, 03 Jan 2023 10:51:04 -0800 (PST) Received: from sqrt.uni.cx (0854358661.static.corbina.ru. [95.31.0.167]) by smtp.gmail.com with ESMTPSA id q25-20020a194319000000b004c57abccb8bsm4901712lfa.102.2023.01.03.10.51.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 10:51:03 -0800 (PST) Date: Tue, 3 Jan 2023 21:51:08 +0300 From: Mikhail Krylov To: kernelnewbies@kernelnewbies.org Subject: Determining the reason for reserved RAM Message-ID: MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 04 Jan 2023 12:56:13 -0500 X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1224577772453770196==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============1224577772453770196== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="W7WHrembcY+8Wb9q" Content-Disposition: inline --W7WHrembcY+8Wb9q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, I was doing some research figuring out what kernel reserves memory for, and found myself in a sort of dead-end. I found out that /proc/kpageflags bit 32 is set for reserved physical pages in include/linux/kernel-page-flags.c, wrote a simple decoder of that file, and on an old 32-bit x86 machine (it's the simplest there, since it has less memory and fewest amount of memory holes) those are reserved: 0x00000000-0x0000ffff - I assume those addresses are used for interrupt vectors and whatnot 0x0009b000-0x000fffff - Video RAM/ROM for VGA/EGA/CGA and whatnot 0x01c00000-0x01c1ffff - no idea, it also has KPF_UNCACHED flag as well 0x1d000000-0x1dd73fff - Kernel code, rodata, rwdata, bss 0x35b4a000-0x36b55fff - no idea. I also found out that region #5 is getting bigger or smaller depending on the machine's memory size. On this 1.5G machine it's a bit more than 16M. On a 32G machine it's more than 500M size, feels a bit wasteful IMO. So my question is, could you tell me where to look for what those regions are and why those regions exist? I've checked /proc/iomem and it doesn't say it is reserved or anything, just "System RAM". Thanks in advance, Mikhail. --W7WHrembcY+8Wb9q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEq9zNqT9shXHTn/gRzNfc0dbmrQAFAmO0eRwACgkQzNfc0dbm rQB2Hwf/ftG8gBLgrcezQRvmDagrzNfQ80kMhTzSExZxSBGg10If1WEnLzlOSVo9 jMkWvnslkIIpjRYDJw+pOoD9m+MugLrrvZIYZxS62z4m3CtEv4Ut+5ZPqhd5NmSr BbUrc1cTyndnKUXXqHBOegdwWATUnyKHGLvFJLIjpu3KNjKYrJNXnZkwBGfih1tg yIh84qywVQSscmvPZF03GMx7q6fO6ZCb6914eRHE2BHPOn7dzZyVdevzKZcm8Vwv ei7DZZUmw/etngVnCAHoSc1uKPt60juG6GhMtoXOJAuvgaeakuAdLvFTYhVLW8+E uAdQ8NDN4d5REZGJX8/outnCG+h1cw== =OiyR -----END PGP SIGNATURE----- --W7WHrembcY+8Wb9q-- --===============1224577772453770196== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============1224577772453770196==--