Message ID | 20221216-objtool-memory-v2-8-17968f85a464@weissschuh.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1459889wrt; Tue, 27 Dec 2022 08:03:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXvPLrWUlRgQ+AQhNVl5b1AhDOCDH8+eidGbAmc8ztcLS9VTGVuqP975fhrFtp3nvrxxfeuk X-Received: by 2002:a17:907:180c:b0:83d:61f8:3c with SMTP id lg12-20020a170907180c00b0083d61f8003cmr18347773ejc.3.1672157036421; Tue, 27 Dec 2022 08:03:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672157036; cv=none; d=google.com; s=arc-20160816; b=cIHS3rsuMUysIl+rhNzSxZLQUhlvCBiCB1f5rP3d4dTW3XK2ml36CjYLTWdfh4Vdbg eOlgPr63tOKDqhHn1w5dBEQHi/5yPQWQBFLs3pVqsmoilU8d60e4wU8AmMQdIUDPj/St wDG0opoaWX2qTkEhp7lfx+xmvpyPCm4FdjaoqsO7i0Qisey/eDJWjCHmCi/zJFPCTjFo W+pyEOAZTW//JGPyXWZA/kFOcdq0rVgLR2DxXawm3KP88l49lUkNAaJo18m4/rlj45cI yrfvKOwq4HrBJ6KLl+YaTVMzdeLxcMl0W9w9nhvX5CdQGsTGxtWYmNi90fe85H8q3SK4 HovQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:dkim-signature :from; bh=bFPA0IBIJaEy2/voRS0odpOtzEbW+juo7gl60jGTTD4=; b=hUCDbVJYXKjp4V6YjwF740Nh/xW2ZYdIsZL2RmgaioMcULpa4JlMArO7fMPvIeDvtv QtECcyUNvH+bJzNhUZhBbMBCoqZ/uOrTwc1LoBK7erihAnHzDUIM20GJSaDW5SVOOVIJ BketARsFl8JrklPEefLk3O8lzgfRHHQonMXs6vVWmXgujgDHF6zyN6WDtTTb/B2YBPIv 8yUQQdPbQsp3cBZEIURyQxx257cVgltKACoIwtNVK6Gm3C+l3x3GDEv+wxXqPvfrCluz oVi+Epqs6zV7QTvf5YrDCDQySBi+YGpR6F6FJjbqhae3pIb4jQKvRAt70w0BkdfKheHj hGnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=BoJrCV32; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr6-20020a170907720600b007c0969e429bsi11401648ejc.30.2022.12.27.08.03.30; Tue, 27 Dec 2022 08:03:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=BoJrCV32; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231298AbiL0QCt (ORCPT <rfc822;eddaouddi.ayoub@gmail.com> + 99 others); Tue, 27 Dec 2022 11:02:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230209AbiL0QCs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 27 Dec 2022 11:02:48 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2F92D73 for <linux-kernel@vger.kernel.org>; Tue, 27 Dec 2022 08:02:46 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= <linux@weissschuh.net> DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1672156964; bh=WygJ1LogaMt7MCTVMz5LRPbo5ugX1SmSSa6UqeJvw4g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BoJrCV32q5+ZX9E7hByJLWwo7fCfvpmrC+NI8JWcOJ4OXoeUmNeiVkEBNdl97cP1C fJis5QnFfTipBbfr/kazHgOWmDYa959RnH3GmpbfKBFf9M6NczsoKxwpF+JPI0LJie WZVNrCY9ff0/sfMvuCOLEQSrVuANtVqmphzTycXY= Date: Tue, 27 Dec 2022 16:01:04 +0000 Subject: [PATCH v2 8/8] objtool: explicitly cleanup resources on success MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-Id: <20221216-objtool-memory-v2-8-17968f85a464@weissschuh.net> References: <20221216-objtool-memory-v2-0-17968f85a464@weissschuh.net> In-Reply-To: <20221216-objtool-memory-v2-0-17968f85a464@weissschuh.net> To: Josh Poimboeuf <jpoimboe@kernel.org>, Peter Zijlstra <peterz@infradead.org> Cc: linux-kernel@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= <linux@weissschuh.net> X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1672156865; l=618; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=WygJ1LogaMt7MCTVMz5LRPbo5ugX1SmSSa6UqeJvw4g=; b=MRmJd1QRpDgL/iIJ/DCBZTdg4HCDjlAvrgtCTCrxDptY+z/uSoHWpLTa0PFHkm8zAL2huAiioeNH ElsMGfVWBLCXo8f9Z0XTYkwtKZVjIAmY8TzWcVqvEtLc+YOAf6Er X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753383736531487349?= X-GMAIL-MSGID: =?utf-8?q?1753383736531487349?= |
Series |
reduce maximum memory usage
|
|
Commit Message
Thomas Weißschuh
Dec. 27, 2022, 4:01 p.m. UTC
Previously the file was only closed and resources properly freed on
errors, not on normal exits.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/objtool/builtin-check.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On Tue, Dec 27, 2022 at 04:01:04PM +0000, Thomas Weißschuh wrote: > Previously the file was only closed and resources properly freed on > errors, not on normal exits. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > --- > tools/objtool/builtin-check.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c > index 7c175198d09f..e11c766b98ce 100644 > --- a/tools/objtool/builtin-check.c > +++ b/tools/objtool/builtin-check.c > @@ -229,5 +229,7 @@ int objtool_run(int argc, const char **argv) > if (file->elf->changed) > return elf_write(file->elf); > > + elf_close(file->elf); > + > return 0; I'd rather not unless there's a real benefit to doing this, as it will just slow down the exit.
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index 7c175198d09f..e11c766b98ce 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -229,5 +229,7 @@ int objtool_run(int argc, const char **argv) if (file->elf->changed) return elf_write(file->elf); + elf_close(file->elf); + return 0; }