Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965569AbcJ0VYP (ORCPT ); Thu, 27 Oct 2016 17:24:15 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:39077 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965106AbcJ0VYM (ORCPT ); Thu, 27 Oct 2016 17:24:12 -0400 From: Aaron Miller To: Borislav Petkov CC: Mauro Carvalho Chehab , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] EDAC: expose per-dimm error counts in sysfs Thread-Topic: [PATCH] EDAC: expose per-dimm error counts in sysfs Thread-Index: AQHSLxd6b5ppsaaKY0ysOclt6/kBZqC8m7cA///BaAA= Date: Thu, 27 Oct 2016 21:23:15 +0000 Message-ID: <2DF9D2DA-2584-4623-BC1A-69314AA80F2A@fb.com> References: <20161025232551.3270769-1-aaronmiller@fb.com> <20161027180716.a5z6w2g5arco564h@pd.tnic> In-Reply-To: <20161027180716.a5z6w2g5arco564h@pd.tnic> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2620:10d:c090:200::f0d6] x-ms-office365-filtering-correlation-id: 0799020b-1dc9-4e13-7b78-08d3feaf7722 x-microsoft-exchange-diagnostics: 1;MWHPR15MB1262;20:N4p4B3AGS9LD3X8eb1SOajvq3fHK0nKffi/lylLurehMLPJqB8Vs81IFRKaRp+s4NS+qX9vE0bO6F10KsuS2fyLPsDsI+kiTTYgLJEjbUDPs8GoUBrTnho60RbEQEf6JnC9Aejp4fC0ArKDenfETtw8/x7J8v47V0awyXfzBpcg= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:MWHPR15MB1262; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(67672495146484); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:MWHPR15MB1262;BCL:0;PCL:0;RULEID:;SRVR:MWHPR15MB1262; x-forefront-prvs: 0108A997B2 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(199003)(377454003)(24454002)(189002)(586003)(305945005)(82746002)(5660300001)(3660700001)(10400500002)(33656002)(77096005)(76176999)(19580395003)(189998001)(2906002)(2900100001)(2950100002)(4326007)(110136003)(19580405001)(6916009)(7846002)(92566002)(7736002)(106356001)(8936002)(50986999)(6116002)(8676002)(86362001)(81156014)(3280700002)(105586002)(97736004)(101416001)(102836003)(36756003)(106116001)(68736007)(87936001)(54356999)(81166006)(122556002)(83716003)(99286002)(5002640100001)(104396002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR15MB1262;H:MWHPR15MB1264.namprd15.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <0BF88CD3518F0147BF282400FA9BA4FA@namprd15.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2016 21:23:15.8230 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1262 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-27_13:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u9RLOKmZ010664 Content-Length: 2787 Lines: 95 If your system is like the one I’m testing on, only the channel 0 DIMM slots are populated, and you injected an error for an unpopulated slot, for which no dimmX directory gets created. In edac_mc_sysfs.c: for (i = 0; i < mci->tot_dimms; i++) { struct dimm_info *dimm = mci->dimms[i]; /* Only expose populated DIMMs */ if (!dimm->nr_pages) continue; I can repro what you saw here: $ cd /sys/devices/system/edac/mc/mc0 $ grep . dimm*/*location dimm0/dimm_location:channel 0 slot 0 dimm3/dimm_location:channel 1 slot 0 dimm6/dimm_location:channel 2 slot 0 dimm9/dimm_location:channel 3 slot 0 $ echo 1 > /sys/kernel/debug/edac/mc0/fake_inject_channel $ echo 2 > /sys/kernel/debug/edac/mc0/fake_inject_slot $ echo 3 > /sys/kernel/debug/edac/mc0/fake_inject_count $ echo 1 > /sys/kernel/debug/edac/mc0/fake_inject $ cat ce_count 3 $ grep . dimm*/*ce_count dimm0/dimm_ce_count:0 dimm3/dimm_ce_count:0 dimm6/dimm_ce_count:0 dimm9/dimm_ce_count:0 And I get what I expect for a populated slot: $ echo 0 > /sys/kernel/debug/edac/mc0/fake_inject_slot $ echo 1 > /sys/kernel/debug/edac/mc0/fake_inject $ cat ce_count 6 $ grep . dimm*/*ce_count dimm0/dimm_ce_count:0 dimm3/dimm_ce_count:3 dimm6/dimm_ce_count:0 dimm9/dimm_ce_count:0 On 10/27/16, 11:07 AM, "Borislav Petkov" wrote: On Tue, Oct 25, 2016 at 04:25:51PM -0700, Aaron Miller wrote: <--- This patch needs a commit message. Especially as to *why* we need this. > Signed-off-by: Aaron Miller > --- > drivers/edac/edac_mc_sysfs.c | 38 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 38 insertions(+) Regardless, something's still not right yet: $ echo 1 > /sys/kernel/debug/edac/mc0/fake_inject_channel $ echo 2 > /sys/kernel/debug/edac/mc0/fake_inject_slot $ echo 3 > /sys/kernel/debug/edac/mc0/fake_inject_count ^ $ echo 1 > /sys/kernel/debug/edac/mc0/fake_inject $ grep . /sys/devices/system/edac/mc/mc0/*count /sys/devices/system/edac/mc/mc0/ce_count:3 ^ /sys/devices/system/edac/mc/mc0/ce_noinfo_count:0 /sys/devices/system/edac/mc/mc0/ue_count:0 /sys/devices/system/edac/mc/mc0/ue_noinfo_count:0 $ grep -r . /sys/devices/system/edac/mc/mc0/dimm*/* 2>/dev/null | grep ce_count /sys/devices/system/edac/mc/mc0/dimm0/dimm_ce_count:0 /sys/devices/system/edac/mc/mc0/dimm3/dimm_ce_count:0 /sys/devices/system/edac/mc/mc0/dimm6/dimm_ce_count:0 /sys/devices/system/edac/mc/mc0/dimm9/dimm_ce_count:0 ^ There should be 3 somewhere in the DIMM counters... -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.