lkml.org 
[lkml]   [2008]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/3] ia64: Call migration code on correctable errors v6
    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?




    \
     
     \ /
      Last update: 2008-06-23 05:29    [W:0.042 / U:0.668 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site