[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <54c8ecbd-1d6e-40f1-af30-7efd04c63a7e@app.fastmail.com>
Date: Fri, 27 Jan 2023 16:46:38 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Nhat Pham" <nphamcs@...il.com>,
"Andrew Morton" <akpm@...ux-foundation.org>
Cc: "Johannes Weiner" <hannes@...xchg.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, bfoster@...hat.com,
"Matthew Wilcox" <willy@...radead.org>, linux-api@...r.kernel.org,
kernel-team@...a.com
Subject: Re: [PATCH v8 2/3] cachestat: implement cachestat syscall
On Thu, Jan 26, 2023, at 18:53, Nhat Pham wrote:
>
> SYNOPSIS
> #include <sys/mman.h>
>
> struct cachestat {
> __u64 nr_cache;
> __u64 nr_dirty;
> __u64 nr_writeback;
> __u64 nr_evicted;
> __u64 nr_recently_evicted;
> };
>
> int cachestat(unsigned int fd, off_t off, size_t len,
> unsigned int cstat_version, struct cachestat *cstat,
> unsigned int flags);
Is this "off_t off" argument intentionally limited to the old
32-bit type on 32-bit architectures? Unfortunately I fear
there are no good options to pass an offset here:
- if you make it a 32-bit type, this breaks calling it from
normal userspace that defines off_t as a 64-bit type
- if you change it to a 64-bit loff_t, there are three
separate calling conventions for 64-bit, 32-bit with
aligned register pairs and other 32-bit, plus you
exceed the usual limit of six system call arguments
A separate problem may be the cstat_version argument, usually
we don't use interface versions but instead use a new
system call number if something changes in an incompatible
way.
Arnd
Powered by blists - more mailing lists