From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11C25C10DCE for ; Fri, 13 Mar 2020 03:55:24 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D0118206E2 for ; Fri, 13 Mar 2020 03:55:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0118206E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1jCbPU-0003sl-30; Thu, 12 Mar 2020 23:54:56 -0400 Received: from omr2.cc.ipv6.vt.edu ([2607:b400:92:8400:0:33:fb76:806e] helo=omr2.cc.vt.edu) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jCbPR-0003sf-Ju for kernelnewbies@kernelnewbies.org; Thu, 12 Mar 2020 23:54:53 -0400 Received: from mr3.cc.vt.edu (mr3.cc.vt.edu [IPv6:2607:b400:92:8500:0:7f:b804:6b0a]) by omr2.cc.vt.edu (8.14.4/8.14.4) with ESMTP id 02D3solT015078 for ; Thu, 12 Mar 2020 23:54:51 -0400 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mr3.cc.vt.edu (8.14.7/8.14.7) with ESMTP id 02D3sjj4031791 for ; Thu, 12 Mar 2020 23:54:50 -0400 Received: by mail-qt1-f199.google.com with SMTP id w1so3782606qte.6 for ; Thu, 12 Mar 2020 20:54:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=CN/0tuaobkP5vM1TiNYXygFnoZC5WRoa/PE6lsO+sMo=; b=tdFIASjh6mbT9eTfVILezADKlRPmT+8f31d/Rr8OuZ8Y94w4yfFRFlI9QgmYzAlfjG xpFY+W35y0FlTjnN0Y57QROBedx3uQMcvCTg4yOk2ihuH/4eLX7aYn7fr6pwVLCqnyn8 Ps2rVo6lBQZdtSG01YAMRJIKhEc3yW5Jxwrx8QrA4K0iLtDGi/AkwaUSAKIub0ZYtS+J uoNPotV/4FQRrbwtNSNLiHVnbZrNUR3d3NVhkjmxEQpzjP/cBwifwl7if5m7sRrxEXyc 87cyb974Ie/whlDv3iJczNyQ+JJW6Op5bplVIFw9svYOB9AP9HTdcifEj9hQChc0JDqA brxA== X-Gm-Message-State: ANhLgQ3n3tOim+VoI78y06pDXq+kmkHDNs9gs5ncgmgj+TAtXjhtN02z N1DbqoUkXoTZaAIjV0X2FT/3cB5zSEoPxMGjILf5Kn6YyxCUTIGYyGAVMiFPOUVW4yLkOjE1Sc3 xwMrCJ89ljk92JZJRBIRfLp5kp20vK2Exs/FOT/E= X-Received: by 2002:a05:620a:c08:: with SMTP id l8mr4374054qki.387.1584071685214; Thu, 12 Mar 2020 20:54:45 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsFx9atmH1WsuUSUbcewH3AWtyjEUDPeO0NwEGFhT3qTz8xHGckm9WmHAD87Mzi69bLVzcIzQ== X-Received: by 2002:a05:620a:c08:: with SMTP id l8mr4374041qki.387.1584071684795; Thu, 12 Mar 2020 20:54:44 -0700 (PDT) Received: from turing-police ([2601:5c0:c001:c9e1::359]) by smtp.gmail.com with ESMTPSA id w1sm13532973qkc.117.2020.03.12.20.54.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 20:54:43 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: kjhg4321@naver.com Subject: Re: Question about the "Dynamic reserved memory" patch In-Reply-To: <957b506c82ba1a9ea95b18fd34b2326e@cweb007.nm.nfra.io> References: <957b506c82ba1a9ea95b18fd34b2326e@cweb007.nm.nfra.io> Mime-Version: 1.0 Date: Thu, 12 Mar 2020 23:54:41 -0400 Message-ID: <374612.1584071681@turing-police> Cc: kernelnewbies@kernelnewbies.org 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="===============1531773936900537805==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============1531773936900537805== Content-Type: multipart/signed; boundary="==_Exmh_1584071681_13328P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1584071681_13328P Content-Type: text/plain; charset=us-ascii On Fri, 13 Mar 2020 12:06:37 +0900, said: > In the __reserved_mem_reserve_reg() function, I found something that > I couldn't easily understand. > > To get help, I sent an e-mail to this mailing list. > if (first) { > fdt_reserved_mem_save_node(node, uname, base, size); > first = 0; > } > I found that fdt_reserved_mem_save_node() is called the regardless of > memblock remove/reserve success. > > I think early_init_dt_reserve_memory_arch() can fail.(ex. for the lack > of memblock's region) > > So I wonder there will be a situation where reserved_mem > initialization will be executed without memory reservation. What you probably missed is that function is wrapped in a #ifdef CONFIG_OF_EARLY_FLATTREE - and is called to read in the OF devicetree data and save it in a form the kernel can use. So there usually shouldn't be a problem in reserving memory early in boot, unless of course somebody bollixed up a devicetree entry and put in bad values for base, size, and nomap. If that happens, the pr_info() call will fire and hopefully notify somebody there's a problem. However, fdt_reserved_mem_save_node() needs to happen anyhow, because that's not initialiing the memory that wasn't actually reserved, it's recording the fact that the devicetree had a reserved memory request in it, and that needs to be remembered because there's a second pass over the devicetree data later on (or so the comments in drivers/of/of_reserved_mem.c tell me). Having said that, it *may* make sense to elevate the pr_info() call to a pr_err(), to make it *obvious* that something went pear-shaped in the devicetree. But that's a decision for the devicetree/OF maintainers. --==_Exmh_1584071681_13328P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBXmsEAAdmEQWDXROgAQKEpRAAvSrfwekNfeThA0nFI6AwPyddbhoK9WSV bJWK3+aH65TlE/uLsYHEyTAHD0A/RbO4FzZaqWecu6MLVso4NewLOlcUTskbftQO ByO0E2LpY+A4I+oa6hrY7xYXaBWyxNawoUG0qwzqlVGsCbzWVHkXhkNumQ8fBBJc O47HYR+rlVEVJPvmSxRDmoIVGucwdpUCpENAlaEJ3aNfZIAbd6h4JRZvz4l6zrkF tLsoHZw6GcfZH8tpcKbrG6IiPsao9mo3/tCBkvSKdm6SRpPFgj3Ax1Uu02w9BkFS q7tZcqIw6utjtziDwP9M2c3eKlA3CtA7L9BRhINrWIm30rGZb59PPPq27ZIYQlP/ 0hmYosQNkZfs5Zbr355yQaM4Rw+7RCLVmoeILRlf0irv5Py5wx/BLUyteQhUkV3v ZXG8LxgSUL4bZGZikca6lgikUwBIA4RUxcYc6lYxd3SYAhZvglIfRlqK62x+Nzi0 GB4FaJ5rmoXdvivPAPDoEL1MWUFPDFg7Fffp3Sh2JjPeHrQ150GXKDeg53SjEV4i 17JoSS5M0ak59K68xOm/sh2ODoszV8EiDybKaYWmSA9pNLvSCPG5Zn8KKRbSb0C5 1sfrmdXF+cFIZTzJNwOHSzZWoNMqJPPWkbenGdYMyNAUAszianZLriM7X25tDLbB 73GlZEF/YZo= =zWiv -----END PGP SIGNATURE----- --==_Exmh_1584071681_13328P-- --===============1531773936900537805== 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 --===============1531773936900537805==--