[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <odohwdryb2yhzi5kzvlwv65kazbhzqyps6fzr2wukksdewukmr@gono7fdsth5d>
Date: Sun, 23 Jun 2024 18:21:36 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Jens Axboe <axboe@...nel.dk>, brauner@...nel.org, viro@...iv.linux.org.uk,
Bernd Schubert <bernd.schubert@...tmail.fm>, linux-mm@...ck.org, Josef Bacik <josef@...icpanda.com>
Subject: Re: [PATCH 3/5] fs: sys_ringbuffer
On Mon, Jun 24, 2024 at 12:13:36AM +0200, Thomas Gleixner wrote:
> Kent!
>
> On Sun, Jun 02 2024 at 20:33, Kent Overstreet wrote:
> > +/*
> > + * ringbuffer_ptrs - head and tail pointers for a ringbuffer, mappped to
> > + * userspace:
> > + */
> > +struct ringbuffer_ptrs {
>
> The naming is confusing. ringbuffer_ctrl or something like that would be
> more clear because it's more than just the pointers, which are in fact
> positions. You have size, mask ... too, no?
I like that name, yeah.
> > + /*
> > + * We use u32s because this type is shared between the kernel and
> > + * userspace - ulong/size_t won't work here, we might be 32bit userland
> > + * and 64 bit kernel, and u64 would be preferable (reduced probability
> > + * of ABA) but not all architectures can atomically read/write to a u64;
> > + * we need to avoid torn reads/writes.
>
> union rbmagic {
> u64 __val64;
> struct {
> // TOOTIRED: Add big/little endian voodoo
> u32 __val32;
> u32 __unused;
> };
> };
>
> Plus a bunch of accessors which depend on BITS_PER_LONG, no?
Not sure I follow?
I know biendian machines exist, but I've never heard of both big and
little endian being used at the same time. Nor why we'd care about
BITS_PER_LONG? This just uses fixed size integer types.
Powered by blists - more mailing lists