[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6B2BA408B38BA1478B473C31C3D2074E341D585503@SV-EXCHANGE1.Corp.FC.LOCAL>
Date: Wed, 25 Jun 2014 13:27:53 -0700
From: Motohiro Kosaki <Motohiro.Kosaki@...fujitsu.com>
To: Rafael Aquini <aquini@...hat.com>
CC: "linux-mm@...ck.org" <linux-mm@...ck.org>,
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: Rafael Aquini [mailto:aquini@...hat.com]
> Sent: Wednesday, June 25, 2014 4:16 PM
> To: Motohiro Kosaki
> Cc: linux-mm@...ck.org; 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
>
> On Wed, Jun 25, 2014 at 12:41:17PM -0700, Motohiro Kosaki wrote:
> >
> >
> > > -----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?
>
> Because we do not report consistently across the interfaces we declare exporting that data. Check sysinfo(2) manpage, for instance:
> [...]
> struct sysinfo {
> long uptime; /* Seconds since boot */
> unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
> unsigned long totalram; /* Total usable main memory size */
> unsigned long freeram; /* Available memory size */
> unsigned long sharedram; /* Amount of shared memory */ <<<<< [...]
>
> userspace tools resorting to sysinfo() syscall will get a hardcoded 0 for shared memory which is reported differently from
> /proc/meminfo.
>
> Also, si_meminfo() & si_meminfo_node() are utilized within the kernel to gather statistics for /proc/meminfo & friends, and so we
> can leverage collecting sharedmem from those calls as well, just as we do for totalram, freeram & bufferram.
But "Amount of shared memory" didn't mean amout of shmem. It actually meant amout of page of page-count>=2.
Again, there is a possibility to change the semantics. But I don't have enough userland knowledge to do. Please investigate
and explain why your change don't break any userland.
--
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