Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mpu7M-0005jq-Kw for mharc-grub-devel@gnu.org; Wed, 24 Nov 2021 10:23:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpu7I-0005fG-8o for grub-devel@gnu.org; Wed, 24 Nov 2021 10:23:24 -0500 Received: from [2607:f8b0:4864:20::1036] (port=44653 helo=mail-pj1-x1036.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mpu72-0000cY-3o for grub-devel@gnu.org; Wed, 24 Nov 2021 10:23:23 -0500 Received: by mail-pj1-x1036.google.com with SMTP id o6-20020a17090a0a0600b001a64b9a11aeso3015617pjo.3 for ; Wed, 24 Nov 2021 07:23:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+fA8JqCzyhsuG+iZNj9OENQP7Horihw/yPtFpPaBiU4=; b=WOJ4oUQwp9MO3+rDjl8WCAWm6PcjfhPsfpT3ke5UBH1lfl/zlBO6ph5S0DTLC+BTLG qC6jZFepzd20XRLEqfX304Ti8KYY7Iv9XbtNo+9DhQc3FBXbiJaTi+cOv1XEytj0sTXd G7giUXitehfMPBUSkzcgJBhio6ErH/C27poAs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+fA8JqCzyhsuG+iZNj9OENQP7Horihw/yPtFpPaBiU4=; b=iT6O/0l3M/jz0MucIu3WDfa8PVF+BIKgDCIblJ3d5Vdgc107/XmRbwv0z8weNZk0ZB /YvMySR0HhBlNJnenOA/nYz38ItKfwsRNNQOJwJK00BI5dwg/fMvH1Cs93HZJ0NtpQKK RFWjDFwMPdHtpKLZJ6Jz6ofnZ/DZQYaNKb1QKwhx+/8hzxVeJHW3qicvjoW9O3HJ7h2H DID0OfKWSpZSBQEYI45CLsl7fuFgYiqFtNaloZu+dh8z45auKQ8bnUgXeSxl+FFJ6bUP 4a4f3B1NTRFSv4pInXiEdRH3HiVcKspEGxtN5ltoJ+zOhI/BsSJ3pDBJoJqyy2+UsJZA No7A== X-Gm-Message-State: AOAM5303OMWoPeboJkxaGJgee9aKLfztbS8Lt103a0vzg4bLZBW2R+TW Uicfx4Y31A7UJkZOAfLFXY9VOkABsXev0g== X-Google-Smtp-Source: ABdhPJzTWzkOXX9aObUi6M/z1XSjgyjsi8v47CoGMsn9vlCzMKgbsXrxCicKcAtRmEuaLctMpwx2nA== X-Received: by 2002:a17:90b:390a:: with SMTP id ob10mr16731417pjb.216.1637767384390; Wed, 24 Nov 2021 07:23:04 -0800 (PST) Received: from localhost ([2001:4479:e000:e400:9826:f987:bef5:b0c4]) by smtp.gmail.com with ESMTPSA id a8sm59916pfv.176.2021.11.24.07.23.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 07:23:04 -0800 (PST) From: Daniel Axtens To: grub-devel@gnu.org Cc: development@efficientek.com, dkiper@net-space.pl, Daniel Axtens Subject: [PATCH 3/6] mm: grub_real_malloc: make small allocs comment match code Date: Thu, 25 Nov 2021 02:22:47 +1100 Message-Id: <20211124152250.1040794-4-dja@axtens.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211124152250.1040794-1-dja@axtens.net> References: <20211124152250.1040794-1-dja@axtens.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1036 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=dja@axtens.net; helo=mail-pj1-x1036.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Nov 2021 15:23:24 -0000 Small allocations move the region's *first pointer. The comment says that this happens for allocations under 64K. The code says it's for allocations under 32K. Commit 45bf8b3a7549 changed the code intentionally: make the comment match. Fixes: 45bf8b3a7549 (" * grub-core/kern/mm.c (grub_real_malloc): Decrease cut-off of moving the") Signed-off-by: Daniel Axtens --- grub-core/kern/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c index 6efabe92df0e..ac41cf4aab15 100644 --- a/grub-core/kern/mm.c +++ b/grub-core/kern/mm.c @@ -306,7 +306,7 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align) /* Mark find as a start marker for next allocation to fasten it. This will have side effect of fragmenting memory as small pieces before this will be un-used. */ - /* So do it only for chunks under 64K. */ + /* So do it only for chunks under 32K. */ if (n < (0x8000 >> GRUB_MM_ALIGN_LOG2) || *first == cur) *first = prev; -- 2.32.0