From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756251AbYFYW0J (ORCPT ); Wed, 25 Jun 2008 18:26:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754065AbYFYWZ4 (ORCPT ); Wed, 25 Jun 2008 18:25:56 -0400 Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:55391 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752388AbYFYWZz (ORCPT ); Wed, 25 Jun 2008 18:25:55 -0400 Date: Wed, 25 Jun 2008 17:25:53 -0500 From: Russ Anderson To: KOSAKI Motohiro Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, Linus Torvalds , Andrew Morton , Tony Luck , Christoph Lameter Subject: Re: [PATCH 3/3] ia64: Call migration code on correctable errors v6 Message-ID: <20080625222553.GA29402@sgi.com> Reply-To: Russ Anderson References: <20080609162015.GD14939@sgi.com> <20080623121721.37CA.KOSAKI.MOTOHIRO@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080623121721.37CA.KOSAKI.MOTOHIRO@jp.fujitsu.com> User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 23, 2008 at 12:25:40PM +0900, KOSAKI Motohiro wrote: > Hi > > > +static ssize_t > > +badpage_show(struct kobject *kobj, > > + struct kobj_attribute *attr, char *buf) > > + > > +{ > > + struct page *page, *page2; > > + int i = 0, cnt = 0; > > + char *bufend = buf + PAGE_SIZE; > > + > > + cnt = snprintf(buf, bufend - (buf + cnt), > > + "Bad RAM: %d kB, %d pages marked bad\n" > > + "List of bad physical pages\n", > > + total_badpages << (PAGE_SHIFT - 10), total_badpages); > > + > > + list_for_each_entry_safe(page, page2, &badpagelist, lru) { > > + if (bufend - (buf + cnt) < 20) > > + break; /* Avoid overflowing the buffer */ > > + cnt += snprintf(buf + cnt, bufend - (buf + cnt), > > + " 0x%011lx", page_to_phys(page)); > > + if (!(++i % 5)) > > + cnt += snprintf(buf + cnt, bufend - (buf + cnt), "\n"); > > + } > > + cnt += snprintf(buf + cnt, bufend - (buf + cnt), "\n"); > > + > > + return cnt; > > +} > > it seems /proc/meminfo is better. > because badpage is architecture independent concept. > > nonsense? The original patch used /proc/ (/proc/meminfo had badpage summary info and /proc/badram had detailed info. It was suggested that /sys was a better place. FWIW, I'm more than happy to put it anywhere deemed "best" by the community. It is currently /sys/kernel/badram. Thanks, -- Russ Anderson, OS RAS/Partitioning Project Lead SGI - Silicon Graphics Inc rja@sgi.com