From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933276AbeBVQDP (ORCPT ); Thu, 22 Feb 2018 11:03:15 -0500 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:47064 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933068AbeBVQDN (ORCPT ); Thu, 22 Feb 2018 11:03:13 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R851e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01353;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0SyMKCt._1519315380; Subject: Re: [PATCH] [v2] debugobjects: fix debug_objects_freed accounting To: Arnd Bergmann , Thomas Gleixner , Waiman Long Cc: Ingo Molnar , linux-kernel@vger.kernel.org References: <20180222155335.1647466-1-arnd@arndb.de> From: Yang Shi Message-ID: Date: Thu, 22 Feb 2018 08:02:57 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180222155335.1647466-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/22/18 7:52 AM, Arnd Bergmann wrote: > 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 Thanks for catching this. Acked-by: Yang Shi > --- > lib/debugobjects.c | 1 + > 1 file changed, 1 insertion(+) > > 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);