[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6B2BA408B38BA1478B473C31C3D2074E341D5854F7@SV-EXCHANGE1.Corp.FC.LOCAL>
Date: Wed, 25 Jun 2014 13:25:00 -0700
From: Motohiro Kosaki <Motohiro.Kosaki@...fujitsu.com>
To: Motohiro Kosaki <Motohiro.Kosaki@...fujitsu.com>,
Rafael Aquini <aquini@...hat.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>
CC: Andrew Morton <akpm@...ux-foundation.org>,
Rik van Riel <riel@...hat.com>, Mel Gorman <mgorman@...e.de>,
Johannes Weiner <hannes@...xchg.org>,
"Motohiro Kosaki JP" <kosaki.motohiro@...fujitsu.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] mm: export NR_SHMEM via sysinfo(2) / si_meminfo()
interfaces
> -----Original Message-----
> From: Motohiro.Kosaki@...fujitsu.com [mailto:Motohiro.Kosaki@...fujitsu.com]
> Sent: Wednesday, June 25, 2014 3:41 PM
> To: Rafael Aquini; linux-mm@...ck.org
> Cc: Andrew Morton; Rik van Riel; Mel Gorman; Johannes Weiner; Motohiro Kosaki JP; linux-kernel@...r.kernel.org
> Subject: RE: [PATCH] mm: export NR_SHMEM via sysinfo(2) / si_meminfo() interfaces
>
>
>
> > -----Original Message-----
> > From: Rafael Aquini [mailto:aquini@...hat.com]
> > Sent: Wednesday, June 25, 2014 2:40 PM
> > To: linux-mm@...ck.org
> > Cc: Andrew Morton; Rik van Riel; Mel Gorman; Johannes Weiner; Motohiro
> > Kosaki JP; linux-kernel@...r.kernel.org
> > Subject: [PATCH] mm: export NR_SHMEM via sysinfo(2) / si_meminfo()
> > interfaces
> >
> > This patch leverages the addition of explicit accounting for pages
> > used by shmem/tmpfs -- "4b02108 mm: oom analysis: add shmem vmstat" --
> > in order to make the users of sysinfo(2) and si_meminfo*() friends aware of that vmstat entry consistently across the interfaces.
>
> Why?
> Traditionally sysinfo.sharedram was not used for shmem. It was totally strange semantics and completely outdated feature.
> So, we may reuse it for another purpose. But I'm not sure its benefit.
>
> Why don't you use /proc/meminfo?
> I'm afraid userland programs get a confusion.
For the record. This is historical implementation at linux-2.3.12. I.e. account sum of page count.
void si_meminfo(struct sysinfo *val)
{
int i;
i = max_mapnr;
val->totalram = 0;
val->sharedram = 0;
val->freeram = nr_free_pages << PAGE_SHIFT;
val->bufferram = atomic_read(&buffermem);
while (i-- > 0) {
if (PageReserved(mem_map+i))
continue;
val->totalram++;
if (!page_count(mem_map+i))
continue;
val->sharedram += page_count(mem_map+i) - 1;
}
val->totalram <<= PAGE_SHIFT;
val->sharedram <<= PAGE_SHIFT;
return;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists