From patchwork Thu Feb 22 11:45:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 129219 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp1904745edc; Thu, 22 Feb 2018 03:46:19 -0800 (PST) X-Google-Smtp-Source: AH8x2251pTNEfVROV17rV7MOZHor6hr8xIkqKCR50CcECQyrDEZ3dXbGl9jJ8NcATGPpYNKzYQll X-Received: by 10.99.173.73 with SMTP id y9mr5390625pgo.432.1519299979445; Thu, 22 Feb 2018 03:46:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519299979; cv=none; d=google.com; s=arc-20160816; b=JqpZ2JUzLR9BvFDN+DTPPS6YR+Rf142HnRjEjN0QmEMynbdCBrKWgp1pUJjiGJuz2w vej4tXxIljkomWrqPWKnFeehDfpxijU5B6OClsSZVJtfKUr22WNiLmM0ifrOT2YdThoz sjVoNy9e8wtZ9Pzgnt3zw0noEuJ0FwyqT6qW3n/kx9mQtwdh2+9UdjBkrCjwJxd974Om LDAFMsG3hjd7lENyhQg0uay87DUrkFuATh+yT6kDlTslC1sdNBDGRjmx8WKgKB/1H6Pj 7qMCzCTgARu79ykv2DZF0EDg33Q5o+YEpDTs6N9JvRim/f1EcxTe/ucIGmFmKkV6aHL0 mq+A== 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=bMvsoQ2ZOnjf5iTvgan+aYuJarx0jDR3guKqdz8+0O4=; b=AZQxC8kqyhpb6lfxR4YrP0KWWOY2ZGbgD8YfWtIkiQQJJfsNuX2fSCjOnjGuZP2A2Y l3aqyU53vNVsEnk3Vse4xg5Hgj8g4uITsP1fRVprQQ+Kw+7xGwcOtItlzFp41F8xSLcp zuioFFE5eSd54eZib3xjSerRg5jMBA/0b18Jd9NpFtZFzhWC1tAlJdlg3SvZVETExn+S 6LcKDYOrizSZGr2xfNNIcDOqpcdO15Gk8ZgtwMLgIgeAHoLuXvkJplIWDZFLhOukc0W0 TyC1FU9mdeY9sRZRk5Vbj0nnChLwlFk7LnPBoOgPwYgv7yVrfvIohVIKFqlopHaKyvXs U8Dw== 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 x27si883564pgc.25.2018.02.22.03.46.19; Thu, 22 Feb 2018 03:46:19 -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 S1753756AbeBVLqQ (ORCPT + 28 others); Thu, 22 Feb 2018 06:46:16 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:35343 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753669AbeBVLqO (ORCPT ); Thu, 22 Feb 2018 06:46:14 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0MQrwA-1fBOly1SKk-00UHzv; Thu, 22 Feb 2018 12:46:00 +0100 From: Arnd Bergmann To: Thomas Gleixner , Yang Shi Cc: Arnd Bergmann , Ingo Molnar , Waiman Long , linux-kernel@vger.kernel.org Subject: [PATCH] debugobjects: fix debug_objects_freed accounting Date: Thu, 22 Feb 2018 12:45:41 +0100 Message-Id: <20180222114558.1307380-1-arnd@arndb.de> X-Mail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ZoSM55XoAWNg== 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 count every instance we are about to free while we still hold the spinlock. Fixes: 636e1970fd7d ("debugobjects: Use global free list in free_object()") Signed-off-by: Arnd Bergmann --- lib/debugobjects.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.9.0 diff --git a/lib/debugobjects.c b/lib/debugobjects.c index faab2c4ea024..748288dba512 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -235,6 +235,9 @@ static void free_obj_work(struct work_struct *work) hlist_move_list(&obj_to_free, &tofree); obj_nr_tofree = 0; } + hlist_for_each_entry(obj, &tofree, node) + debug_objects_freed++; + raw_spin_unlock_irqrestore(&pool_lock, flags); hlist_for_each_entry_safe(obj, tmp, &tofree, node) {