From patchwork Fri Apr 4 06:36:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27763 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 25A732036E for ; Fri, 4 Apr 2014 06:46:25 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rl12sf10462215iec.6 for ; Thu, 03 Apr 2014 23:46:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=hekmXbf3zIv3qkrIo6ftGiM/z04vjS4QnHASPaSzkZg=; b=IWZg/Q0oluGECu0L7URL8lOiM6DwwtEcbirJebhBtPPWFeW+bLr0djFcMTkfI8S7GC tJaWTP/1lSWQrb3wXOnYhmevPMtmfoTvKxJVBcQZUh5LvPRv3HVMlyz3OmbsA3uJJr71 KRpUo6fNOD7fG9FysVTI2gWPDTOCGD0YIHylRDZV9Fe4GXnGlp4x2xM7wHPPmCpOTJrs adnMX0NPNeyeAcZcOEyA6mVsZjiHufxLbCi8x7m6YahSvaOH0gIOgkkQrE3e/ffGCTV8 z5zDACxd1GamBemYryk855jw3K5nXT7Rk9a+l+hpbgTZ/CsaF+dVajwxOyEWh6N/g9Fq KFog== X-Gm-Message-State: ALoCoQnzD1Xv37YPQv2WIjvvqdCJmouZ7MphpvJ/us9YAPMgS52fFQZFGWCxUDAOOBwUrZtuo90O X-Received: by 10.50.33.101 with SMTP id q5mr938748igi.3.1396593984425; Thu, 03 Apr 2014 23:46:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.136 with SMTP id v8ls898153qgd.13.gmail; Thu, 03 Apr 2014 23:46:24 -0700 (PDT) X-Received: by 10.52.142.10 with SMTP id rs10mr9761429vdb.3.1396593984339; Thu, 03 Apr 2014 23:46:24 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id sc7si1623963vdc.211.2014.04.03.23.46.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:46:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id ks9so2786785vcb.41 for ; Thu, 03 Apr 2014 23:46:24 -0700 (PDT) X-Received: by 10.58.202.133 with SMTP id ki5mr3512961vec.19.1396593984266; Thu, 03 Apr 2014 23:46:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp89475vcv; Thu, 3 Apr 2014 23:46:23 -0700 (PDT) X-Received: by 10.67.23.135 with SMTP id ia7mr12896289pad.5.1396593983393; Thu, 03 Apr 2014 23:46:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd8si4180652pad.412.2014.04.03.23.46.22; Thu, 03 Apr 2014 23:46:22 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753205AbaDDGqO (ORCPT + 27 others); Fri, 4 Apr 2014 02:46:14 -0400 Received: from mail-we0-f181.google.com ([74.125.82.181]:59497 "EHLO mail-we0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752809AbaDDGmU (ORCPT ); Fri, 4 Apr 2014 02:42:20 -0400 Received: by mail-we0-f181.google.com with SMTP id q58so2880201wes.40 for ; Thu, 03 Apr 2014 23:42:19 -0700 (PDT) X-Received: by 10.180.12.147 with SMTP id y19mr1706659wib.39.1396593739866; Thu, 03 Apr 2014 23:42:19 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id dr4sm2704160wid.14.2014.04.03.23.42.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:42:19 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, fweisbec@gmail.com, linaro-networking@linaro.org, Arvind.Chauhan@arm.com, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH V2 26/36] hrtimer: take lock only once for a cpu_base in hrtimer_run_queues() Date: Fri, 4 Apr 2014 12:06:09 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , We are taking cpu_base->lock for every clock-base in hrtimer_run_queues() and there is nothing in there which prevents us to take this lock only once. Modify code to take lock only once for a cpu_base. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 2d9a7e2..c712960 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1466,8 +1466,8 @@ void hrtimer_run_queues(void) if (cpu_base->active_bases) hrtimer_get_softirq_time(cpu_base); + raw_spin_lock(&cpu_base->lock); for_each_active_base(index, base, cpu_base, active_bases) { - raw_spin_lock(&cpu_base->lock); while ((node = timerqueue_getnext(&base->active))) { struct hrtimer *timer; @@ -1478,8 +1478,8 @@ void hrtimer_run_queues(void) __run_hrtimer(timer, &base->softirq_time); } - raw_spin_unlock(&cpu_base->lock); } + raw_spin_unlock(&cpu_base->lock); } /*