Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp75796yba; Tue, 23 Apr 2019 19:52:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxs2LnCyvouxCM/mpp/zNmu7Nef1/qUZPMyeZKMgE43t5C9DuymfumpHVXPRYGxKXfM/QJR X-Received: by 2002:a62:2046:: with SMTP id g67mr29956806pfg.121.1556074372744; Tue, 23 Apr 2019 19:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556074372; cv=none; d=google.com; s=arc-20160816; b=xZle5IwuePi9KTZW+TdE8KzEF+oj8oyKbkaZuF29bl2/antCjpdKrHB/X5UXSgE1kK DeCdbRtq8/iFRaJU2zz/q98uz4KwTRWXczxKzr1TtMyTO00SVFXA3yu+KG9RSquPsP11 FfogSZz9L2F0T8EpDbhzerBHWU6zLb/mUXVCW2c9bz/nbUSLsaORcUW0RvjahMOs/7s4 KbY4/ML6mTWwxsdhhaRVMTCE1efDhzENbDRM5B8xkbLjrRcMOsaWCeORThraSOcX/kw8 Ys3zIt4OPvWS9aN0BW2zKuw2IUsCwP8frSD4Tybq7AqXvNikGBcrg2ldmv1TeHn+7pry NeJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=7kFA56J5YeJ4xNqYXNkVV+wgj19UvXjjs+NNanqo20Y=; b=sYEwXiENHdRG2LaqtQYrtebNZZFVHQW2qNFE8rsoke8A0e3yceP4QZWYhM+HHF0bSq URFfI2c6yK+qBbTM9aFlgogwy1xB+/yWxHntT7uhmOOe8vJTsEpquXqYsgXfF9HZcifa Qtc2gNLrHb0D/iH2RNELMIGSR7aN9OMZ84Y+Xp2RYMRzoCb4GLoSpgeP3ZFLoIyTOmiF Pk7NFNCrnlk0aVveSHBq7G5CY2P7/OPdYGS5xhg/W7iXq2G0x/yvlEC9QsqSz2YM1vW0 sFgC3sxlQ5kB0DdsrJZc1URs6lOdo1DUKlsRpOBJnwWagq4zmdwdfbPW/6aSkVHDL1OF sG+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ucloud.cn Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1si16271709pgo.535.2019.04.23.19.52.36; Tue, 23 Apr 2019 19:52:52 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ucloud.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728505AbfDXCu3 (ORCPT + 99 others); Tue, 23 Apr 2019 22:50:29 -0400 Received: from m9783.mail.qiye.163.com ([220.181.97.83]:48143 "EHLO m9783.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbfDXCu2 (ORCPT ); Tue, 23 Apr 2019 22:50:28 -0400 X-Greylist: delayed 440 seconds by postgrey-1.27 at vger.kernel.org; Tue, 23 Apr 2019 22:50:27 EDT Received: from localhost (unknown [117.48.120.186]) by m9783.mail.qiye.163.com (Hmail) with ESMTPA id 5DE85C1647; Wed, 24 Apr 2019 10:43:04 +0800 (CST) Date: Wed, 24 Apr 2019 10:43:04 +0800 From: WANG Chao To: Borislav Petkov Cc: Tony Luck , linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org Subject: Re: [PATCH 3/3] RAS/CEC: immediate soft-offline page when count_threshold == 1 Message-ID: <20190424024304.GA53822@WANG-Chaos-MacBook-Pro.local> References: <20190418034115.75954-1-chao.wang@ucloud.cn> <20190418034115.75954-3-chao.wang@ucloud.cn> <20190420115719.GD29704@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190420115719.GD29704@zn.tnic> User-Agent: Mutt/1.11.4 (2019-03-13) X-HM-Spam-Status: e1kIGBQJHllBS1VLV1koWUFJQjdXWS1ZQUlXWQkOFx4IWUFZMjUtOjcyP0 FLVUtZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6P1E6Dio4ETg2PjYKTw8NCA8R Ag1PFC1VSlVKTk5NS0xITENPTk5PVTMWGhIXVRgTGhRVDBoVHDsOGBcUDh9VGBVFWVdZEgtZQVlK SkxVT0NVSklLVUpDTVlXWQgBWUFJT0lONwY+ X-HM-Tid: 0a6a4d39a44a2085kuqy5de85c1647 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/20/19 at 01:57P, Borislav Petkov wrote: > On Thu, Apr 18, 2019 at 11:41:15AM +0800, WANG Chao wrote: > > count_threshol == 1 isn't working as expected. CEC only does soft > > offline the second time the same pfn is hit by a correctable error. > > So this? > > --- > diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c > index b3c377ddf340..750a427e1a73 100644 > --- a/drivers/ras/cec.c > +++ b/drivers/ras/cec.c > @@ -333,6 +333,7 @@ int cec_add_elem(u64 pfn) > > mutex_lock(&ce_mutex); > > + /* Array full, free the LRU slot. */ > if (ca->n == MAX_ELEMS) > WARN_ON(!del_lru_elem_unlocked(ca)); > > @@ -346,14 +347,9 @@ int cec_add_elem(u64 pfn) > (void *)&ca->array[to], > (ca->n - to) * sizeof(u64)); > > - ca->array[to] = (pfn << PAGE_SHIFT) | > - (DECAY_MASK << COUNT_BITS) | 1; > + ca->array[to] = (pfn << PAGE_SHIFT) | 1; > > ca->n++; > - > - ret = 0; > - > - goto decay; > } > > count = COUNT(ca->array[to]); > @@ -386,7 +382,6 @@ int cec_add_elem(u64 pfn) > goto unlock; > } > > -decay: > ca->decay_count++; > > if (ca->decay_count >= CLEAN_ELEMS) It looks good to me. Thanks for a better fix.