From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Pintu Agarwal <pintu.ping@gmail.com>
Cc: Pintu Kumar <quic_pintu@quicinc.com>,
open list <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm <linux-mm@kvack.org>,
ebiederm@xmission.com,
Christian Brauner <christian.brauner@ubuntu.com>,
sfr@canb.auug.org.au, legion@kernel.org, sashal@kernel.org,
chris.hyser@oracle.com, Colin Cross <ccross@google.com>,
Peter Collingbourne <pcc@google.com>,
dave@stgolabs.net, caoxiaofeng@yulong.com, david@redhat.com,
Vlastimil Babka <vbabka@suse.cz>,
linux-api@vger.kernel.org
Subject: Re: [PATCH v2] sysinfo: include availram field in sysinfo struct
Date: Mon, 10 Jan 2022 11:11:21 +0300 [thread overview]
Message-ID: <YdvqKWokVKgC0fDv@grain> (raw)
In-Reply-To: <CAOuPNLhcvbk3-rTPqmJj5LBOh4VaZ+Bc=-_j6xKOLM-kH6jkfw@mail.gmail.com>
On Sat, Jan 08, 2022 at 09:54:37PM +0530, Pintu Agarwal wrote:
> Thank you so much for your feedback...
> I had a need to get total/free/available memory in my application (on
> a memory constraint system).
> First I tried to parse these from /proc/meminfo but then I saw sysinfo
> already provides some information,
> however available field was missing. Just to get available field I
> need to again do all the file operations.
>
> Then I saw, even the "free" command doing this redundant work.
> Use sysinfo system call to get "total" and "free" memory then again
> get "available" memory from /proc/meminfo.
> Yet again, I see, even in kernel its reading from two different places
> while populating the /proc/meminfo.
> Also, I am sure there are plenty of other applications where this can
> be improved with this.
> Moreover, I think with this field there is not much use of other ram
> fields in sysinfo.
> Thus I felt a need to introduce this field to ease some operations.
Thanks for explanation.
>
> > Don't get me wrong please but such extension really need a strong
> > justification because they are part of UAPI and there is not that much
> > space left in sysinfo structure. We will _have_ to live with this new
> > field forever so I propose to not introduce anything new here until
> > we have no other choise or parsing meminfo become a really bottleneck.
> >
> My guess is that this situation might exist in other places as well ?
> How do we handle new field addition to existing system calls ?
If there is no space left in uapi structures then we simply can't extend
the syscall, since we're not allowed to break api. an option is to deprecate
old interface and introduce a new one but this is a painfull procedure that's
why i'm not convinced that we should extend sysinfo right now. but final
decision is up to mantainers of course.
next prev parent reply other threads:[~2022-01-10 8:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1641483250-18839-1-git-send-email-quic_pintu@quicinc.com>
[not found] ` <YdcUttZWaqYQpR1K@grain>
[not found] ` <CAOuPNLifYFPU4Gt2+1sOSsYNNLQq7U2aGVaYknrhaMc-CVx8vg@mail.gmail.com>
[not found] ` <Ydcmk+WaBWKlLkAw@grain>
[not found] ` <20220107120451.z2eqru2tm5mlhla3@wittgenstein>
[not found] ` <CAOuPNLiJZu_HJQ+Hf5BJOgmT+v7DT96VLkiXrfx0MJQrkD3rSw@mail.gmail.com>
2022-01-07 16:58 ` [PATCH] sysinfo: include availram field in sysinfo struct Vlastimil Babka
2022-01-07 17:47 ` Pintu Agarwal
2022-01-07 22:18 ` David Laight
2022-01-07 18:07 ` [PATCH v2] " Pintu Kumar
2022-01-07 21:01 ` Cyrill Gorcunov
2022-01-08 16:24 ` Pintu Agarwal
2022-01-10 8:11 ` Cyrill Gorcunov [this message]
2022-01-07 22:22 ` David Laight
2022-01-08 16:53 ` Pintu Agarwal
2022-01-08 22:35 ` David Laight
2022-01-10 14:55 ` Pintu Agarwal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YdvqKWokVKgC0fDv@grain \
--to=gorcunov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=caoxiaofeng@yulong.com \
--cc=ccross@google.com \
--cc=chris.hyser@oracle.com \
--cc=christian.brauner@ubuntu.com \
--cc=dave@stgolabs.net \
--cc=david@redhat.com \
--cc=ebiederm@xmission.com \
--cc=legion@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pcc@google.com \
--cc=pintu.ping@gmail.com \
--cc=quic_pintu@quicinc.com \
--cc=sashal@kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).