From patchwork Tue Aug 29 18:55:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 111239 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp1785145qge; Tue, 29 Aug 2017 11:55:50 -0700 (PDT) X-Received: by 10.55.104.207 with SMTP id d198mr7015747qkc.212.1504032950135; Tue, 29 Aug 2017 11:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504032950; cv=none; d=google.com; s=arc-20160816; b=n6TjaUSLHAcG7nfcK1N31oNts+tiUV328U+nMcDQ4/YRVnrUOgeTY5Nuo88yaDXbIT 7XMgpXC4sc40rApRPnYTpi4DySkf+ix+sdVvSUwlpy1hwdRsPrD2VBlk6J0yRzMYXtO3 3IQEiatS0A2hrXQs+IiP1agv2K62o61RrYCCQ76fg0XmFXNbsojs9SIH6TUmfalhqUfx dumjf/GzBPnvvTGdIc/3a4h/FQ0a9UUxdYVuE2xaA98S9xqtbb772va+41gzYRFMJZ0z Ls7jj4x3AJnT9ACxbTzB5zh+cM+ni/stGzkk59OiIFD4DmefDf11aRGlnqquKEdcYBKs of6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from :arc-authentication-results; bh=q1dSYglHprDAT4mA1bGQ9+mrnVYYUL5lFTOYmwYS/sY=; b=Qok++P3F0kRMaX7+Yd/9yrsN1TJIYrf5txOrXPkxyCqYiYjjcolEkLjRmEnt41BLmk U+dUAOefwjgjX4EdMRwnM6IbE6Mr+2mxcSKm3jTwWVmS63X6WZwQP66mDid4rlnC/iuu C3IwuUA+iO8FeQxi7GvwcEuVkz2J6kqY1hM9/llSnZ+kxMtAmzCP6uu+ifSMlowod24d 6ydf2kdC1SRjnbUNtu2MkmRMTPZT2RYrqBJvJIh5l1LIp9gJNEkSBcknqnWYbWvZT6cW cn36Vd0DvpB25Y3BbBkjF/X1q7gMSpe0va4/a1obacxMgJZpOpEj8t15fHy+uktSA6ia Xjgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u25si3506645qth.466.2017.08.29.11.55.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 29 Aug 2017 11:55:50 -0700 (PDT) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org Received: from localhost ([::1]:46542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmlfw-00066S-54 for patch@linaro.org; Tue, 29 Aug 2017 14:55:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmlfm-00063x-Ch for grub-devel@gnu.org; Tue, 29 Aug 2017 14:55:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmlfj-00022o-8b for grub-devel@gnu.org; Tue, 29 Aug 2017 14:55:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:48904 helo=mx1.suse.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dmlfi-000224-Oy for grub-devel@gnu.org; Tue, 29 Aug 2017 14:55:35 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3B523AF50; Tue, 29 Aug 2017 18:55:33 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Subject: [PATCH v4 0/2] efi: Free memory on exit Date: Tue, 29 Aug 2017 20:55:30 +0200 Message-Id: <20170829185532.48943-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Cc: Leif Lindholm , phcoder@gmail.com, mchang@suse.com, Daniel Kiper , elliott@hpe.com MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" When exiting grub, we currently leave the heap allocated. This means that if we exit and rerun grub, after a few iterations we can run into memory shortage. This patch set frees the heap on exit. That way we can rerun grub many times without much problem. v3 -> v4: - Move grub_reboot to kern/efi/efi.c - use dynamic list instead of static array at runtime - use allocate_pool for list, so we are not bound by heap or random numbers - remember all allocations, not just the heap Alexander Graf (2): efi: Move grub_reboot() into kernel efi: Free malloc regions on exit grub-core/Makefile.core.def | 4 --- grub-core/kern/efi/efi.c | 9 +++++++ grub-core/kern/efi/init.c | 1 + grub-core/kern/efi/mm.c | 65 +++++++++++++++++++++++++++++++++++++++++++++ grub-core/lib/efi/reboot.c | 33 ----------------------- include/grub/efi/efi.h | 1 + include/grub/misc.h | 3 ++- 7 files changed, 78 insertions(+), 38 deletions(-) delete mode 100644 grub-core/lib/efi/reboot.c -- 2.12.3 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel