From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751660AbcG1OxO (ORCPT ); Thu, 28 Jul 2016 10:53:14 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:49523 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752004AbcG1OxE (ORCPT ); Thu, 28 Jul 2016 10:53:04 -0400 Date: Thu, 28 Jul 2016 16:50:48 +0200 (CEST) From: Thomas Gleixner To: "Gaurav Jindal (Gaurav Jindal)" cc: "linux-kernel@vger.kernel.org" , "Sanjeev Yadav (Sanjeev Kumar Yadav)" Subject: Re: [PATCH]optimize error handling in tick_check_new_device In-Reply-To: <20160727120609.GA3773@gauravjindalubtnb.del.spreadtrum.com> Message-ID: References: <20160727120609.GA3773@gauravjindalubtnb.del.spreadtrum.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 Jul 2016, Gaurav Jindal (Gaurav Jindal) wrote: > In the function tick_check_new_device, module error is handled after checking > if the newdev should go as broadcast-installation device in the functions > tick_check_percpu and tick_check_preferred. In case the try_module_get returns > false, the above 2 calls are extra thus wasting CPU cycles. This is hardly a fast path so the extra cycles do not matter at all. As a result of your change you leak a module reference when the 'goto out_bc' is taken. So I prefer the existing correct version over a pretty uninteresting speedup. Thanks, tglx