Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp392663yba; Sat, 20 Apr 2019 04:58:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqy01j6SEw2nsgKM2+cNytKMdovy5EHZEyGOtljls1D3evA3T8712zcV70GgkvwzMf+T5mzr X-Received: by 2002:a63:1359:: with SMTP id 25mr8768098pgt.92.1555761514710; Sat, 20 Apr 2019 04:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555761514; cv=none; d=google.com; s=arc-20160816; b=N7Krm9oE1MYtNaRt2wzVQEjPbSrMs+oSV2gE5fVICmAX8mjyWzDm+pWPIR8AFzwOHu JxKT5y9wPIqlFjX/93MMJ+cOwG/2aBOAiwV+5EgBDACetSqF8TDVDn04TSCl2izWDKfZ 2sBa80BLh8o/wtRzoSxLv1WEEJprftgtR1MO0570lRUPuGK0O3gPKr3GR2y6iBmJJJoK tG3Q5R6caEOBW3U3EMGSPiylEze/uK6JvJ5MvWKrgTNdk9w/EfI1ejQiZMPamLsl+tJU xO+j7Elsx11ag6dX5oVnOyZZH72/Ok/rAfMUl98bEXAv+JRcGzgvVjR+BlSL9M0anQt+ PjJg== 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:dkim-signature; bh=IEjw5oQf38kcfHyHqIkf/KoAl+9see8ZlQ6OAsAH0+g=; b=Nk+f1DkaUNCc4D3HfUGXIPysYWlmpzCdIHHY6+EJHukk5M0GaQbTaC8k/BCIeMjwqM Qxc5ZdrdjkYTzQevCD27SV+o2iB5F/JyAhwXJDy1e3fI2mirOCCmzI9ElshRSRrIkJpy lgHmxjwWP6VGnOUsOpWlInJMlxeID1cZw71CkTA8adg++RttDo/n0OVqyFK200EuauOz NkRd7VfxvMci7v31OH+Ez9SakBoyKcj1gIBTHk3ON72+szVSRK9rHYIX3Nryk6Bwr90q KhuiNBf2+QumR/rY+rlUdAt9ICyPmTsuy233w85ocfXSKoxJol5E84bVGl7AWtUHTle/ emzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=fbIm4ODg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u18si7803493plq.184.2019.04.20.04.58.18; Sat, 20 Apr 2019 04:58:34 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=fbIm4ODg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728188AbfDTL5Z (ORCPT + 99 others); Sat, 20 Apr 2019 07:57:25 -0400 Received: from mail.skyhub.de ([5.9.137.197]:51804 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726071AbfDTL5Z (ORCPT ); Sat, 20 Apr 2019 07:57:25 -0400 Received: from zn.tnic (p200300EC2F112E00718873C84F24A365.dip0.t-ipconnect.de [IPv6:2003:ec:2f11:2e00:7188:73c8:4f24:a365]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 126B51EC082D; Sat, 20 Apr 2019 13:57:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1555761444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=IEjw5oQf38kcfHyHqIkf/KoAl+9see8ZlQ6OAsAH0+g=; b=fbIm4ODgUQ3WCxvgxciPGGPjQuBE6rw3WxFGN6Ldadqxzo5GDKJvrxkRgrRLDjQETislTi DU+zbpLnRWMQltJ8XbxHywVRjvEu73vBkLUODF8iKHUP2bnGNdbCMFWtYLIU6VQ6e1jyYe EEOp1QuhEsRyXBp60n3tH0pJ+V24Pqs= Date: Sat, 20 Apr 2019 13:57:19 +0200 From: Borislav Petkov To: WANG Chao 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: <20190420115719.GD29704@zn.tnic> References: <20190418034115.75954-1-chao.wang@ucloud.cn> <20190418034115.75954-3-chao.wang@ucloud.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190418034115.75954-3-chao.wang@ucloud.cn> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.