From patchwork Thu Feb 22 15:52:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 129289 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2167228edc; Thu, 22 Feb 2018 07:53:58 -0800 (PST) X-Google-Smtp-Source: AH8x224eZfKpC6ZbJieT2hqVjPGsu9yjZ8CMC0y2sbb+BkNoUICJvTfKpPsBV9Xy2ymvj1+uCGdV X-Received: by 2002:a17:902:6b88:: with SMTP id p8-v6mr6833341plk.261.1519314838204; Thu, 22 Feb 2018 07:53:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519314838; cv=none; d=google.com; s=arc-20160816; b=nywLlQiMMVcXOVLsBHR7g+jzmiQd4R5v09g801qnQNjRKTTcbYZaSuUHVuMc9yJS/0 +hJFvpptDqp2yHODQDeC2tfynM6PiVArgH324j9NQBubW17MgDyQfGnkRPp4kY9zxDQP Tbv39xY0CTtAX3fHGt3r71uJk+feIBXwehRHuZtYUUMqD3VkmAEDtWkynd15rpQLSgus vM50bYRW24wckJIpaiMooF39b8W1NNODLA1ouaqsjfW39YFiDXXxeZOX7aqCL9swNFKX oGlx3NeUD7v0JWu/PI7U0sKKlkWThKfY3kA8x+DGmbUZ95xrydv4NYwneIM46RK+hrhr p/fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Z0+jVrK2Tw4yzXw+w9yAOkPiXy1AHLUqSB4pLNtudqI=; b=E2hDOqydxhQbGM0vHaW0wv5jFFGozNnTF78podZcao31t7MtaTP8ZxZsPGUSp8IL+Y d5JI1AiCj/+0hmZiAP2j0CeBlyIjOrD8HBEb48ZXkxCzAGR+WNpp8R1pi9GWcF9HXBH7 fH0/K/1iK3lrhdAWqY8iHxGSLvn47rpq8orj0ElgCPmjkY2BOAEF7MVS37Ef0TkOcRxj oM1ahIsznjGwZGCkp51El4DobQcc1v9p46R8G8ZVzlwGoPnmC/U17E4Gp4HPWuBgBSRB G3HZRpz1IzTwhmNRkLzInZ7Cotv+OffCLhN4m9LCDeFr6qqhHx9oGOR4MtkZwu/lDabY uNGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e87si44894pfk.322.2018.02.22.07.53.57; Thu, 22 Feb 2018 07:53:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933046AbeBVPxy (ORCPT + 28 others); Thu, 22 Feb 2018 10:53:54 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:51233 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933000AbeBVPxx (ORCPT ); Thu, 22 Feb 2018 10:53:53 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0LlrG8-1eFYMz0nui-00ZNLZ; Thu, 22 Feb 2018 16:53:37 +0100 From: Arnd Bergmann To: Thomas Gleixner , Yang Shi , Waiman Long Cc: Arnd Bergmann , Ingo Molnar , linux-kernel@vger.kernel.org Subject: [PATCH] [v2] debugobjects: fix debug_objects_freed accounting Date: Thu, 22 Feb 2018 16:52:58 +0100 Message-Id: <20180222155335.1647466-1-arnd@arndb.de> X-Mailer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vKUoG+93g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The removal of the batched object freeing has caused the debug_objects_freed to become read-only, and the reading is inside an ifdef, so gcc warns that it is completely unused without CONFIG_DEBUG_FS: lib/debugobjects.c:71:14: error: 'debug_objects_freed' defined but not used [-Werror=unused-variable] Assuming we are still interested in this number, this adds back code to keep track of the freed objects. Fixes: 636e1970fd7d ("debugobjects: Use global free list in free_object()") Suggested-by: Waiman Long Signed-off-by: Arnd Bergmann -- v2: simplify the counting as pointed out by Longman --- lib/debugobjects.c | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 Acked-by: Yang Shi Acked-by: Waiman Long diff --git a/lib/debugobjects.c b/lib/debugobjects.c index faab2c4ea024..105ecfc47d8c 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -233,6 +233,7 @@ static void free_obj_work(struct work_struct *work) */ if (obj_nr_tofree) { hlist_move_list(&obj_to_free, &tofree); + debug_objects_freed += obj_nr_tofree; obj_nr_tofree = 0; } raw_spin_unlock_irqrestore(&pool_lock, flags);