lkml.org 
[lkml]   [2012]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC 1/3] /dev/low_mem_notify
Date
On Wednesday 18 January 2012, Pekka Enberg wrote:
> >> +struct vmnotify_event {
> >> + /* Size of the struct for ABI extensibility. */
> >> + __u32 size;
> >> +
> >> + __u64 nr_avail_pages;
> >> +
> >> + __u64 nr_swap_pages;
> >> +
> >> + __u64 nr_free_pages;
> >> +};
> >
> > Two fields here most likely session-constant, (nr_avail_pages and
> > nr_swap_pages), seems not much sense to report them in every event. If we
> > have memory/swap hotplug user-space can use sysinfo() call.
>
> I actually changed the ABI to look like this:
>
> struct vmnotify_event {
> /*
> * Size of the struct for ABI extensibility.
> */
> __u32 size;
>
> __u64 attrs;
>
> __u64 attr_values[];
> };
>
> So userspace can decide which fields to include in notifications.

Please make the first member a __u64 instead of a __u32. This will
avoid incompatibility between 32 and 64 bit processes, which have
different alignment rules on x86: x86-32 would implicitly pack the
struct while x86-64 would add padding with your layout.

Arnd


\
 
 \ /
  Last update: 2012-01-24 17:25    [W:0.113 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site