linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Borislav Petkov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, mingo@kernel.org, tony.luck@intel.com,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	chao.wang@ucloud.cn, hpa@zytor.com, bp@suse.de
Subject: [tip:ras/core] RAS/CEC: Increment cec_entered under the mutex lock
Date: Sat, 20 Apr 2019 03:22:03 -0700	[thread overview]
Message-ID: <tip-09cbd2197e9291d6a3d3f42873f06ca1f388c1a4@git.kernel.org> (raw)

Commit-ID:  09cbd2197e9291d6a3d3f42873f06ca1f388c1a4
Gitweb:     https://git.kernel.org/tip/09cbd2197e9291d6a3d3f42873f06ca1f388c1a4
Author:     WANG Chao <chao.wang@ucloud.cn>
AuthorDate: Thu, 18 Apr 2019 03:41:14 +0000
Committer:  Borislav Petkov <bp@suse.de>
CommitDate: Sat, 20 Apr 2019 12:16:52 +0200

RAS/CEC: Increment cec_entered under the mutex lock

Modify ->cec_entered in the critical section of the mutex.

Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: https://lkml.kernel.org/r/20190418034115.75954-2-chao.wang@ucloud.cn
---
 drivers/ras/cec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c
index 2d9ec378a8bc..88e4f3ff0cb8 100644
--- a/drivers/ras/cec.c
+++ b/drivers/ras/cec.c
@@ -286,10 +286,10 @@ int cec_add_elem(u64 pfn)
 	if (!ce_arr.array || ce_arr.disabled)
 		return -ENODEV;
 
-	ca->ces_entered++;
-
 	mutex_lock(&ce_mutex);
 
+	ca->ces_entered++;
+
 	if (ca->n == MAX_ELEMS)
 		WARN_ON(!del_lru_elem_unlocked(ca));
 

WARNING: multiple messages have this Message-ID (diff)
From: tip-bot for WANG Chao <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, mingo@kernel.org, tony.luck@intel.com,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	chao.wang@ucloud.cn, hpa@zytor.com, bp@suse.de
Subject: [tip:ras/core] RAS/CEC: Increment cec_entered under the mutex lock
Date: Sat, 20 Apr 2019 03:22:03 -0700	[thread overview]
Message-ID: <tip-09cbd2197e9291d6a3d3f42873f06ca1f388c1a4@git.kernel.org> (raw)
Message-ID: <20190420102203.73kzq1fVkI_NPsYJrAVpKh2_dwf3Aa9l1Caw39YXNvY@z> (raw)
In-Reply-To: <20190418034115.75954-2-chao.wang@ucloud.cn>

Commit-ID:  09cbd2197e9291d6a3d3f42873f06ca1f388c1a4
Gitweb:     https://git.kernel.org/tip/09cbd2197e9291d6a3d3f42873f06ca1f388c1a4
Author:     WANG Chao <chao.wang@ucloud.cn>
AuthorDate: Thu, 18 Apr 2019 03:41:14 +0000
Committer:  Borislav Petkov <bp@suse.de>
CommitDate: Sat, 20 Apr 2019 12:16:52 +0200

RAS/CEC: Increment cec_entered under the mutex lock

Modify ->cec_entered in the critical section of the mutex.

Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: https://lkml.kernel.org/r/20190418034115.75954-2-chao.wang@ucloud.cn
---
 drivers/ras/cec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c
index 2d9ec378a8bc..88e4f3ff0cb8 100644
--- a/drivers/ras/cec.c
+++ b/drivers/ras/cec.c
@@ -286,10 +286,10 @@ int cec_add_elem(u64 pfn)
 	if (!ce_arr.array || ce_arr.disabled)
 		return -ENODEV;
 
-	ca->ces_entered++;
-
 	mutex_lock(&ce_mutex);
 
+	ca->ces_entered++;
+
 	if (ca->n == MAX_ELEMS)
 		WARN_ON(!del_lru_elem_unlocked(ca));
 

         reply	other threads:[~2019-04-20 10:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18  3:41 [1/3] RAS/CEC: fix __find_elem WANG Chao
2019-04-18  3:41 ` [PATCH 1/3] " WANG Chao
2019-04-18  3:41 ` [2/3] RAS/CEC: make ces_entered smp safe WANG Chao
2019-04-18  3:41   ` [PATCH 2/3] " WANG Chao
2019-04-20 10:19   ` [tip:ras/core] RAS/CEC: Increment cec_entered under the mutex lock tip-bot for Borislav Petkov
2019-04-20 10:19     ` tip-bot for WANG Chao
2019-04-20 10:22   ` tip-bot for Borislav Petkov [this message]
2019-04-20 10:22     ` tip-bot for WANG Chao
2019-04-18  3:41 ` [3/3] RAS/CEC: immediate soft-offline page when count_threshold == 1 WANG Chao
2019-04-18  3:41   ` [PATCH 3/3] " WANG Chao
2019-04-20 11:57   ` [3/3] " Borislav Petkov
2019-04-20 11:57     ` [PATCH 3/3] " Borislav Petkov
2019-04-24  2:43     ` [3/3] " WANG Chao
2019-04-24  2:43       ` [PATCH 3/3] " WANG Chao
2019-04-24 10:26       ` [3/3] " Borislav Petkov
2019-04-24 10:26         ` [PATCH 3/3] " Borislav Petkov
2019-04-25  7:56 ` [1/3] RAS/CEC: fix __find_elem WANG Chao
2019-04-25  7:56   ` [PATCH 1/3] " WANG Chao
2019-04-25  8:05   ` [1/3] " WANG Chao
2019-04-25  8:05     ` [PATCH 1/3] " WANG Chao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-09cbd2197e9291d6a3d3f42873f06ca1f388c1a4@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@suse.de \
    --cc=chao.wang@ucloud.cn \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).