From patchwork Mon Mar 19 08:12:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lai Jiangshan X-Patchwork-Id: 7353 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 673AD23E29 for ; Mon, 19 Mar 2012 08:07:23 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 2FFCDA18571 for ; Mon, 19 Mar 2012 08:07:23 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so12136902iag.11 for ; Mon, 19 Mar 2012 01:07:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :x-ironport-av:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-mimetrack:x-gm-message-state; bh=X0081f1NeR4YZezod9mVltwu7CxbINC98gHcwvQBY+c=; b=fuAb47sq6PHfSAtqmar9wWPo6EwbmkhWsdUwKRZxXRnbSsR/cazpan/CKXWS+STxB5 JQzUbBjvk/qAUF9S1ONzvIyvqUOuwO8qypMxp4TNsh4QCq7IgZVsfjXSZkZeAg3LfzPg d7D5khIu9a2UmPq7fZJWC38Jsg0nJDxD4A6tuz1U8mlAct3BLxe8L9+GbaUTs9JYDycc X6X5JCaYxGYP6jtCuPhMbzeT4iN38+ILFEq1zTjZlH6I9rzt3rY/uI9pffhxy2+a/rOC 66oy8ENkOcovTdnKRosm2xg1qtI0K+umv+6PQ/lC1lRzVLxDtfkQT8BfmWiUDPFwIISL 8SCQ== Received: by 10.50.155.229 with SMTP id vz5mr5303139igb.12.1332144442971; Mon, 19 Mar 2012 01:07:22 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.203.79 with SMTP id fh15csp66181ibb; Mon, 19 Mar 2012 01:07:22 -0700 (PDT) Received: by 10.68.240.135 with SMTP id wa7mr37646967pbc.7.1332144440992; Mon, 19 Mar 2012 01:07:20 -0700 (PDT) Received: from song.cn.fujitsu.com ([222.73.24.84]) by mx.google.com with ESMTP id j5si11836369pbl.242.2012.03.19.01.07.20; Mon, 19 Mar 2012 01:07:20 -0700 (PDT) Received-SPF: neutral (google.com: 222.73.24.84 is neither permitted nor denied by best guess record for domain of laijs@cn.fujitsu.com) client-ip=222.73.24.84; Authentication-Results: mx.google.com; spf=neutral (google.com: 222.73.24.84 is neither permitted nor denied by best guess record for domain of laijs@cn.fujitsu.com) smtp.mail=laijs@cn.fujitsu.com X-IronPort-AV: E=Sophos;i="4.73,611,1325433600"; d="scan'208";a="4567343" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 19 Mar 2012 16:07:05 +0800 Received: from mailserver.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id q2J87Bfa031170; Mon, 19 Mar 2012 16:07:11 +0800 Received: from localhost.localdomain ([10.167.225.146]) by mailserver.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2012031916050451-1090600 ; Mon, 19 Mar 2012 16:05:04 +0800 From: Lai Jiangshan To: "Paul E. McKenney" Cc: Lai Jiangshan , linux-kernel@vger.kernel.org, mingo@elte.hu, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, fweisbec@gmail.com, patches@linaro.org Subject: [PATCH 1/4 V2] rcu: fix srcu_readers_active() Date: Mon, 19 Mar 2012 16:12:11 +0800 Message-Id: <1332144734-9375-2-git-send-email-laijs@cn.fujitsu.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1332144734-9375-1-git-send-email-laijs@cn.fujitsu.com> References: <1332144734-9375-1-git-send-email-laijs@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2012-03-19 16:05:04, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2012-03-19 16:05:07, Serialize complete at 2012-03-19 16:05:07 X-Gm-Message-State: ALoCoQnb628o8/yMV7SQnhZT9106c2iV3aEmRRWowq99oCMPegorEwRoV8scIa+lvZeflDOkd59I After patch "implement Peter's checking algorithm" applied, SRCU_REF_MASK is not existed. Also remove unused @cpu in srcu_readers_active_idx_check(). Signed-off-by: Lai Jiangshan --- kernel/srcu.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/kernel/srcu.c b/kernel/srcu.c index 1bed654..9e86ed7 100644 --- a/kernel/srcu.c +++ b/kernel/srcu.c @@ -108,7 +108,6 @@ static unsigned long srcu_readers_active_idx(struct srcu_struct *sp, int idx) static bool srcu_readers_active_idx_check(struct srcu_struct *sp, int idx) { - int cpu; unsigned long seq; seq = srcu_readers_seq_idx(sp, idx); @@ -186,7 +185,7 @@ static int srcu_readers_active(struct srcu_struct *sp) sum += ACCESS_ONCE(per_cpu_ptr(sp->per_cpu_ref, cpu)->c[0]); sum += ACCESS_ONCE(per_cpu_ptr(sp->per_cpu_ref, cpu)->c[1]); } - return sum & SRCU_REF_MASK; + return sum; } /**