lkml.org 
[lkml]   [2022]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sysinfo: include availram field in sysinfo struct
On Thu, Jan 06, 2022 at 10:19:55PM +0530, Pintu Agarwal wrote:
> > > diff --git a/include/uapi/linux/sysinfo.h b/include/uapi/linux/sysinfo.h
> > > index 435d5c2..6e77e90 100644
> > > --- a/include/uapi/linux/sysinfo.h
> > > +++ b/include/uapi/linux/sysinfo.h
> > > @@ -12,6 +12,7 @@ struct sysinfo {
> > > __kernel_ulong_t freeram; /* Available memory size */
> > > __kernel_ulong_t sharedram; /* Amount of shared memory */
> > > __kernel_ulong_t bufferram; /* Memory used by buffers */
> > > + __kernel_ulong_t availram; /* Memory available for allocation */
> > > __kernel_ulong_t totalswap; /* Total swap space size */
> > > __kernel_ulong_t freeswap; /* swap space still available */
> > > __u16 procs; /* Number of current processes */
> >
> > Hi! Sorry, but I don't understand -- the sysinfo structure seems to
> > be part of user API, no? Don't we break it up here?
>
> Yes, the corresponding user space header /usr/include/linux/sysinfo.h
> also needs to be updated.
> When we generate the kernel header it will be updated automatically.

Wait. The userspace may pass old structure here, and in result we
return incorrect layout which won't match old one, no? Old binary
code has no clue about this header update.

\
 
 \ /
  Last update: 2022-01-06 18:28    [W:0.084 / U:2.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site