From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751281AbcEHHo5 (ORCPT ); Sun, 8 May 2016 03:44:57 -0400 Received: from mga11.intel.com ([192.55.52.93]:29228 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbcEHHo4 convert rfc822-to-8bit (ORCPT ); Sun, 8 May 2016 03:44:56 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,594,1455004800"; d="scan'208";a="99247079" From: "Du, Changbin" To: Thomas Gleixner CC: Andrew Morton , "Paul E. McKenney" , "josh@joshtriplett.org" , Steven Rostedt , "Mathieu Desnoyers" , "jiangshanlai@gmail.com" , John Stultz , Tejun Heo , LKML Subject: RE: [PATCH] debugobjects: insulate non-fixup logic related to static obj from fixup callbacks Thread-Topic: [PATCH] debugobjects: insulate non-fixup logic related to static obj from fixup callbacks Thread-Index: AQHRp+347EZFRaoptE6OyPA+S+ibb5+snlUAgAIKH5A= Date: Sun, 8 May 2016 07:44:48 +0000 Message-ID: <0C18FE92A7765D4EB9EE5D38D86A563A05D2DCE6@SHSMSX103.ccr.corp.intel.com> References: <1462576157-14539-1-git-send-email-changbin.du@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDY1OWEzNzEtZmEyZS00NDQ5LTgwNGQtMDA0NTlmYWZiZDNjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Img1NndSNG0yY0ZNcnFjVVlBd2NONjl5NjV3eFBBVDdzUjBPNUFSdW1CUE09In0= x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Thomas Gleixner [mailto:tglx@linutronix.de] > Can you please fix your mail client. Every mail you send has: > > Cc: ..... > "Du, Changbin" , > Du > > And that stray 'Du' is just broken. > Yes, I should add "" around my name or fix the git-sendemail perl script. The script may add a "" auto. :) > > At last, I have a concern about the fixups that can it change the > > object which is in incorrect state on fixup? Because the 'addr' may > > not point to any valid object if a non-static object is not tracked. > > Then Change such object can overwrite someone's memory and cause > > unexpected behaviour. For example, the timer_fixup_activate bind > > timer to function stub_timer. > > Well, you have the choice of: > > 1) Leave the object uninitialized and watch the resulting explosion > > 2) Assume that the pointer is a valid object and initialize it > > The latter has been chosen as the lesser of two evils. > Hmm, seems nothing more we can do to reduce further damage. > > raw_spin_unlock_irqrestore(&db->lock, flags); > > /* > > - * Maybe the object is static. Let the type specific > > + * Maybe the object is static. Let the type specific > > * code decide what to do. > > Instead of doing white space changes you really want to explain the logic > here. > Comments is in following code. > > */ > > - if (debug_object_fixup(descr->fixup_assert_init, addr, > > - ODEBUG_STATE_NOTAVAILABLE)) > > + if (descr->is_static_object && descr->is_static_object(addr)) > { > > + /* Make sure that it is tracked in the object tracker */ > > + debug_object_init(addr, descr); > > + } else { > > debug_print_object(&o, "assert_init"); > > + debug_object_fixup(descr->fixup_assert_init, addr, > > + ODEBUG_STATE_NOTAVAILABLE); > > + } > > return; > > } > > Other than the missing comment this looks good. > > Thanks, > > tglx Thanks for reviewing. Du, Changbin